[97] | 1 | .\"Copyright 2006-2008 Sun Microsystems, Inc. |
---|
| 2 | .\" Copyright (c) 1996 Thinking Machines Corporation |
---|
| 3 | .TH MPI_Testsome 3 "Dec 08, 2009" "1.4" "Open MPI" |
---|
| 4 | .SH NAME |
---|
| 5 | \fBMPI_Testsome\fP \- Tests for completion of one or more previously initiated communications in a list. |
---|
| 6 | |
---|
| 7 | .SH SYNTAX |
---|
| 8 | .ft R |
---|
| 9 | .SH C Syntax |
---|
| 10 | .nf |
---|
| 11 | #include <mpi.h> |
---|
| 12 | int MPI_Testsome(int \fIincount\fP, MPI_Request \fI*array_of_requests\fP, |
---|
| 13 | int\fI *outcount\fP, int\fI *array_of_indices\fP, MPI_Status\fI *array_of_statuses\fP) |
---|
| 14 | |
---|
| 15 | .SH Fortran Syntax |
---|
| 16 | .nf |
---|
| 17 | INCLUDE 'mpif.h' |
---|
| 18 | MPI_TESTSOME(\fIINCOUNT, ARRAY_OF_REQUESTS, OUTCOUNT, |
---|
| 19 | ARRAY_OF_INDICES, ARRAY_OF_STATUSES, IERROR\fP) |
---|
| 20 | INTEGER \fIINCOUNT, ARRAY_OF_REQUESTS(*)\fP |
---|
| 21 | INTEGER \fIOUTCOUNT, ARRAY_OF_INDICES(*)\fP |
---|
| 22 | INTEGER \fIARRAY_OF_STATUSES(MPI_STATUS_SIZE,*), IERROR\fP |
---|
| 23 | |
---|
| 24 | .SH C++ Syntax |
---|
| 25 | .nf |
---|
| 26 | #include <mpi.h> |
---|
| 27 | static int Request::Testsome(int \fIincount\fP, Request |
---|
| 28 | \fIarray_of_requests\fP[], int \fIarray_of_indices\fP[], Status \fIarray_of_statuses\fP[]) |
---|
| 29 | |
---|
| 30 | static int Request::Testsome(int \fIincount\fP, Request |
---|
| 31 | \fIarray_of_requests\fP[], int \fIarray_of_indices\fP[]) |
---|
| 32 | |
---|
| 33 | .SH INPUT PARAMETERS |
---|
| 34 | .ft R |
---|
| 35 | .TP 1i |
---|
| 36 | incount |
---|
| 37 | Length of array_of_requests (integer). |
---|
| 38 | .TP 1i |
---|
| 39 | array_of_requests |
---|
| 40 | Array of requests (array of handles). |
---|
| 41 | |
---|
| 42 | .SH OUTPUT PARAMETERS |
---|
| 43 | .ft R |
---|
| 44 | .TP 1i |
---|
| 45 | outcount |
---|
| 46 | Number of completed requests (integer). |
---|
| 47 | .TP 1i |
---|
| 48 | array_of_indices |
---|
| 49 | Array of indices of operations that completed (array of integers). |
---|
| 50 | .TP 1i |
---|
| 51 | array_of_statuses |
---|
| 52 | Array of status objects for operations that completed (array of status). |
---|
| 53 | .ft R |
---|
| 54 | .TP 1i |
---|
| 55 | IERROR |
---|
| 56 | Fortran only: Error status (integer). |
---|
| 57 | |
---|
| 58 | .SH DESCRIPTION |
---|
| 59 | .ft R |
---|
| 60 | Behaves like MPI_Waitsome, except that it returns immediately. If no operation has completed it returns outcount = 0. If there is no active handle in the list, it returns outcount = MPI_UNDEFINED. |
---|
| 61 | .sp |
---|
| 62 | MPI_Testsome is a local operation, which returns immediately, whereas MPI_Waitsome blocks until a communication completes, if it was passed a list that contains at least one active handle. Both calls fulfill a fairness requirement: If a request for a receive repeatedly appears in a list of requests passed to MPI_Waitsome or MPI_Testsome, and a matching send has been posted, then the receive will eventually succeed unless the send is satisfied by another receive; send requests also fulfill this fairness requirement. |
---|
| 63 | .sp |
---|
| 64 | Errors that occur during the execution of MPI_Testsome are handled as for |
---|
| 65 | MPI_Waitsome. |
---|
| 66 | .sp |
---|
| 67 | If your application does not need to examine the \fIarray_of_statuses\fP field, you can save resources by using the predefined constant MPI_STATUSES_IGNORE can be used as a special value for the \fIarray_of_statuses\fP argument. |
---|
| 68 | |
---|
| 69 | .SH NOTES |
---|
| 70 | The use of MPI_Testsome is likely to be more |
---|
| 71 | efficient than the use of MPI_Testany. The former returns information on all completed communications; with the latter, a new call is required for each communication that completes. |
---|
| 72 | .sp |
---|
| 73 | A server with multiple clients can use MPI_Waitsome so as not to starve any client. Clients send messages to the server with service requests. The server calls MPI_Waitsome with one receive request for each client, then handles all receives that have completed. If a call to MPI_Waitany is used instead, then one client could starve while requests from another client always sneak in first. |
---|
| 74 | |
---|
| 75 | .SH ERRORS |
---|
| 76 | For each invocation of MPI_Testsome, if one or more requests generate |
---|
| 77 | an MPI exception, only the \fIfirst\fP MPI request that caused an |
---|
| 78 | exception will be passed to its corresponding error handler. No other |
---|
| 79 | error handlers will be invoked (even if multiple requests generated |
---|
| 80 | exceptions). However, \fIall\fP requests that generate an exception |
---|
| 81 | will have a relevant error code set in the corresponding |
---|
| 82 | status.MPI_ERROR field (unless MPI_IGNORE_STATUSES was used). |
---|
| 83 | .sp |
---|
| 84 | The default error handler aborts the MPI job, except for I/O function |
---|
| 85 | errors. The error handler may be changed with MPI_Comm_set_errhandler, |
---|
| 86 | MPI_File_set_errhandler, or MPI_Win_set_errhandler (depending on the |
---|
| 87 | type of MPI handle that generated the MPI request); the predefined |
---|
| 88 | error handler MPI_ERRORS_RETURN may be used to cause error values to |
---|
| 89 | be returned. Note that MPI does not guarantee that an MPI program can |
---|
| 90 | continue past an error. |
---|
| 91 | .sp |
---|
| 92 | If the invoked error handler allows MPI_Testsome to return to the |
---|
| 93 | caller, the value MPI_ERR_IN_STATUS will be returned in the C and |
---|
| 94 | Fortran bindings. In C++, if the predefined error handler |
---|
| 95 | MPI::ERRORS_THROW_EXCEPTIONS is used, the value MPI::ERR_IN_STATUS |
---|
| 96 | will be contained in the MPI::Exception object. The MPI_ERROR field |
---|
| 97 | can then be examined in the array of returned statuses to determine |
---|
| 98 | exactly which request(s) generated an exception. |
---|
| 99 | |
---|
| 100 | .SH SEE ALSO |
---|
| 101 | .ft R |
---|
| 102 | .sp |
---|
| 103 | MPI_Comm_set_errhandler |
---|
| 104 | .br |
---|
| 105 | MPI_File_set_errhandler |
---|
| 106 | .br |
---|
| 107 | MPI_Test |
---|
| 108 | .br |
---|
| 109 | MPI_Testall |
---|
| 110 | .br |
---|
| 111 | MPI_Testany |
---|
| 112 | .br |
---|
| 113 | MPI_Wait |
---|
| 114 | .br |
---|
| 115 | MPI_Waitall |
---|
| 116 | .br |
---|
| 117 | MPI_Waitany |
---|
| 118 | .br |
---|
| 119 | MPI_Waitsome |
---|
| 120 | .br |
---|
| 121 | MPI_Win_set_errhandler |
---|
| 122 | .br |
---|
| 123 | |
---|