コード例 #1
0
 /**
  * Wait for the message passing operation associated with this CommRequest object to finish. If
  * the message passing operation involved a receive, a {@linkplain CommStatus} object is returned
  * giving the results of the receive, otherwise null is returned.
  *
  * <p>For a receive operation, the returned status object gives the actual rank of the process
  * that sent the message, the actual message tag that was received, and the actual number of data
  * items in the message. If the actual number of data items in the message is less than the length
  * of the receive buffer, nothing is stored into the extra data items at the end of the buffer. If
  * the actual number of data items in the message is greater than the length of the receive
  * buffer, the extra data items at the end of the message are discarded.
  *
  * <p><I>Note:</I> If the <TT>waitForFinish()</TT> method is called on a newly-created CommRequest
  * object that has not been passed to or returned from a communicator's non-blocking send or
  * receive method, the <TT>waitForFinish()</TT> method immediately returns null.
  *
  * @return Status object for a receive operation, otherwise null.
  * @exception IOException Thrown if an I/O error occurred.
  */
 public CommStatus waitForFinish() throws IOException {
   if (mySendRequest != null) {
     mySendRequest.waitForFinish();
   }
   if (myRecvRequest != null) {
     benchmarks.detinfer.pj.edu.ritmp.Status status = myRecvRequest.waitForFinish();
     return new CommStatus(Comm.getFarRank(status.channel), status.tag, status.length);
   } else {
     return null;
   }
 }