2

希望这不是一个重复的问题,但我在平衡本地集群上的工作负载时遇到了问题。这是我当前的 MPI 主机文件:

#The Hostfile for Open MPI
#Master Node, 'slots=2' is used because we are running an 2-core machine
localhost slots=2

#Slave nodes, 8-core machines as well
slave1-ip slots=2
slave2-ip slots=2
slave3-ip slots=2

当我运行时mpirun -np 4 --hostfile my_hostfile program,它会优先在本地主机上进行所有计算。

比如在我的nqueens代码中,最后的计算分布是:

Node 1 computed load of 1963
Node 2 computed load of 0
Node 3 computed load of 0
Node 4 computed load of 1

但是,当我修改我的主机文件以便行localhost slots=2到 时localhost slots=1,所有计算都在从节点上运行,并且我得到了更均匀的分布:

Node 1 computed load of 497
Node 2 computed load of 486
Node 3 computed load of 493
Node 4 computed load of 488

有没有办法在主线程上进行负载平衡,以便在我有的时候将工作分散到主节点和从节点上localhost slots=2?是否有某种配置文件可以指定这一点?我已经尝试过--loadbalance国旗,但什么也没做。

PS我在设置集群时遵循了本教程:http: //techtinkering.com/2009/12/02/setting-up-a-beowulf-cluster-using-open-mpi-on-linux/

4

0 回答 0