1 | .\"Copyright 2006-2008 Sun Microsystems, Inc. |
---|
2 | .\"Copyright (c) 1996 Thinking Machines |
---|
3 | .TH MPI_Comm_set_attr 3 "Dec 08, 2009" "1.4" "Open MPI" |
---|
4 | .SH NAME |
---|
5 | \fBMPI_Comm_set_attr\fP \- Stores attribute value associated with a key. |
---|
6 | |
---|
7 | .SH SYNTAX |
---|
8 | .ft R |
---|
9 | .SH C Syntax |
---|
10 | .nf |
---|
11 | #include <mpi.h> |
---|
12 | int MPI_Comm_set_attr(MPI_Comm \fIcomm\fP, int \fIcomm_keyval\fP, void *\fIattribute_val\fP) |
---|
13 | |
---|
14 | .SH Fortran Syntax (see FORTRAN 77 NOTES) |
---|
15 | .nf |
---|
16 | INCLUDE 'mpif.h' |
---|
17 | MPI_COMM_SET_ATTR(\fICOMM, COMM_KEYVAL, ATTRIBUTE_VAL, IERROR\fP) |
---|
18 | INTEGER \fICOMM, COMM_KEYVAL, IERROR \fP |
---|
19 | INTEGER(KIND=MPI_ADDRESS_KIND) \fIATTRIBUTE_VAL\fP |
---|
20 | |
---|
21 | .SH C++ Syntax |
---|
22 | .nf |
---|
23 | #include <mpi.h> |
---|
24 | void MPI::Comm::Set_attr(int \fIcomm_keyval\fP, const void* \fIattribute_val\fP) const |
---|
25 | |
---|
26 | .SH INPUT/OUTPUT PARAMETER |
---|
27 | .ft R |
---|
28 | .TP 1i |
---|
29 | comm |
---|
30 | Communicator from which attribute will be attached (handle). |
---|
31 | |
---|
32 | .SH INPUT PARAMETERS |
---|
33 | .ft R |
---|
34 | .TP 1i |
---|
35 | comm_keyval |
---|
36 | Key value (integer). |
---|
37 | .TP 1i |
---|
38 | attribute_val |
---|
39 | Attribute value. |
---|
40 | |
---|
41 | .SH OUTPUT PARAMETER |
---|
42 | .ft R |
---|
43 | .TP 1i |
---|
44 | IERROR |
---|
45 | Fortran only: Error status (integer). |
---|
46 | |
---|
47 | .SH DESCRIPTION |
---|
48 | .ft R |
---|
49 | MPI_Comm_set_attr stores the stipulated attribute value \fIattribute_val\fP for subsequent retrieval by MPI_Comm_get_attr. If the value is already present, then the outcome is as if MPI_Comm_delete_attr was first called to delete the previous value (and the callback function delete_fn was executed), and a new value was next stored. The call is erroneous if there is no key with value \fIcomm_keyval\fP; in particular MPI_KEYVAL_INVALID is an erroneous key value. The call will fail if the delete_fn function returned an error code other than MPI_SUCCESS. |
---|
50 | .sp |
---|
51 | This function replaces MPI_Attr_put, the use of which is deprecated. The C binding is identical. The Fortran binding differs in that \fIattribute_val\fP is an address-sized integer. |
---|
52 | |
---|
53 | .SH FORTRAN 77 NOTES |
---|
54 | .ft R |
---|
55 | The MPI standard prescribes portable Fortran syntax for |
---|
56 | the \fIATTRIBUTE_VAL\fP argument only for Fortran 90. Sun FORTRAN 77 |
---|
57 | users may use the non-portable syntax |
---|
58 | .sp |
---|
59 | .nf |
---|
60 | INTEGER*MPI_ADDRESS_KIND \fIATTRIBUTE_VAL\fP |
---|
61 | .fi |
---|
62 | .sp |
---|
63 | where MPI_ADDRESS_KIND is a constant defined in mpif.h |
---|
64 | and gives the length of the declared integer in bytes. |
---|
65 | |
---|
66 | .SH NOTES |
---|
67 | .ft R |
---|
68 | Values of the permanent attributes MPI_TAG_UB, MPI_HOST, |
---|
69 | MPI_IO, and MPI_WTIME_IS_GLOBAL may not be changed. |
---|
70 | .sp |
---|
71 | The type of the attribute value depends on whether C or Fortran is being used. In C, an attribute value is a pointer (void *); in Fortran, it is a single, address-size integer system for which a pointer does not fit in an integer. |
---|
72 | .sp |
---|
73 | If an attribute is already present, the delete function (specified when the corresponding keyval was created) will be called. |
---|
74 | |
---|
75 | .SH ERRORS |
---|
76 | 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. |
---|
77 | .sp |
---|
78 | Before the error value is returned, the current MPI error handler is |
---|
79 | 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. |
---|
80 | |
---|