Class MPI.Pointer
- Description
A pointer like class. Because MPI.Comm->Recv() et al do not return "results" but take references/pointers to the target storage, you need to pass a Pointer to
MPI.Comm()->recv()
in order to receive the string.- Example
int main() { string s; MPI.Pointer p = MPI.Pointer();
MPI.Init();
if (MPI.world->rank()) MPI.world->Send(ctime(time(1)), 0); else for (int i = 1; i < MPI.world->size; i++) { MPI.world->Recv(p, i); write("Rank %03d says now is %s.\n", p()); }
MPI.Finalize(); return 0; }