Class MPI.Status

Description

Objects of this class can be passed as the last argument to the receive operation of MPI.Comm communicators. After the operation has finished, they will contain information about the sender the message was received from and the tag used for communication.

Therefore, Status objects are particularly helpful in combination with MPI.ANY_SOURCE and MPI.ANY_TAG.

See also

MPI.Comm()->Recv()


Variable SOURCE

int MPI.Status.SOURCE

Description

Contains the source that the message was received from.

Example

int main() { if (MPI.world->rank) { sleep(random(MPI.world->size)/10.0); MPI.world->Send(gethostname(), MPI.world->rank), 0); } else { MPI.Status status; MPI.Pointer p;

for (int i = 0; i < MPI.world->size; i++) { MPI.world->Recv(p, MPI.ANY_SOURCE, 0, status); write("Rank %d has hostname %s.\n", status->SOURCE, p()); } }

return 0; }

See also

MPI.Comm()->Recv()


Variable TAG

int MPI.Status.TAG

Description

Contains the tag that was used in the MPI.Comm()->Recv operation.

See also

MPI.Comm()->Recv()