Changes between Version 18 and Version 19 of MessagePassing


Ignore:
Timestamp:
09/13/13 09:37:29 (13 years ago)
Author:
siegel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • MessagePassing

    v18 v19  
    9999void MPI_Recv(int pid, void *buf, int count, MPI_Datataype type, int source, int tag, MPI_Comm comm, MPI_Status *status) {
    100100  int size = sizeofDatatype(type)*count;
    101   // the following is a system function with built-in guard:
    102   $message m = $comm_dequeue(*comm, source, pid, tag);
    103101
    104   status->size = $message_size(m);
    105   status->source = $message_source(m);
    106   status->dest = $message_dest(m);
    107   $message_unpack(m, buf, size); // will throw exception if message too big
     102  when ($comm_probe(*comm, source, pid, tag)) {
     103    int index = $comm_seek(*comm, source, pid, tag);
     104    $message m = $comm_get(*comm, source, pid, index);
     105
     106    *comm = $comm_dequeue(*comm, source, pid, index);
     107    status->size = $message_size(m);
     108    status->source = $message_source(m);
     109    status->dest = $message_dest(m);
     110    $message_unpack(m, buf, size); // will throw exception if message too big
     111  }
    108112}
    109113