[97] | 1 | .\"Copyright 2006-2008 Sun Microsystems, Inc. |
---|
| 2 | .\" Copyright (c) 1996 Thinking Machines Corporation |
---|
| 3 | .\"Copyright 2007-2008 Cisco Systems, Inc. All rights reserved. |
---|
| 4 | .TH MPI_Test 3 "Dec 08, 2009" "1.4" "Open MPI" |
---|
| 5 | .SH NAME |
---|
| 6 | \fBMPI_Test\fP \- Tests for the completion of a specific send or receive. |
---|
| 7 | |
---|
| 8 | .SH SYNTAX |
---|
| 9 | .ft R |
---|
| 10 | .SH C Syntax |
---|
| 11 | .nf |
---|
| 12 | #include <mpi.h> |
---|
| 13 | int MPI_Test(MPI_Request *\fIrequest\fP, int\fI *flag\fP, MPI_Status\fI *status\fP) |
---|
| 14 | |
---|
| 15 | .SH Fortran Syntax |
---|
| 16 | .nf |
---|
| 17 | INCLUDE 'mpif.h' |
---|
| 18 | MPI_TEST(\fIREQUEST, FLAG, STATUS, IERROR\fP) |
---|
| 19 | LOGICAL \fIFLAG\fP |
---|
| 20 | INTEGER \fIREQUEST, STATUS(MPI_STATUS_SIZE), IERROR\fP |
---|
| 21 | |
---|
| 22 | .SH C++ Syntax |
---|
| 23 | .nf |
---|
| 24 | #include <mpi.h> |
---|
| 25 | bool Request::Test(Status& \fIstatus\fP) |
---|
| 26 | |
---|
| 27 | bool Request::Test() |
---|
| 28 | |
---|
| 29 | .SH INPUT PARAMETER |
---|
| 30 | .ft R |
---|
| 31 | .TP 1i |
---|
| 32 | request |
---|
| 33 | Communication request (handle). |
---|
| 34 | |
---|
| 35 | .SH OUTPUT PARAMETERS |
---|
| 36 | .ft R |
---|
| 37 | .TP 1i |
---|
| 38 | flag |
---|
| 39 | True if operation completed (logical). |
---|
| 40 | .TP 1i |
---|
| 41 | status |
---|
| 42 | Status object (status). |
---|
| 43 | .ft R |
---|
| 44 | .TP 1i |
---|
| 45 | IERROR |
---|
| 46 | Fortran only: Error status (integer). |
---|
| 47 | |
---|
| 48 | .SH DESCRIPTION |
---|
| 49 | .ft R |
---|
| 50 | A call to MPI_Test returns flag = true if the operation identified by request is complete. In such a case, the status object is set to contain information on the completed operation; if the communication object was created by a nonblocking send or receive, then it is deallocated and the request handle is set to MPI_REQUEST_NULL. The call returns flag = false, otherwise. In this case, the value of the status object is undefined. MPI_Test is a local operation. |
---|
| 51 | .sp |
---|
| 52 | The return status object for a receive operation carries information that can be accessed as described in Section 3.2.5 of the MPI-1 Standard, "Return Status." The status object for a send operation carries information that can be accessed by a call to MPI_Test_cancelled (see Section 3.8 of the MPI-1 Standard, "Probe and Cancel"). |
---|
| 53 | .sp |
---|
| 54 | If your application does not need to examine the \fIstatus\fP field, you can save resources by using the predefined constant MPI_STATUS_IGNORE as a special value for the \fIstatus\fP argument. |
---|
| 55 | .sp |
---|
| 56 | One is allowed to call MPI_Test with a null or inactive \fIrequest\fP argument. In such a case the operation returns with \fIflag\fP = true and empty \fIstatus\fP. |
---|
| 57 | .sp |
---|
| 58 | The functions MPI_Wait and MPI_Test can be used to complete both sends and |
---|
| 59 | receives. |
---|
| 60 | |
---|
| 61 | .SH NOTES |
---|
| 62 | The use of the nonblocking MPI_Test call allows the user to schedule alternative activities within a single thread of execution. An event-driven thread scheduler can be emulated with periodic calls to MPI_Test. |
---|
| 63 | |
---|
| 64 | .SH ERRORS |
---|
| 65 | Almost all MPI routines return an error value; C routines as the value of the function and Fortran routines in the last argument. C++ functions do not return errors. If the default error handler is set to MPI::ERRORS_THROW_EXCEPTIONS, then on error the C++ exception mechanism will be used to throw an MPI::Exception object. |
---|
| 66 | .sp |
---|
| 67 | Before the error value is returned, the current MPI error handler is |
---|
| 68 | called. By default, this error handler aborts the MPI job, except for |
---|
| 69 | I/O function errors. The error handler may be changed with |
---|
| 70 | MPI_Comm_set_errhandler, MPI_File_set_errhandler, or |
---|
| 71 | MPI_Win_set_errhandler (depending on the type of MPI handle that |
---|
| 72 | generated the request); the predefined error handler MPI_ERRORS_RETURN |
---|
| 73 | may be used to cause error values to be returned. Note that MPI does |
---|
| 74 | not guarantee that an MPI program can continue past an error. |
---|
| 75 | .sp |
---|
| 76 | Note that per MPI-1 section 3.2.5, MPI exceptions on requests passed |
---|
| 77 | to MPI_TEST do not set the status.MPI_ERROR field in the returned |
---|
| 78 | status. The error code is passed to the back-end error handler |
---|
| 79 | and may be passed back to the caller through the return value of |
---|
| 80 | MPI_TEST if the back-end error handler returns it. The |
---|
| 81 | pre-defined MPI error handler MPI_ERRORS_RETURN exhibits this |
---|
| 82 | behavior, for example. |
---|
| 83 | |
---|
| 84 | .SH SEE ALSO |
---|
| 85 | .ft R |
---|
| 86 | .sp |
---|
| 87 | MPI_Comm_set_errhandler |
---|
| 88 | .br |
---|
| 89 | MPI_File_set_errhandler |
---|
| 90 | .br |
---|
| 91 | MPI_Testall |
---|
| 92 | .br |
---|
| 93 | MPI_Testany |
---|
| 94 | .br |
---|
| 95 | MPI_Testsome |
---|
| 96 | .br |
---|
| 97 | MPI_Wait |
---|
| 98 | .br |
---|
| 99 | MPI_Waitall |
---|
| 100 | .br |
---|
| 101 | MPI_Waitany |
---|
| 102 | .br |
---|
| 103 | MPI_Waitsome |
---|
| 104 | .br |
---|
| 105 | MPI_Win_set_errhandler |
---|
| 106 | .br |
---|
| 107 | |
---|