source: proiecte/hpl/openmpi_compiled/share/man/man3/MPI_Waitsome.3 @ 97

Last change on this file since 97 was 97, checked in by (none), 14 years ago

Adding compiled files

File size: 5.9 KB
Line 
1.\"Copyright 2006-2008 Sun Microsystems, Inc.
2.\" Copyright (c) 1996 Thinking Machines Corporation
3.TH MPI_Waitsome 3 "Dec 08, 2009" "1.4" "Open MPI"
4.SH NAME
5\fBMPI_Waitsome\fP \- Waits for some given communications to complete.
6
7.SH SYNTAX
8.ft R
9.SH C Syntax
10.nf
11#include <mpi.h>
12int MPI_Waitsome(int \fIincount\fP, MPI_Request \fI*array_of_requests\fP,
13        int\fI *outcount\fP, int\fI *array_of_indices\fP,
14        MPI_Status \fI*array_of_statuses\fP)
15
16.SH Fortran Syntax
17.nf
18INCLUDE 'mpif.h'
19MPI_WAITSOME(\fIINCOUNT, ARRAY_OF_REQUESTS, OUTCOUNT,
20                ARRAY_OF_INDICES, ARRAY_OF_STATUSES, IERROR\fP)
21        INTEGER \fIINCOUNT, ARRAY_OF_REQUESTS(*), OUTCOUNT\fP
22        INTEGER \fIARRAY_OF_INDICES(*)\fP
23        INTEGER \fIARRAY_OF_STATUSES(MPI_STATUS_SIZE*)\fP
24        INTEGER \fIIERROR\fP
25
26.SH C++ Syntax
27.nf
28#include <mpi.h>
29static int Request::Waitsome(int \fIincount\fP, Request
30        \fIarray_of_requests\fP[], int \fIarray_of_indices\fP[], Status \fIarray_of_statuses\fP[])
31
32static int Request::Waitsome(int \fIincount\fP, Request
33        \fIarray_of_requests\fP[], int \fIarray_of_indices\fP[])
34
35.SH INPUT PARAMETERS
36.ft R
37.TP 1i
38incount     
39Length of array_of_requests (integer).
40.TP 1i
41array_of_requests
42Array of requests (array of handles).
43
44.SH OUTPUT PARAMETERS
45.ft R
46.TP 1i
47outcount     
48Number of completed requests (integer).
49.TP 1i
50array_of_indices
51Array of indices of operations that completed (array of integers).
52.TP 1i
53array_of_statuses
54Array of status objects for operations that completed (array of status).
55.ft R
56.TP 1i
57IERROR
58Fortran only: Error status (integer).
59
60.SH DESCRIPTION
61.ft R
62Waits until at least one of the operations associated with active handles in the list have completed. Returns in outcount the number of requests from the list array_of_requests that have completed. Returns in the first outcount locations of the array array_of_indices the indices of these operations (index within the array array_of_requests; the array is indexed from 0 in C and from 1 in Fortran). Returns in the first outcount locations of the array array_of_status the status for these completed operations. If a request that completed was allocated by a nonblocking communication call, then it is deallocated, and the associated handle is set to MPI_REQUEST_NULL. 
63.sp
64If the list contains no active handles, then the call returns immediately with outcount = MPI_UNDEFINED.
65.sp
66When one or more of the communications completed by MPI_Waitsome fails, then it is desirable to return specific information on each communication. The arguments outcount, array_of_indices, and array_of_statuses will be adjusted to indicate completion of all communications that have succeeded or failed. The call will return the error code MPI_ERR_IN_STATUS and the error field of each status returned will be set to indicate success or to indicate the specific error that occurred. The call will return MPI_SUCCESS if no request resulted in an error, and will return another error code if it failed for other reasons (such as invalid arguments). In such cases, it will not update the error fields of the statuses. 
67.sp
68If 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.
69.sp   
70\fBExample:\fR Same code as the example in the MPI_Waitany man page, but using MPI_Waitsome.
71.sp
72.nf
73    CALL MPI_COMM_SIZE(comm, size, ierr)
74    CALL MPI_COMM_RANK(comm, rank, ierr)
75    IF(rank .GT. 0) THEN         ! client code
76        DO WHILE(.TRUE.)
77           CALL MPI_ISEND(a, n, MPI_REAL, 0, tag, comm, request, ierr)
78           CALL MPI_WAIT(request, status, ierr)
79        END DO
80    ELSE         ! rank=0 -- server code
81        DO i=1, size-1
82           CALL MPI_IRECV(a(1,i), n, MPI_REAL, i, tag,
83                          comm, requests(i), ierr)
84        END DO
85        DO WHILE(.TRUE.)
86           CALL MPI_WAITSOME(size, request_list, numdone,
87                            indices, statuses, ierr)
88           DO i=1, numdone
89              CALL DO_SERVICE(a(1, indices(i)))
90              CALL MPI_IRECV(a(1, indices(i)), n, MPI_REAL, 0, tag,
91                           comm, requests(indices(i)), ierr)
92           END DO
93        END DO
94    END IF
95.fi
96.sp
97.SH NOTES
98.ft R
99The array of indices are in the range 0 to incount-1 for C and in the range 1 to incount for Fortran.
100
101.SH ERRORS
102For each invocation of MPI_Waitsome, if one or more requests generate
103an MPI exception, only the \fIfirst\fP MPI request that caused an
104exception will be passed to its corresponding error handler.  No other
105error handlers will be invoked (even if multiple requests generated
106exceptions).  However, \fIall\fP requests that generate an exception
107will have a relevant error code set in the corresponding
108status.MPI_ERROR field (unless MPI_IGNORE_STATUSES was used).
109.sp
110The default error handler aborts the MPI job, except for I/O function
111errors. The error handler may be changed with MPI_Comm_set_errhandler,
112MPI_File_set_errhandler, or MPI_Win_set_errhandler (depending on the
113type of MPI handle that generated the MPI request); the predefined
114error handler MPI_ERRORS_RETURN may be used to cause error values to
115be returned. Note that MPI does not guarantee that an MPI program can
116continue past an error.
117.sp
118If the invoked error handler allows MPI_Waitsome to return to the
119caller, the value MPI_ERR_IN_STATUS will be returned in the C and
120Fortran bindings.  In C++, if the predefined error handler
121MPI::ERRORS_THROW_EXCEPTIONS is used, the value MPI::ERR_IN_STATUS
122will be contained in the MPI::Exception object.  The MPI_ERROR field
123can then be examined in the array of returned statuses to determine
124exactly which request(s) generated an exception.
125
126.SH SEE ALSO
127.ft R
128.sp
129MPI_Comm_set_errhandler
130.br
131MPI_File_set_errhandler
132.br
133MPI_Test
134.br
135MPI_Testall
136.br
137MPI_Testany
138.br
139MPI_Testsome
140.br
141MPI_Wait
142.br
143MPI_Waitall
144.br
145MPI_Waitany
146.br
147MPI_Win_set_errhandler
148.br
149
Note: See TracBrowser for help on using the repository browser.