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.
MPI Datatype | Fortran Type |
---|---|
MPI_INTEGER | INTEGER |
MPI_INTEGER2 | INTEGER*2 |
MPI_INTEGER4 | INTEGER*4 |
MPI_INTEGER8 | INTEGER*8 |
MPI_LOGICAL | LOGICAL |
MPI_LOGICAL1 c | LOGICAL*1 |
MPI_LOGICAL4 (*1) | LOGICAL*4 |
MPI_LOGICAL8 (*1) | LOGICAL*8 |
MPI_REAL | REAL |
MPI_REAL2 (*2) | REAL*2 |
MPI_REAL4 | REAL*4 |
MPI_REAL8 | REAL*8 |
MPI_REAL16 | READ*16 |
MPI_DOUBLE_PRECISION | DOUBLE PRECISION |
MPI_QUADRUPLE_PRECISION (*1) | QUADRUPLE PRECISION |
MPI_COMPLEX | COMPLEX |
MPI_COMPLEX8 | COMPLEX*8 |
MPI_COMPLEX16 | COMPLEX*16 |
MPI_COMPLEX32 | COMPLEX*32 |
MPI_DOUBLE_COMPLEX | DOUBLE COMPLEX |
MPI_QUADRUPLE_COMPLEX (*1) | COMPLEX QUADRUPLE |
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) |
(*1) Additional support in NEC MPI.
(*2) Not supported for running on VE10, VE10E, VE20, VH or scalar hosts. Only supported running on VE30.
The following table shows the MPI datatypes for C and corresponding C types.
MPI Datatype | C 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 |
NEC_MPI_FLOAT16(*1)(*2) | __float16 |
(*1) Additional support in NEC MPI.
(*2) Not supported for running on VE10, VE10E, VE20, VH or scalar hosts. Only supported running on VE30.
The following table shows the MPI datatypes for C++ and corresponding C++ types.
MPI Datatype | C++ 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.
MPI Datatype | Type |
---|---|
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.
(*1) Additional support in NEC MPI
(*2) Not supported for running on VE10, VE10E, VE20, VH or scalar hosts. Only supported running on VE30.
The following datatypes can be used in the reduction operations MPI_MAXLOC and MPI_MINLOC in C.
(*1) Additional support in NEC MPI
(*2) Not supported for running on VE10, VE10E, VE20, VH or scalar hosts. Only supported running on VE30.
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.
Error code | Value | Meaning |
MPI_SUCCESS | 0 | Normal termination. |
MPI_ERR_BUFFER | 1 | Illegal buffer pointer specified in an argument. |
MPI_ERR_COUNT | 2 | Illegal element count or block count specified in an argument. |
MPI_ERR_TYPE | 3 | Illegal data type specified in an argument. |
MPI_ERR_TAG | 4 | Illegal tag specified in an argument. |
MPI_ERR_COMM | 5 | Illegal communicator specified in an argument. |
MPI_ERR_RANK | 6 | Illegal rank specified in an argument. |
MPI_ERR_REQUEST | 19 | Illegal communication request specified in an argument. |
MPI_ERR_ROOT | 7 | Illegal root specified in an argument. |
MPI_ERR_GROUP | 8 | Illegal group value specified in an argument. |
MPI_ERR_OP | 9 | Illegal operation request specified in an argument. |
MPI_ERR_TOPOLOGY | 10 | Illegal topology specified in an argument. |
MPI_ERR_DIMS | 11 | Illegal dimension specified in an argument. |
MPI_ERR_ARG | 12 | Illegal argument specified. |
MPI_ERR_UNKNOWN | 13 | An error not recognizable by NEC MPI occurred. |
MPI_ERR_TRUNCATE | 14 | Invalid truncation of the receive message. |
MPI_ERR_OTHER | 15 | An undefined error occurred.* |
MPI_ERR_INTERN | 16 | An error internal to the NEC MPI processing system occurred. |
MPI_ERR_IN_STATUS | 17 | An error code returned in STATUS (message) argument. |
MPI_ERR_PENDING | 18 | Communication request by the communication request still pending. |
MPI_ERR_KEYVAL | 36 | Invalid keyval has been passed. |
MPI_ERR_NO_MEM | 39 | MPI_ALLOC_MEM failed because memory is exhausted. |
MPI_ERR_BASE | 25 | Invalid base passed to MPI_FREE_MEM. |
MPI_ERR_INFO_KEY | 32 | Key longer than MPI_MAX_INFO_KEY. |
MPI_ERR_INFO_VALUE | 34 | Value longer than MPI_MAX_INFO_VAL. |
MPI_ERR_INFO_NOKEY | 33 | Invalid key passed to MPI_INFO_DELETE. |
MPI_ERR_SPAWN | 50 | Error in spawning processes. |
MPI_ERR_PORT | 43 | Invalid port name passed to MPI_COMM_CONNECT. |
MPI_ERR_SERVICE | 48 | Invalid service name passed to MPI_UNPUBLISH_NAME. |
MPI_ERR_NAME | 38 | Invalid service name passed to MPI_LOOKUP_NAME. |
MPI_ERR_WIN | 53 | Invalid win argument. |
MPI_ERR_SIZE | 49 | Invalid size argument. |
MPI_ERR_DISP | 27 | Invalid disp argument. |
MPI_ERR_INFO | 35 | Invalid info argument. |
MPI_ERR_LOCKTYPE | 37 | Invalid locktype argument. |
MPI_ERR_ASSERT | 23 | Invalid assert argument. |
MPI_ERR_RMA_CONFLICT | 46 | Conflicting accesses to window. |
MPI_ERR_RMA_SYNC | 47 | Wrong synchronization of RMA calls. |
MPI_ERR_RMA_RANGE | 57 | Target memory is not part of the window. |
MPI_ERR_RMA_ATTACH | 55 | Memory cannot be attached. |
MPI_ERR_RMA_SHARED | 54 | Memory cannot be shared. |
MPI_ERR_RMA_FLAVOR | 56 | Passed window has the wrong flavor for the called function. |
MPI_ERR_FILE | 31 | Invalid file handle. |
MPI_ERR_NOT_SAME | 40 | Collective argument not identical on all processes, or collective routines called in a different order by different processes. |
MPI_ERR_AMODE | 22 | Error related to the amode passed to MPI_FILE_OPEN. |
MPI_ERR_UNSUPPORTED_DATAREP | 51 | Unsupported datarep passed to MPI_FILE_SET_VIEW. |
MPI_ERR_UNSUPPORTED_OPERATION | 52 | Unsupported operation, such as seeking on a file which supports sequential access only. |
MPI_ERR_NO_SUCH_FILE | 42 | File does not exist. |
MPI_ERR_FILE_EXISTS | 29 | File exists. |
MPI_ERR_BAD_FILE | 24 | Invalid file name (e.g., path name too long). |
MPI_ERR_ACCESS | 21 | Permission denied. |
MPI_ERR_NO_SPACE | 41 | Not enough space. |
MPI_ERR_QUOTA | 44 | Quota exceeded. |
MPI_ERR_READ_ONLY | 45 | Read-only file or file system. |
MPI_ERR_FILE_IN_USE | 30 | File operation could not be completed, as the file is currently open by some process. |
MPI_ERR_DUP_DATAREP | 28 | Conversion functions could not be registered because a data representation identifier that was already defined was passed to MPI_REGISTER_DATAREP. |
MPI_ERR_CONVERSION | 26 | An error occurred in a user supplied data conversion function. |
MPI_ERR_IO | 20 | Other I/O error |
MPI_ERR_LASTCODE | 32768 | Last error code (Without meaning as an error). |
A.4   Reserved Communicator Names
NEC MPI supports the following predefined communicators.
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:
Reduction Operator | Description |
---|---|
MPI_MAX | Maximum |
MPI_MIN | Minimum |
MPI_SUM | Sum |
MPI_PROD | Product |
MPI_MAXLOC | Information corresponding to the maximum |
MPI_MINLOC | Information corresponding to the minimum |
MPI_BAND | Bit-wise AND |
MPI_BOR | Bit-wise OR |
MPI_BXOR | Bit-wise XOR |
MPI_LAND | Logical AND |
MPI_LOR | Logical OR |
MPI_LXOR | Logical XOR |
Contents | Previous Chapter | Glossary | Index |