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

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

Adding compiled files

File size: 4.4 KB
Line 
1.\"Copyright 2006-2008 Sun Microsystems, Inc.
2.\" Copyright (c) 1996 Thinking Machines Corporation
3.TH MPI_Waitany 3 "Dec 08, 2009" "1.4" "Open MPI"
4.SH NAME
5\fBMPI_Waitany\fP \- Waits for any specified send or receive to complete.
6
7.SH SYNTAX
8.ft R
9.SH C Syntax
10.nf
11#include <mpi.h>
12int MPI_Waitany(int \fIcount\fP, MPI_Request\fI *array_of_requests\fP,
13        int \fI*index\fP, MPI_Status\fI *status\fP)
14
15.SH Fortran Syntax
16.nf
17INCLUDE 'mpif.h'
18MPI_WAITANY(\fICOUNT, ARRAY_OF_REQUESTS, INDEX, STATUS, IERROR\fP)
19        INTEGER \fICOUNT, ARRAY_OF_REQUESTS(*), INDEX\fP
20        INTEGER \fISTATUS(MPI_STATUS_SIZE), IERROR\fP
21
22.SH C++ Syntax
23.nf
24#include <mpi.h>
25static int Request::Waitany(int \fIcount\fP, Request
26        \fIarray_of_requests\fP[], Status& \fIstatus\fP)
27
28static int Request::Waitany(int \fIcount\fP, Request \fIarray_of_requests\fP[])
29
30.SH INPUT PARAMETERS
31.ft R
32.TP 1i
33count     
34List length (integer).
35.TP 1i
36array_of_requests
37Array of requests (array of handles).
38.sp
39
40.SH OUTPUT PARAMETERS
41.ft R
42.TP 1i
43index     
44Index of handle for operation that completed (integer). In the range 0 to
45count-1.  In Fortran, the range is 1 to count.
46.TP 1i
47status     
48Status object (status).
49.sp
50.ft R
51.TP 1i
52IERROR
53Fortran only: Error status (integer).
54
55.SH DESCRIPTION
56.ft R
57A call to MPI_Waitany can be used to wait for the completion of one out of several requests.
58.sp
59The array_of_requests list may contain null or inactive handles. If the list contains no active handles (list has length zero or all entries are null or inactive), then the call returns immediately with index = MPI_UNDEFINED, and an empty status.
60.sp
61The execution of MPI_Waitany(count, array_of_requests, index, status) has the same effect as the execution of MPI_Wait(&array_of_requests[i], status), where i is the value returned by index (unless the value of index is MPI_UNDEFINED). MPI_Waitany with an array containing one active entry is equivalent to MPI_Wait.
62.sp
63If 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.
64.sp
65\fBExample:\fR Client-server code (starvation can occur).
66.sp
67.nf
68    CALL MPI_COMM_SIZE(comm, size, ierr)
69    CALL MPI_COMM_RANK(comm, rank, ierr)
70    IF(rank .GT 0) THEN         ! client code
71        DO WHILE(.TRUE.)
72           CALL MPI_ISEND(a, n, MPI_REAL, 0, tag, comm, request, ierr)
73           CALL MPI_WAIT(request, status, ierr)
74        END DO
75    ELSE         ! rank=0 -- server code
76           DO i=1, size-1
77              CALL MPI_IRECV(a(1,i), n, MPI_REAL, i tag,
78                       comm, request_list(i), ierr)
79           END DO
80           DO WHILE(.TRUE.)
81              CALL MPI_WAITANY(size-1, request_list, index, status, ierr)
82              CALL DO_SERVICE(a(1,index))  ! handle one message
83              CALL MPI_IRECV(a(1, index), n, MPI_REAL, index, tag,
84                        comm, request_list(index), ierr)
85           END DO
86    END IF
87.fi
88.sp
89
90.SH ERRORS
91Almost 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.
92.sp
93Before the error value is returned, the current MPI error handler is
94called. By default, this error handler aborts the MPI job, except for
95I/O function errors. The error handler may be changed with
96MPI_Comm_set_errhandler, MPI_File_set_errhandler, or
97MPI_Win_set_errhandler (depending on the type of MPI handle that
98generated the request); the predefined error handler MPI_ERRORS_RETURN
99may be used to cause error values to be returned. Note that MPI does
100not guarantee that an MPI program can continue past an error.
101.sp
102Note that per MPI-1 section 3.2.5, MPI exceptions on requests passed
103to MPI_WAITANY do not set the status.MPI_ERROR field in the returned
104status.  The error code is passed to the back-end error handler and
105may be passed back to the caller through the return value of
106MPI_WAITANY if the back-end error handler returns it.  The pre-defined
107MPI error handler MPI_ERRORS_RETURN exhibits this behavior, for
108example.
109
110.SH SEE ALSO
111.ft R
112.sp
113MPI_Comm_set_errhandler
114.br
115MPI_File_set_errhandler
116.br
117MPI_Test
118.br
119MPI_Testall
120.br
121MPI_Testany
122.br
123MPI_Testsome
124.br
125MPI_Wait
126.br
127MPI_Waitall
128.br
129MPI_Waitsome
130.br
131MPI_Win_set_errhandler
132.br
133
Note: See TracBrowser for help on using the repository browser.