1 | .\"Copyright 2006-2008 Sun Microsystems, Inc. |
---|
2 | .\"Copyright (c) 1996 Thinking Machines |
---|
3 | .TH MPI_Comm_create_keyval 3 "Dec 08, 2009" "1.4" "Open MPI" |
---|
4 | .SH NAME |
---|
5 | \fBMPI_Comm_create_keyval\fP \- Generates a new attribute key. |
---|
6 | |
---|
7 | .SH SYNTAX |
---|
8 | .ft R |
---|
9 | .SH C Syntax |
---|
10 | .nf |
---|
11 | #include <mpi.h> |
---|
12 | int MPI_Comm_create_keyval(MPI_Comm_copy_attr_function |
---|
13 | *\fIcomm_copy_attr_fn\fP, MPI_Comm_delete_attr_function |
---|
14 | *\fIcomm_delete_attr_fn\fP, int *\fIcomm_keyval\fP, |
---|
15 | void *\fIextra_state\fP) |
---|
16 | |
---|
17 | .SH Fortran Syntax (see FORTRAN 77 NOTES) |
---|
18 | .nf |
---|
19 | INCLUDE 'mpif.h' |
---|
20 | MPI_COMM_CREATE_KEYVAL(\fICOMM_COPY_ATTR_FN, COMM_DELETE_ATTR_FN, |
---|
21 | COMM_KEYVAL, EXTRA_STATE, IERROR\fP) |
---|
22 | |
---|
23 | EXTERNAL \fICOMM_COPY_ATTR_FN, COMM_DELETE_ATTR_FN\fP |
---|
24 | INTEGER \fICOMM_KEYVAL, IERROR \fP |
---|
25 | INTEGER(KIND=MPI_ADDRESS_KIND) \fIEXTRA_STATE\fP |
---|
26 | |
---|
27 | .SH C++ Syntax |
---|
28 | .nf |
---|
29 | #include <mpi.h> |
---|
30 | static in MPI::Comm::Create_keyval(MPI::Comm::Copy_attr_function* |
---|
31 | \fIcomm_copy_attr_fn\fP, |
---|
32 | MPI::Comm::Delete_attr_function* \fIcomm_delete_attr_fn\fP, |
---|
33 | void* \fIextra_state\fP) |
---|
34 | |
---|
35 | .SH INPUT PARAMETERS |
---|
36 | .ft R |
---|
37 | .TP 1i |
---|
38 | comm_copy_attr_fn |
---|
39 | Copy callback function for \fIcomm_keyval\fP (function). |
---|
40 | .TP 1i |
---|
41 | comm_delete_attr_fn |
---|
42 | Delete callback function for \fIcomm_keyval\fP (function). |
---|
43 | .TP 1i |
---|
44 | extra_state |
---|
45 | Extra state for callback functions. |
---|
46 | |
---|
47 | .SH OUTPUT PARAMETER |
---|
48 | .ft R |
---|
49 | .TP 1i |
---|
50 | comm_keyval |
---|
51 | Key value for future access (integer). |
---|
52 | .TP 1i |
---|
53 | IERROR |
---|
54 | Fortran only: Error status (integer). |
---|
55 | |
---|
56 | .SH DESCRIPTION |
---|
57 | .ft R |
---|
58 | This function replaces MPI_Keyval_create, the use of which is deprecated. The C binding is identical. The Fortran binding differs in that \fIextra_state\fP is an address-sized integer. Also, the copy and delete callback functions have Fortran bindings that are consistent with address-sized attributes. |
---|
59 | .sp |
---|
60 | The argument \fIcomm_copy_attr_fn\fP may be specified as MPI_COMM_NULL_COPY_FN or MPI_COMM_DUP_FN from C, C++, or Fortran. MPI_COMM_NULL_COPY_FN is a function that does nothing more than returning \fIflag\fP = 0 and MPI_SUCCESS. MPI_COMM_DUP_FN is a simple-minded copy function that sets \fIflag\fP = 1, returns the value of \fIattribute_val_in\fP in \fIattribute_val_out\fP, and returns MPI_SUCCESS. These replace the MPI-1 predefined callbacks MPI_NULL_COPY_FN and MPI_DUP_FN, the use of which is deprecated. |
---|
61 | .sp |
---|
62 | The C callback functions are: |
---|
63 | .sp |
---|
64 | .nf |
---|
65 | typedef int MPI_Comm_copy_attr_function(MPI_Comm \fIoldcomm\fP, int \fIcomm_keyval\fP, |
---|
66 | void *\fIextra_state\fP, void *\fIattribute_val_in\fP, |
---|
67 | void *\fIattribute_val_out\fP, int *\fIflag\fP); |
---|
68 | .fi |
---|
69 | and |
---|
70 | .nf |
---|
71 | typedef int MPI_Comm_delete_attr_function(MPI_Comm \fIcomm\fP, int \fIcomm_keyval\fP, |
---|
72 | void *\fIattribute_val\fP, void *\fIextra_state\fP); |
---|
73 | .fi |
---|
74 | .sp |
---|
75 | which are the same as the MPI-1.1 calls but with a new name. The old names are deprecated. |
---|
76 | .sp |
---|
77 | The Fortran callback functions are: |
---|
78 | .sp |
---|
79 | .nf |
---|
80 | SUBROUTINE COMM_COPY_ATTR_FN(\fIOLDCOMM, COMM_KEYVAL, EXTRA_STATE, |
---|
81 | ATTRIBUTE_VAL_IN, ATTRIBUTE_VAL_OUT, FLAG, IERROR\fP) |
---|
82 | INTEGER \fIOLDCOMM, COMM_KEYVAL, IERROR\fP |
---|
83 | INTEGER(KIND=MPI_ADDRESS_KIND) \fIEXTRA_STATE, ATTRIBUTE_VAL_IN, |
---|
84 | ATTRIBUTE_VAL_OUT\fP |
---|
85 | LOGICAL \fIFLAG\fP |
---|
86 | .fi |
---|
87 | and |
---|
88 | .nf |
---|
89 | SUBROUTINE COMM_DELETE_ATTR_FN(\fICOMM, COMM_KEYVAL, ATTRIBUTE_VAL, EXTRA_STATE, |
---|
90 | IERROR\fP) |
---|
91 | INTEGER \fICOMM, COMM_KEYVAL, IERROR\fP |
---|
92 | INTEGER(KIND=MPI_ADDRESS_KIND) \fIATTRIBUTE_VAL, EXTRA_STATE\fP |
---|
93 | .fi |
---|
94 | .sp |
---|
95 | The C++ callbacks are: |
---|
96 | .sp |
---|
97 | .nf |
---|
98 | typedef int MPI::Comm::Copy_attr_function(const MPI::Comm& \fIoldcomm\fP, |
---|
99 | int \fIcomm_keyval\fP, void* \fIextra_state\fP, void* \fIattribute_val_in\fP, |
---|
100 | void* \fIattribute_val_out\fP, bool& \fIflag\fP); |
---|
101 | .fi |
---|
102 | and |
---|
103 | .nf |
---|
104 | typedef int MPI::Comm::Delete_attr_function(MPI::Comm& \fIcomm\fP, |
---|
105 | int \fIcomm_keyval\fP, void* \fIattribute_val\fP, void* \fIextra_state\fP); |
---|
106 | .fi |
---|
107 | |
---|
108 | .SH FORTRAN 77 NOTES |
---|
109 | .ft R |
---|
110 | The MPI standard prescribes portable Fortran syntax for |
---|
111 | the \fIEXTRA_STATE\fP argument only for Fortran 90. FORTRAN 77 |
---|
112 | users may use the non-portable syntax |
---|
113 | .sp |
---|
114 | .nf |
---|
115 | INTEGER*MPI_ADDRESS_KIND \fIEXTRA_STATE\fP |
---|
116 | .fi |
---|
117 | .sp |
---|
118 | where MPI_ADDRESS_KIND is a constant defined in mpif.h |
---|
119 | and gives the length of the declared integer in bytes. |
---|
120 | |
---|
121 | .SH ERRORS |
---|
122 | 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. |
---|
123 | .sp |
---|
124 | Before the error value is returned, the current MPI error handler is |
---|
125 | called. 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. |
---|
126 | .sp |
---|
127 | See the MPI man page for a full list of MPI error codes. |
---|
128 | |
---|
129 | .SH SEE ALSO |
---|
130 | .ft R |
---|
131 | .sp |
---|
132 | |
---|
133 | |
---|