1
我在每臺機器上使用MPICH和Boost爲3個虛擬機設置了一個Beowulf羣集。 我的程序在羣集上正常工作,但是當我嘗試使用boost :: split時,無限期地執行塊。在分離呼叫時提升MPI塊
看看下面的代碼:
#include <boost/mpi.hpp>
#include <iostream>
namespace mpi = boost::mpi;
int main (int argc , char* argv[])
{
mpi::environment env(argc,argv);
mpi::communicator world;
int group_id = world.rank()%3;
mpi::communicator local = world.split(group_id);
std::cout << "I am process " << world.rank() << " of " << world.size() << "." << std::endl;
std::cout << "I am sub-process " << local.rank() << " of " << local.size() << "." << std::endl;
return 0;
}
當集羣上執行,沒有任何反應。 但如果我只在單個節點上執行它(讓我們用-np 9說了),它工作得很好:
I am process 5 of 9.
I am process 2 of 9.
I am process 3 of 9.
I am process 1 of 9.
I am process 6 of 9.
I am process 7 of 9.
I am process 0 of 9.
I am process 4 of 9.
I am sub-process 2 of 3.
I am sub-process 0 of 3.
I am sub-process 1 of 3.
I am sub-process 2 of 3.
I am sub-process 1 of 3.
I am sub-process 1 of 3.
I am sub-process 0 of 3.
I am process 8 of 9.
I am sub-process 2 of 3.
I am sub-process 0 of 3.
刪除了boost ::拆分呼叫使得例如執行按預期在3節點,所以這裏的分裂呼叫顯然是有罪的。
任何想法我做錯了boost :: split?