Hi all,
I'am writing a small program where the process of rank 0 sends "alo
alo" to the process of rank 1 and then process 1 will show this message on
screen. I am using boost++ library but result stays the same when I use the MPI
standard.
The program work locally ( that means: mpirun --host localhost), on the distant
machine (mpirun --host name_of_distant_machine) but not on both ( mpirun --host
localhost, name_of_distant_machine). There is no error message so i don't have
any idea to resolve this.
The machine I am running is a virtual one, and the distant machine too.
Thank you in advance!
Son.
Nguyen Kim Son.
Antibes, France
Tel: +336 48 28 37 47
#include <boost/mpi.hpp>
#include <iostream>
#include <string>
using namespace std;
namespace mpi=boost::mpi;
int main(int argc, char ** argv){
mpi::environment env(argc, argv);
mpi::communicator world;
int rank = world.rank();
string s;
int tag = 10;
if (rank == 0){
int dest = 1;
s = "alo alo?";
world.send(dest, tag,s );//blocking communication
}else if (rank==1){
int source = 0;
world.recv(source, tag, s);
cout << s << endl;
};
};