Appendix A


Reserved Names

NEC MPI provides include files that define reserved names such as datatypes and error codes. All reserved names begin with the prefix MPI_. Three include files, mpi.h for C and C++, mpi++.h for C++, and mpif.h for Fortran, are available.

The following examples show how to include them.

For C:

#include "mpi.h"
main( argc, argv )
int argc ;
char **argv ;
{
     :

For Fortran:

SUBROUTINE SUB(I,J)
INCLUDE "mpif.h"
INTEGER I,J

     :




A.1   Datatypes

This section describes predefined datatypes NEC MPI supports for respective programming languages. Users can create user-defined datatypes based on them.

The following table shows the MPI datatypes for Fortran and corresponding Fortran types.

Table A-1   MPI Datatypes for Fortran

MPI DatatypeFortran Type
MPI_INTEGER INTEGER
MPI_REAL REAL
MPI_DOUBLE_PRECISION DOUBLE PRECISION
MPI_COMPLEX COMPLEX
MPI_LOGICAL LOGICAL
MPI_CHARACTER CHARACTER(1)
MPI_AINT INTEGER(KIND=MPI_ADDRESS_KIND)
MPI_COUNT INTEGER(KIND=MPI_COUNT_KIND)
MPI_OFFSET INTEGER(KIND=MPI_OFFSET_KIND)
MPI_DOUBLE_COMPLEX DOUBLE COMPLEX
MPI_INTEGER2 INTEGER*2
MPI_INTEGER4 INTEGER*4
MPI_INTEGER8 (*1) INTEGER*8
MPI_REAL4 REAL*4
MPI_REAL8 REAL*8
MPI_REAL16 READ*16
MPI_COMPLEX8 COMPLEX8
MPI_COMPLEX16 COMPLEX16
MPI_COMPLEX32 COMPLEX32
MPI_LOGICAL1 (*2) LOGICAL*1
MPI_LOGICAL4 (*2) LOGICAL*4
MPI_LOGICAL8 (*1)(*2) LOGICAL*8
MPI_QUADRUPLE_PRECISION (*2) QUADRUPLE PRECISION
MPI_QUADRUPLE_COMPLEX (*2) COMPLEX QUADRUPLE

(*1) This datatype cannot be used when the numeric value storage unit is four bytes.
(*2) Additional support in NEC MPI.

The following table shows the MPI datatypes for C and corresponding C types.

Table A-2   MPI Datatypes for C

MPI DatatypeC Type
MPI_CHAR char
MPI_SHORT short
MPI_INT int
MPI_LONG long
MPI_LONG_LONG_INT long long
MPI_LONG_LONG long long
MPI_SIGNED_CHAR signed char
MPI_UNSIGNED_CHAR unsigned char
MPI_UNSIGNED_SHORT unsigned short
MPI_UNSIGNED unsigned int
MPI_UNSIGNED_LONG unsigned long
MPI_UNSIGNED_LONG_LONG unsigned long long
MPI_FLOAT float
MPI_DOUBLE double
MPI_LONG_DOUBLE long double
MPI_WCHAR wchar_t
MPI_C_BOOL _Bool
MPI_INT8_T int8_t
MPI_INT16_T int16_t
MPI_INT32_T int32_t
MPI_INT64_T int64_t
MPI_UINT8_T uint8_t
MPI_UINT16_T uint16_t
MPI_UINT32_T uint32_t
MPI_UINT64_T uint64_t
MPI_AINT MPI_Aint
MPI_COUNT MPI_Count
MPI_OFFSET MPI_Offset
MPI_C_COMPLEX float _Complex
MPI_C_FLOAT_COMPLEX float _Complex
MPI_C_DOUBLE_COMPLEX double _Complex
MPI_C_LONG_DOUBLE_COMPLEX long double _Complex

The following table shows the MPI datatypes for C++ and corresponding C++ types.

Table A-3   MPI Datatypes for C++

MPI DatatypeC++ Type
MPI_CXX_BOOL bool
MPI_CXX_FLOAT_COMPLEX std::complex<float>
MPI_CXX_DOUBLE_COMPLEX std::complex<double>
MPI_CXX_LONG_DOUBLE_COMPLEX std::complex<long double>

The following MPI datatypes are common across Fortran and C.

Table A-4   MPI Datatypes for Fortran and C

MPI DatatypeType
MPI_BYTE Any types
MPI_PACKED Any types


A.2   Datatypes for Reduction Operation

The following datatypes can be used in the reduction operations MPI_MAXLOC and MPI_MINLOC in Fortran.

(*) Additional support in NEC MPI

The following datatypes can be used in the reduction operations MPI_MAXLOC and MPI_MINLOC in C.


A.3   Error Codes

The following table shows the list of error codes NEC MPI returns when errors occur during execution of MPI procedures.
In Fortran, a return code is returned as the last argument.
In C, it is returned as the function value.
Standard error codes are called error classes, and each error code belongs to an error class.

Table A-4   The List of Error Codes

Error code Meaning
MPI_SUCCESSNormal termination.
MPI_ERR_BUFFERIllegal buffer pointer specified in an argument.
MPI_ERR_COUNT Illegal element count or block count specified in an argument.
MPI_ERR_TYPEIllegal data type specified in an argument.
MPI_ERR_TAGIllegal tag specified in an argument.
MPI_ERR_COMMIllegal communicator specified in an argument.
MPI_ERR_RANKIllegal rank specified in an argument.
MPI_ERR_REQUESTIllegal communication request specified in an argument.
MPI_ERR_ROOTIllegal root specified in an argument.
MPI_ERR_GROUPIllegal group value specified in an argument.
MPI_ERR_OPIllegal operation request specified in an argument.
MPI_ERR_TOPOLOGYIllegal topology specified in an argument.
MPI_ERR_DIMSIllegal dimension specified in an argument.
MPI_ERR_ARGIllegal argument specified.
MPI_ERR_UNKNOWNAn error not recognizable by NEC MPI occurred.
MPI_ERR_TRUNCATEInvalid truncation of the receive message.
MPI_ERR_OTHERAn undefined error occurred.*
MPI_ERR_INTERNAn error internal to the NEC MPI processing system occurred.
MPI_ERR_IN_STATUSAn error code returned in STATUS (message) argument.
MPI_ERR_PENDINGCommunication request by the communication request still pending.
MPI_ERR_KEYVALInvalid keyval has been passed.
MPI_ERR_NO_MEMMPI_ALLOC_MEM failed because memory is exhausted.
MPI_ERR_BASEInvalid base passed to MPI_FREE_MEM.
MPI_ERR_INFO_KEYKey longer than MPI_MAX_INFO_KEY.
MPI_ERR_INFO_VALUEValue longer than MPI_MAX_INFO_VAL.
MPI_ERR_INFO_NOKEYInvalid key passed to MPI_INFO_DELETE.
MPI_ERR_SPAWNError in spawning processes.
MPI_ERR_PORTInvalid port name passed to MPI_COMM_CONNECT.
MPI_ERR_SERVICEInvalid service name passed to MPI_UNPUBLISH_NAME.
MPI_ERR_NAMEInvalid service name passed to MPI_LOOKUP_NAME.
MPI_ERR_WINInvalid win argument.
MPI_ERR_SIZEInvalid size argument.
MPI_ERR_DISPInvalid disp argument.
MPI_ERR_INFOInvalid info argument.
MPI_ERR_LOCKTYPEInvalid locktype argument.
MPI_ERR_ASSERTInvalid assert argument.
MPI_ERR_RMA_CONFLICTConflicting accesses to window.
MPI_ERR_RMA_SYNCWrong synchronization of RMA calls.
MPI_ERR_RMA_RANGETarget memory is not part of the window.
MPI_ERR_RMA_ATTACHMemory cannot be attached.
MPI_ERR_RMA_SHAREDMemory cannot be shared.
MPI_ERR_RMA_FLAVORPassed window has the wrong flavor for the called function.
MPI_ERR_FILEInvalid file handle.
MPI_ERR_NOT_SAMECollective argument not identical on all processes, or collective routines called in a different order by different processes.
MPI_ERR_AMODEError related to the amode passed to MPI_FILE_OPEN.
MPI_ERR_UNSUPPORTED_DATAREPUnsupported datarep passed to MPI_FILE_SET_VIEW.
MPI_ERR_UNSUPPORTED_OPERATIONUnsupported operation, such as seeking on a file which supports sequential access only.
MPI_ERR_NO_SUCH_FILEFile does not exist.
MPI_ERR_FILE_EXISTSFile exists.
MPI_ERR_BAD_FILEInvalid file name (e.g., path name too long).
MPI_ERR_ACCESSPermission denied.
MPI_ERR_NO_SPACENot enough space.
MPI_ERR_QUOTAQuota exceeded.
MPI_ERR_READ_ONLYRead-only file or file system.
MPI_ERR_FILE_IN_USEFile operation could not be completed, as the file is currently open by some process.
MPI_ERR_DUP_DATAREPConversion functions could not be registered because a data representation identifier that was already defined was passed to MPI_REGISTER_DATAREP.
MPI_ERR_CONVERSIONAn error occurred in a user supplied data conversion function.
MPI_ERR_IOOther I/O error
MPI_ERR_LASTCODELast error code (Without meaning as an error).

* Details can be obtained by invoking the procedure MPI_ERROR_STRING.

The values of error codes are in the range MPI_SUCCESS (=0) < error codes <= MPI_ERR_LASTCODE


A.4   Reserved Communicator Names

NEC MPI supports the following predefined communicators.

Table A-5   Reserved Communicator Names

Communicator Name Meaning
MPI_COMM_WORLD Communicator to which all MPI processes belong.
MPI_COMM_SELF Communicator to which only the executing process belongs


A.5   Reduction Operators

Execution of reduction operation calculates a value by combining a data element on each process with an operator. NEC MPI supports the following predefined reduction operators:

Table A-6   Reduction Operators

Reduction OperatorDescription
MPI_MAXMaximum
MPI_MINMinimum
MPI_SUMSum
MPI_PRODProduct
MPI_MAXLOCInformation corresponding to the maximum
MPI_MINLOCInformation corresponding to the minimum
MPI_BANDBit-wise AND
MPI_BORBit-wise OR
MPI_BXORBit-wise XOR
MPI_LANDLogical AND
MPI_LORLogical OR
MPI_LXORLogical XOR


Contents Previous ChapterGlossary Index