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

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

Adding compiled files

File size: 8.2 KB
Line 
1.\"Copyright 2006-2008 Sun Microsystems, Inc.
2.\" Copyright (c) 1996 Thinking Machines Corporation
3.TH MPI_Grequest_start 3 "Dec 08, 2009" "1.4" "Open MPI"
4.SH NAME
5\fBMPI_Grequest_start \fP \- Starts a generalized request and returns a handle to it in \fIrequest\fP.
6
7.SH SYNTAX
8.ft R
9.SH C Syntax
10.nf
11#include <mpi.h>
12int MPI_Grequest_start(MPI_Grequest_query_function \fI*query_fn\fP,
13        MPI_Grequest_free_function \fI*free_fn\fP,
14        MPI_Grequest_cancel_function \fI*cancel_fn\fP, void \fI*extra_state\fP,
15        MPI_Request \fI*request\fP)
16
17.SH Fortran Syntax (see FORTRAN 77 NOTES)
18.nf
19INCLUDE 'mpif.h'
20MPI_GREQUEST_START(\fIQUERY_FN, FREE_FN, CANCEL_FN, EXTRA_STATE,
21        REQUEST, IERROR\fP)
22        INTEGER \fIREQUEST, IERROR\fP
23        EXTERNAL \fIQUERY_FN, FREE_FN, CANCEL_FN\fP
24        INTEGER (KIND=MPI_ADDRESS_KIND) \fIEXTRA_STATE\fP
25
26.SH C++ Syntax
27.nf
28#include <mpi.h>
29static MPI::Grequest
30             MPI::Grequest::Start(const MPI::Grequest::Query_function
31             \fIquery_fn\fP, const MPI::Grequest::Free_function \fIfree_fn\fP,
32             const MPI::Grequest::Cancel_function \fIcancel_fn\fP,
33             void \fI*extra_state\fP)
34
35.SH INPUT PARAMETERS
36.ft R
37.TP 1i
38query_fn
39Callback function invoked when request status is queried (function).
40.TP 1i
41free_fn
42Callback function invoked when request is freed (function).
43.TP 1i
44cancel_fn
45Callback function invoked when request is canceled (function).
46.TP 1i
47extra_state
48Extra state.
49
50.SH OUTPUT PARAMETERS
51.ft R
52.TP 1i
53request
54Generalized request (handle).
55.ft R
56.TP 1i
57IERROR
58Fortran only: Error status (integer).
59
60.SH DESCRIPTION
61.ft R
62MPI_Grequest_start starts a generalized request and returns a handle to it in \fIrequest\fP.
63.sp
64The syntax and meaning of the callback functions are listed below. All callback functions are passed the \fIextra_state\fP argument that was associated with the request by the starting call MPI_Grequest_start. This can be used to maintain user-defined state for the request. In C, the query function is
65.sp
66.nf
67   typedef int MPI_Grequest_query_function(void \fI*extra_state\fP,
68                MPI_Status \fI*status\fP);
69.fi
70.sp
71In Fortran, it is
72.sp
73.nf
74   SUBROUTINE GREQUEST_QUERY_FUNCTION(\fIEXTRA_STATE, STATUS, IERROR\fP)
75       INTEGER STATUS(MPI_STATUS_SIZE), \fIIERROR\fP
76       INTEGER(KIND=MPI_ADDRESS_KIND) \fIEXTRA_STATE\fP
77.fi
78.sp
79and in C++, it is
80.sp
81.nf
82   typedef int MPI::Grequest::Query_function(void* \fIextra_state\fP,
83                MPI::Status& \fIstatus\fP);
84.fi
85.sp
86The \fIquery_fn\fP function computes the status that should be returned for the generalized request. The status also includes information about successful/unsuccessful cancellation of the request (result to be returned by MPI_Test_cancelled).
87.sp
88The \fIquery_fn\fP function is invoked by the MPI_{Wait|Test}{any|some|all} call that completed the generalized request associated with this callback. The callback function is also invoked by calls to MPI_Request_get_status if the request is complete when the call occurs. In both cases, the callback is passed a reference to the corresponding status variable passed by the user to the MPI call. If the user provided MPI_STATUS_IGNORE or MPI_STATUSES_IGNORE to the MPI function that causes \fIquery_fn\fP to be called, then MPI will pass a valid status object to \fIquery_fn\fP, and this status will be ignored upon return of the callback function. Note that \fIquery_fn\fP is invoked only after MPI_Grequest_complete is called on the request; it may be invoked several times for the same generalized request. Note also that a call to MPI_{Wait|Test}{some|all} may cause multiple invocations of \fIquery_fn\fP callback functions, one for each generalized request that is completed by the MPI call. The order of these invocations is not specified by MPI.
89.sp
90In C, the free function is
91.sp
92.nf
93   typedef int MPI_Grequest_free_function(void *\fIextra_state\fP);
94.fi
95.sp
96In Fortran, it is
97.sp
98.nf
99   SUBROUTINE GREQUEST_FREE_FUNCTION(\fIEXTRA_STATE, IERROR\fP)
100       INTEGER \fIIERROR\fP
101       INTEGER(KIND=MPI_ADDRESS_KIND) \fIEXTRA_STATE\fP
102.fi
103.sp
104And in C++, it is
105.sp
106.nf
107   typedef int MPI::Grequest::Free_function(void* \fIextra_state\fP);
108.fi
109.sp
110The \fIfree_fn\fP callback function is invoked to clean up user-allocated resources when the generalized request is freed.
111.sp
112The \fIfree_fn\fP function is invoked by the MPI_{Wait|Test}{any|some|all} call that completed the generalized request associated with this callback. \fIfree_fn\fP is invoked after the call to \fIquery_fn\fP for the same request. However, if the MPI call completed multiple generalized requests, the order in which \fIfree_fn\fP callback functions are invoked is not specified by MPI.
113.sp
114The \fIfree_fn\fP callback is also invoked for generalized requests that are freed by a call to MPI_Request_free (no call to MPI_{Wait|Test}{any|some|all} will occur for such a request). In this case, the callback function will be called either in the MPI call MPI_Request_free(request) or in the MPI call MPI_Grequest_complete(request), whichever happens last. In other words, in this case the actual freeing code is executed as soon as both calls (MPI_Request_free and MPI_Grequest_complete) have occurred. The \fIrequest\fP is not deallocated until after \fIfree_fn\fP completes. Note that \fIfree_fn\fP will be invoked only once per request by a correct program.
115.sp
116In C, the cancel function is
117.sp
118.nf
119   typedef int MPI_Grequest_cancel_function(void *\fIextra_state\fP, int \fIcomplete\fP);
120.fi
121.sp
122In Fortran, the cancel function is
123.sp
124.nf
125   SUBROUTINE GREQUEST_CANCEL_FUNCTION(\fIEXTRA_STATE, COMPLETE, IERROR\fP)
126       INTEGER \fIIERROR\fP
127       INTEGER(KIND=MPI_ADDRESS_KIND) \fIEXTRA_STATE\fP
128       LOGICAL \fICOMPLETE\fP
129.fi
130.sp
131In C++, the cancel function is
132.sp
133.nf
134   typedef in MPI::Grequest::Cancel_function(void* \fIextra_state\fP,
135               bool \fIcomplete\fP);
136.fi
137.sp
138The \fIcancel_fn\fP function is invoked to start the cancelation of a generalized request. It is called by MPI_Request_cancel(request). MPI passes to the callback function complete=true if MPI_Grequest_complete has already been called on the request, and complete=false otherwise.
139
140.SH FORTRAN 77 NOTES
141.ft R
142The MPI standard prescribes portable Fortran syntax for
143the \fIEXTRA_STATE\fP argument only for Fortran 90.  FORTRAN 77
144users may use the non-portable syntax
145.sp
146.nf
147     INTEGER*MPI_ADDRESS_KIND \fIEXTRA_STATE\fP
148.fi
149.sp
150where MPI_ADDRESS_KIND is a constant defined in mpif.h
151and gives the length of the declared integer in bytes.
152
153.SH ERRORS
154Almost 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.
155.sp
156Before the error value is returned, the current MPI error handler is
157called. By default, this error handler aborts the MPI job, except for I/O function errors. The error handler may be changed with MPI_Comm_set_errhandler; the predefined error handler MPI_ERRORS_RETURN may be used to cause error values to be returned. Note that MPI does not guarantee that an MPI program can continue past an error. 
158.sp
159All callback functions return an error code. The code is passed back and dealt with as appropriate for the error code by the MPI function that invoked the callback function. For example, if error codes are returned, then the error code returned by the callback function will be returned by the MPI function that invoked the callback function. In the case of a MPI_{Wait|Test}any call that invokes both \fIquery_fn\fP and \fIfree_fn\fP, the MPI call will return the error code returned by the last callback, namely \fIfree_fn\fP. If one or more of the requests in a call to MPI_{Wait|Test}{some|all} has failed, then the MPI call will return MPI_ERR_IN_STATUS. In such a case, if the MPI call was passed an array of statuses, then MPI will return in each of the statuses that correspond to a completed generalized request the error code returned by the corresponding invocation of its \fIfree_fn\fP callback function. However, if the MPI function was passed MPI_STATUSES_IGNORE, then the individual error codes returned by each callback function will be lost.
160.sp
161See the MPI man page for a full list of MPI error codes.
162
163
164
Note: See TracBrowser for help on using the repository browser.