Hi,
I am trying to use Boost.MPI to do a very simple program that
1. Processes from different ranks do a gather operation
2. The gather operation will gather the CoProcessInfo ( which is just
a data structure of rank# and hostname) into a vector
3. After the gather operation, Rank 0 will print the CoProcessInfo
one by one in the vector.
------------------------------------------------------------------------------------------------------------------------------------------------------
My testing environment consists of TWO virtual machine ( each of the
machine has two cores ):
Centos 5.5
mpich2
Boost.mpich2
Boost 1.41
mpiexec
------------------------------------------------------------------------------------------------------------------------------------------------------
The expected output of the program should be something like ( just an
example order of ranks ):
Host VM1, Rank 0
Host VM1, Rank 1
Host VM2, Rank 2
Host VM2, Rank 3
----------------------------------------------------------------------------------------------------------------------------------------------------------
However, I got something like: ( just an example order of ranks ), the
hostname is incorrect after gather operation ( three VM2 appears!)
Host VM1, Rank 0
Host VM2, Rank 1
Host VM2, Rank 2
Host VM2, Rank 3
I found that each process CAN correctly found out the hostname and
rank#, however, the data will become a bit like overwritten, after the
gather operation. Thank you very much.
------------------------------------------- Source Code
-------------------------------------------------------------------
#include