|
From: Meseret G. <mez...@gm...> - 2009-02-04 23:15:12
|
#include <mpi.h>
#include <iostream>
#include <vector>
#include <map>
using namespace std;
int main(int argc, char* argv[]){
int rank;
MPI::Init(argc,argv);
rank = MPI::COMM_WORLD.Get_rank();
if (rank == 0){
char* hello = "hello mez";
MPI::COMM_WORLD.Send(hello, 10, MPI::CHAR,1,1);
}
else{
MPI::Status status;
char hello[10];
MPI::COMM_WORLD.Recv( hello,10, MPI::CHAR , 0 , 1, status);
cout << "Got From Root: " << hello << endl;
}//end if
MPI::Finalize();
return 0;
}
|