📄 mpi_type_create_keyval.3
字号:
.\"Copyright 2006, Sun Microsystems, Inc..\"Copyright (c) 1996 Thinking Machines.TH MPI_Type_create_keyval 3OpenMPI "September 2006" "Open MPI 1.2" " ".SH NAME\fBMPI_Type_create_keyval\fP \- Generates a new attribute key for caching on data types. .SH SYNTAX.ft R.SH C Syntax.nf#include <mpi.h>int MPI_Type_create_keyval(MPI_Type_copy_attr_function *\fItype_copy_attr_fn\fP, MPI_Type_delete_attr_function *\fItype_delete_attr_fn\fP, int *\fItype_keyval\fP, void *\fIextra_state\fP).SH Fortran Syntax (see FORTRAN 77 NOTES).nfINCLUDE 'mpif.h'MPI_TYPE_CREATE_KEYVAL(\fITYPE_COPY_ATTR_FN, TYPE_DELETE_ATTR_FN, TYPE_KEYVAL, EXTRA_STATE, IERROR\fP) EXTERNAL \fITYPE_COPY_ATTR_FN, TYPE_DELETE_ATTR_FN\fP INTEGER \fITYPE_KEYVAL, IERROR \fP INTEGER(KIND=MPI_ADDRESS_KIND) \fIEXTRA_STATE\fP.SH C++ Syntax.nf#include <mpi.h>static int MPI::Datatype::Create_keyval(MPI::Datatype::Copy_attr_function* \fItype_copy_attr_fn\fP, MPI::Datatype::Delete_attr_function* \fItype_delete_attr_fn\fP, void* \fIextra_state\fP).SH INPUT PARAMETERS.ft R.TP 1itype_copy_attr_fnCopy callback function for \fItype_keyval\fP (function)..TP 1itype_delete_attr_fnDelete callback function for \fItype_keyval\fP (function)..TP 1iextra_stateExtra state for callback functions..SH OUTPUT PARAMETERS.ft R.TP 1itype_keyvalKey value for future access (integer)..TP 1iIERRORFortran only: Error status (integer). .SH DESCRIPTION.ft RMPI_Type_create_keyval generates a new attribute key for caching on data types. This routine partially replaces MPI_Keyval_create. .spThe argument \fItype_copy_attr_fn\fP may be specified as MPI_TYPE_NULL_COPY_FN or MPI_TYPE_DUP_FN from C, C++, or Fortran. MPI_TYPE_NULL_COPY_FN is a function that does nothing other than returning \fIflag\fP = 0 and MPI_SUCCESS. MPI_TYPE_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..spThe argument \fItype_delete_attr_fn\fP may be specified as MPI_TYPE_NULL_DELETE_FN from C, C++, or Fortran. MPI_TYPE_NULL_DELETE_FN is a function that does nothing beyond returning MPI_SUCCESS.The C callback functions are: .sp.nftypedef int MPI_Type_copy_attr_function(MPI_Datatype \fIoldtype\fP, int \fItype_keyval\fP, void *\fIextra_state\fP, void *\fIattribute_val_in\fP, void *\fIattribute_val_out\fP, int *\fIflag\fP); .fiand.nftypedef int MPI_Type_delete_attr_function(MPI_Datatype \fItype\fP, int \fItype_keyval\fP, void *\fIattribute_val\fP, void *\fIextra_state\fP); .fi.spThe Fortran callback functions are:.sp.nfSUBROUTINE TYPE_COPY_ATTR_FN(\fIOLDTYPE, TYPE_KEYVAL, EXTRA_STATE, ATTRIBUTE_VAL_IN, ATTRIBUTE_VAL_OUT, FLAG, IERROR\fP) INTEGER \fIOLDTYPE, TYPE KEYVAL, IERROR\fP INTEGER(KIND=MPI_ADDRESS_KIND) \fIEXTRA_STATE, ATTRIBUTE_VAL_IN, ATTRIBUTE_VAL_OUT\fP LOGICAL \fIFLAG\fP .fiand.nfSUBROUTINE TYPE_DELETE_ATTR_FN(\fITYPE, TYPE_KEYVAL, ATTRIBUTE_VAL, EXTRA_STATE, IERROR\fP) INTEGER \fITYPE, TYPE_KEYVAL, IERROR\fP INTEGER(KIND=MPI_ADDRESS_KIND) \fIATTRIBUTE VAL, EXTRA_STATE\fP .fi.sp The C++ callbacks are:.sp.nftypedef int MPI::Datatype::Copy_attr_function(const MPI::Datatype& \fIoldtype\fP, int \fItype_keyval\fP, void* \fIextra_state\fP, const void* \fIattribute_val_in\fP, void* \fIattribute_val_out\fP, bool& \fIflag\fP); .fiand.nftypedef int MPI::Datatype::Delete_attr_function(MPI::Datatype& \fItype\fP, int \fItype_keyval\fP, void* \fIattribute_val\fP, void* \fIextra_state\fP); .fi.sp.SH FORTRAN 77 NOTES.ft RThe MPI standard prescribes portable Fortran syntax forthe \fIEXTRA_STATE\fP argument only for Fortran 90. FORTRAN 77users may use the non-portable syntax.sp.nf INTEGER*MPI_ADDRESS_KIND \fIEXTRA_STATE\fP.fi.spwhere MPI_ADDRESS_KIND is a constant defined in mpif.hand gives the length of the declared integer in bytes..SH ERRORSAlmost 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..spBefore the error value is returned, the current MPI error handler iscalled. 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. .SH SEE ALSO.ft R.spMPI_Type_free_keyval' @(#)MPI_Type_create_keyval.3 1.19 06/03/09
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -