Constants(3)

๐Ÿ“ฆ
version 5.0.1 ยท 3 versions
, in nixos 26.05, ubuntu stonking

โœจ Constants(3) โœจ

okay bestie, welcome to the MPI constants page ๐Ÿ’… this is the part where we find out what all those shouty ALL-CAPS names actually mean. it's the Constants man page, from the MPI manual, section 3. it's a chonky one so it comes in parts, and this is part 1 โ€” grab a snack, we're doing this ๐Ÿ“


๐ŸŒธ NAME ๐ŸŒธ

Constants โ€” the meaning of MPI's defined constants. that's it, that's the vibe โœจ


๐ŸŽ€ DATA TYPES ๐ŸŽ€

heads up bestie, read this one twice ๐Ÿ‘‘

the Fortran types are for Fortran programs only, and the C types are for C programs only. like, for real. using MPI_INT for a Fortran INTEGER is an error โ€” not a quirky little whoopsie, an actual error. ๐Ÿ™ˆ

datatypes are of type MPI_Datatype in C, type INTEGER in Fortran, and Type(MPI_Datatype) in Fortran08. periodt.

๐Ÿ’– C DATATYPES ๐Ÿ’–

  • MPI_CHAR โ€” char
  • MPI_SIGNED_CHAR โ€” signed char
  • MPI_UNSIGNED_CHAR โ€” unsigned char
  • MPI_BYTE โ€” see the standard; like unsigned char
  • MPI_WCHAR โ€” wide character (wchar_t)
  • MPI_SHORT โ€” short
  • MPI_UNSIGNED_SHORT โ€” unsigned short
  • MPI_INT โ€” int
  • MPI_UNSIGNED โ€” unsigned int
  • MPI_LONG โ€” long
  • MPI_UNSIGNED_LONG โ€” unsigned long
  • MPI_LONG_LONG_INT โ€” long long
  • MPI_LONG_LONG โ€” synonym for MPI_LONG_LONG_INT
  • MPI_UNSIGNED_LONG_LONG โ€” unsigned long long
  • MPI_FLOAT โ€” float
  • MPI_DOUBLE โ€” double
  • MPI_LONG_DOUBLE โ€” long double (some systems may not implement this ๐Ÿ˜ญ not everyone got the range)
  • 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_C_BOOL โ€” _Bool
  • MPI_C_FLOAT_COMPLEX โ€” float _Complex
  • MPI_C_COMPLEX โ€” float _Complex
  • MPI_C_DOUBLE_COMPLEX โ€” double _Complex
  • MPI_C_LONG_DOUBLE_COMPLEX โ€” long double _Complex

these next ones are the datatypes for the MPI functions MPI_MAXLOC and MPI_MINLOC, iykyk:

  • MPI_FLOAT_INT โ€” struct { float, int }
  • MPI_LONG_INT โ€” struct { long, int }
  • MPI_DOUBLE_INT โ€” struct { double, int }
  • MPI_SHORT_INT โ€” struct { short, int }
  • MPI_2INT โ€” struct { int, int }
  • MPI_LONG_DOUBLE_INT โ€” struct { long double, int } ; this one is an optional type, and it may be set to MPI_DATATYPE_NULL

and now, special datatypes for C and Fortran โœจ

  • MPI_PACKED โ€” for MPI_Pack and MPI_Unpack
  • MPI_UB โ€” for MPI_Type_struct ; an upper-bound indicator. Removed in MPI 3
  • MPI_LB โ€” for MPI_Type_struct ; a lower-bound indicator. Removed in MPI 3

๐Ÿฆ‹ FORTRAN DATATYPES ๐Ÿฆ‹

  • MPI_REAL โ€” REAL
  • MPI_INTEGER โ€” INTEGER
  • MPI_LOGICAL โ€” LOGICAL
  • MPI_DOUBLE_PRECISION โ€” DOUBLE PRECISION
  • MPI_COMPLEX โ€” COMPLEX
  • MPI_DOUBLE_COMPLEX โ€” complex*16 (or complex*32) where supported.

the following datatypes are optional (as in, may or may not show up ๐Ÿ‘€):

  • MPI_INTEGER1 โ€” integer*1 if supported
  • MPI_INTEGER2 โ€” integer*2 if supported
  • MPI_INTEGER4 โ€” integer*4 if supported
  • MPI_INTEGER8 โ€” integer*8 if supported
  • MPI_INTEGER16 โ€” integer*16 if supported
  • MPI_REAL4 โ€” real*4 if supported
  • MPI_REAL8 โ€” real*8 if supported
  • MPI_REAL16 โ€” real*16 if supported
  • MPI_COMPLEX8 โ€” complex*8 if supported
  • MPI_COMPLEX16 โ€” complex*16 if supported
  • MPI_COMPLEX32 โ€” complex*32 if supported

these are for MPI_MAXLOC and MPI_MINLOC. in Fortran, these datatypes always consist of two elements of the same Fortran type โ€” no mixing, bestie ๐Ÿค

  • MPI_2INTEGER โ€” INTEGER,INTEGER
  • MPI_2REAL โ€” REAL, REAL
  • MPI_2DOUBLE_PRECISION โ€” DOUBLE PRECISION, DOUBLE PRECISION

MPI datatypes for MPI types, going full meta:

  • MPI_AINT โ€” datatype for an MPI_Aint
  • MPI_OFFSET โ€” datatype for an MPI_Offset
  • MPI_COUNT โ€” datatype for an MPI_Count

๐ŸŒˆ MPI DATATYPE COMBINER NAMES ๐ŸŒˆ

  • MPI_COMBINER_NAMED โ€” a named predefined datatype
  • MPI_COMBINER_DUP โ€” MPI_TYPE_DUP
  • MPI_COMBINER_CONTIGUOUS โ€” MPI_TYPE_CONTIGUOUS
  • MPI_COMBINER_VECTOR โ€” MPI_TYPE_VECTOR
  • MPI_COMBINER_HVECTOR_INTEGER โ€” Removed in MPI-3
  • MPI_COMBINER_HVECTOR โ€” MPI_TYPE_CREATE_HVECTOR
  • MPI_COMBINER_INDEXED โ€” MPI_TYPE_INDEXED
  • MPI_COMBINER_HINDEXED_INTEGER โ€” Removed in MPI-3
  • MPI_COMBINER_HINDEXED โ€” MPI_TYPE_CREATE_HINDEXED
  • MPI_COMBINER_INDEXED_BLOCK โ€” MPI_TYPE_CREATE_INDEXED_BLOCK
  • MPI_COMBINER_STRUCT_INTEGER โ€” Removed in MPI-3
  • MPI_COMBINER_STRUCT โ€” MPI_TYPE_CREATE_STRUCT
  • MPI_COMBINER_SUBARRAY โ€” MPI_TYPE_CREATE_SUBARRAY
  • MPI_COMBINER_DARRAY โ€” MPI_TYPE_CREATE_DARRAY
  • MPI_COMBINER_F90_REAL โ€” MPI_TYPE_CREATE_F90_REAL
  • MPI_COMBINER_F90_COMPLEX โ€” MPI_TYPE_CREATE_F90_COMPLEX
  • MPI_COMBINER_F90_INTEGER โ€” MPI_TYPE_CREATE_F90_INTEGER
  • MPI_COMBINER_RESIZED โ€” MPI_TYPE_CREATE_RESIZED
  • MPI_COMBINER_HINDEXED_BLOCK โ€” MPI_TYPE_CREATE_HINDEXED_BLOCK

๐Ÿ’œ MPI DATATYPE TYPE CLASSES ๐Ÿ’œ

MPI type classes โ€” these get used with routines that return Fortran types with defined precision and range ๐ŸŽฏ

  • MPI_TYPECLASS_REAL โ€” REAL
  • MPI_TYPECLASS_INTEGER โ€” INTEGER
  • MPI_TYPECLASS_COMPLEX โ€” COMPLEX

โญ MPI DARRAY AND SUBARRAY VALUES โญ

you use these to make a datatype with the DARRAY and SUBARRAY constructors โœจ

  • MPI_ORDER_C โ€” row-major order (as used by C)
  • MPI_ORDER_FORTRAN โ€” column-major order (as used by Fortran)
  • MPI_DISTRIBUTE_BLOCK โ€” block distribution
  • MPI_DISTRIBUTE_CYCLIC โ€” cyclic distribution
  • MPI_DISTRIBUTE_NONE โ€” this dimension is not distributed
  • MPI_DISTRIBUTE_DFLT_DARG โ€” use the default distribution

๐Ÿ‘‘ COMMUNICATORS ๐Ÿ‘‘

communicators are of type MPI_Comm in C, INTEGER in Fortran, and Type(MPI_Comm) in Fortran08 ๐Ÿ’ซ

  • MPI_COMM_WORLD โ€” contains all of the processes
  • MPI_COMM_SELF โ€” contains only the calling process

๐ŸŽ€ KIND OF COMMUNICATOR FOR 'MPI_COMM_SPLIT_TYPE' ๐ŸŽ€

  • MPI_COMM_TYPE_SHARED โ€” all processes that can share memory are grouped into the same communicator.

๐Ÿซถ GROUPS ๐Ÿซถ

groups are of type MPI_Group in C, INTEGER in Fortran, and Type(MPI_Group) in Fortran08 ๐ŸŒธ

  • MPI_GROUP_EMPTY โ€” a group containing no members.

๐Ÿ”ฅ RESULTS OF THE COMPARE OPERATIONS ON GROUPS AND COMMUNICATORS ๐Ÿ”ฅ

  • MPI_IDENT โ€” identical
  • MPI_CONGRUENT โ€” (only for MPI_COMM_COMPARE) the groups are identical
  • MPI_SIMILAR โ€” same members, but in a different order
  • MPI_UNEQUAL โ€” different

๐Ÿ’… COLLECTIVE OPERATIONS ๐Ÿ’…

the collective combination operations (like MPI_REDUCE, MPI_ALLREDUCE, MPI_REDUCE_SCATTER, and MPI_SCAN) take a combination operation. that operation is of type MPI_Op in C and of type INTEGER in Fortran. here are the predefined ones, bestie:

  • MPI_MAX โ€” return the maximum
  • MPI_MIN โ€” return the minimum
  • MPI_SUM โ€” return the sum
  • MPI_PROD โ€” return the product
  • MPI_LAND โ€” return the logical and
  • MPI_BAND โ€” return the bitwise and
  • MPI_LOR โ€” return the logical or
  • MPI_BOR โ€” return the bitwise of
  • MPI_LXOR โ€” return the logical exclusive or
  • MPI_BXOR โ€” return the bitwise exclusive or
  • MPI_MINLOC โ€” return the minimum and the location (actually, the value of the second element of the structure where the minimum of the first is found)
  • MPI_MAXLOC โ€” return the maximum and the location
  • MPI_REPLACE โ€” replace b with a
  • MPI_NO_OP โ€” perform no operation

๐Ÿงš NOTES ON COLLECTIVE OPERATIONS ๐Ÿงš

okay this part is important, listen up ๐Ÿ“ข the reduction functions (MPI_Op) do not return an error value. so if they detect an error, all they can do is either call MPI_Abort or silently skip the problem ๐Ÿ˜ญ so if you change the error handler from MPI_ERRORS_ARE_FATAL to something else โ€” for example MPI_ERRORS_RETURN โ€” then no error may be indicated.

why tho? because of performance problems in ensuring that all collective routines return the same error value. it's giving "we could but at what cost".

also, not all datatypes are valid for these functions. for example, MPI_COMPLEX is not valid for MPI_MAX and MPI_MIN. and on top of that, the MPI 1.1 standard did not include the C types MPI_CHAR and MPI_UNSIGNED_CHAR among the lists of arithmetic types for operations like MPI_SUM. buuut since the C type char is an integer type (like short), it should have been included. the MPI Forum will probably include char and unsigned char as a clarification to MPI 1.1; until then, users are advised that MPI implementations may not accept MPI_CHAR and MPI_UNSIGNED_CHAR as valid datatypes for MPI_SUM, MPI_PROD, etc. MPICH does allow these datatypes though ๐Ÿ’–


๐ŸŒŸ PERMANENT KEY VALUES ๐ŸŒŸ

these are the same in C and Fortran, no cap ๐Ÿค

  • MPI_TAG_UB โ€” largest tag value
  • MPI_HOST โ€” rank of process that is host, if any
  • MPI_IO โ€” rank of process that can do I/O
  • MPI_WTIME_IS_GLOBAL โ€” has value 1 if MPI_WTIME is globally synchronized.
  • MPI_UNIVERSE_SIZE โ€” number of available processes. see the standard for a description of limitations on this value
  • MPI_LASTUSEDCODE โ€” last used MPI error code (check โ€” code or class?)
  • MPI_APPNUM โ€” application number, starting from 0. see the standard for MPI_COMM_SPAWN_MULTIPLE and mpiexec for details

๐Ÿ“ NULL OBJECTS ๐Ÿ“

the whole squad of "nothing here" handles, all iconic in their own right:

  • MPI_COMM_NULL โ€” null communicator
  • MPI_OP_NULL โ€” null operation
  • MPI_GROUP_NULL โ€” null group
  • MPI_DATATYPE_NULL โ€” null datatype
  • MPI_REQUEST_NULL โ€” null request
  • MPI_ERRHANDLER_NULL โ€” null error handler
  • MPI_WIN_NULL โ€” null window handle
  • MPI_FILE_NULL โ€” null file handle
  • MPI_INFO_NULL โ€” null info handle
  • MPI_MESSAGE_NULL โ€” null message handle
  • MPI_ARGV_NULL โ€” empty ARGV value for spawn commands
  • MPI_ARGVS_NULL โ€” empty ARGV array for spawn-multiple command
  • MPI_T_ENUM_NULL โ€” null MPI_T enum
  • MPI_T_CVAR_HANDLE_NULL โ€” null MPI_T control variable handle
  • MPI_T_PVAR_HANDLE_NULL โ€” null MPI_T performance variable handle
  • MPI_T_PVAR_SESSION_NULL โ€” null MPI_T performance variable session handle

๐ŸŒŸ PREDEFINED CONSTANTS ๐ŸŒŸ

okay so these are the lil magic numbers MPI hands you so you don't have to guess ๐Ÿ’… all of them are constants, all of them matter:

  • MPI_MAX_PROCESSOR_NAME โ€” the absolute max length of the name that comes back from MPI_GET_PROCESSOR_NAME โœจ
  • MPI_MAX_ERROR_STRING โ€” biggest possible length of the string MPI_ERROR_STRING hands back
  • MPI_MAX_LIBRARY_VERSION_STRING โ€” longest string MPI_GET_LIBRARY_VERSION_STRING can return ???
  • MPI_MAX_PORT_NAME โ€” max length of a port name, periodt ๐ŸŽ€
  • MPI_MAX_OBJECT_NAME โ€” max length of an object (name), allegedly ๐Ÿ™ˆ
  • MPI_MAX_INFO_KEY โ€” how long an info key can be
  • MPI_MAX_INFO_VAL โ€” how long an info value can be
  • MPI_UNDEFINED โ€” the "idk, unknown, undefined" integer a bunch of routines use when there's no real value to give you ๐Ÿ’€
  • MPI_UNDEFINED_RANK โ€” a rank that is... not a rank. unknown, bestie
  • MPI_KEYVAL_INVALID โ€” that special keyval you compare against to catch keyvals that were never initialized ๐Ÿ‘‘
  • MPI_BSEND_OVERHEAD โ€” add this to the size of an MPI_BSEND buffer for each outstanding message. yes, each. don't forget it, the vibes will be off ๐Ÿ”ฅ
  • MPI_PROC_NULL โ€” a rank you can send to or receive from and it's literally nobody ๐Ÿซฅ no-op city
  • MPI_ANY_SOURCE โ€” on a receive: "idc who sent it, I'll take anyone's message" ๐Ÿ’–
  • MPI_ANY_TAG โ€” on a receive: "any tag value is fine, I'm not picky"
  • MPI_BOTTOM โ€” may be used to indicate the bottom of the address space ๐ŸŒˆ
  • MPI_IN_PLACE โ€” that special buffer location some collective communication routines use so you don't need a separate send buffer โœจ
  • MPI_BUFFER_AUTOMATIC โ€” use automatic (unlimited) buffering in buffered send ๐Ÿฆ‹ unlimited buffering?? she's generous
  • MPI_VERSION โ€” the numeric MPI version, e.g. 3
  • MPI_SUBVERSION โ€” the numeric MPI subversion, e.g. 1 (so 3.1, iykyk)

๐Ÿ—บ๏ธ TOPOLOGY TYPES ๐Ÿ—บ๏ธ

what shape is your process crew, bestie:

  • MPI_CART โ€” Cartesian grid ๐ŸŽ€ all neat and gridded
  • MPI_GRAPH โ€” general graph, freeform connections
  • MPI_DIST_GRAPH โ€” general distributed graph

๐ŸŒธ SPECIAL VALUES FOR DISTRIBUTED GRAPH ๐ŸŒธ

  • MPI_UNWEIGHTED โ€” says the edges have no weights, they're just vibes
  • MPI_WEIGHTS_EMPTY โ€” a special address meaning "there is no array of weights information here" ๐Ÿซถ

๐Ÿ“ FILE MODES ๐Ÿ“

the flags for how you're opening a file. remember these, they're giving choices:

  • MPI_MODE_RDONLY โ€” read only, look don't touch
  • MPI_MODE_RDWR โ€” read and write, she does it all ๐Ÿ’…
  • MPI_MODE_WRONLY โ€” write only
  • MPI_MODE_CREATE โ€” create the file if it doesn't exist yet โœจ
  • MPI_MODE_EXCL โ€” it is an error if you try to create a file that already exists โš ๏ธ
  • MPI_MODE_DELETE_ON_CLOSE โ€” delete the file when it's closed. dramatic exit ๐Ÿ”ฅ
  • MPI_MODE_UNIQUE_OPEN โ€” this file will not be concurrently opened anywhere else
  • MPI_MODE_APPEND โ€” all file pointers start out at the end of the file ๐ŸŽ€
  • MPI_MODE_SEQUENTIAL โ€” the file will only be accessed sequentially, no jumping around

๐Ÿ“ FILE DISPLACEMENT ๐Ÿ“

  • MPI_DISPLACEMENT_CURRENT โ€” use this with files that were opened with mode MPI_MODE_SEQUENTIAL, in calls to MPI_FILE_SET_VIEW

๐Ÿงญ FILE POSITIONING ๐Ÿงญ

  • MPI_SEEK_SET โ€” set the pointer to offset
  • MPI_SEEK_CUR โ€” set the pointer to the current position plus offset
  • MPI_SEEK_END โ€” set the pointer to the end of the file plus offset

๐ŸชŸ WINDOW ATTRIBUTES ๐ŸชŸ

  • MPI_WIN_BASE โ€” the window base address
  • MPI_WIN_SIZE โ€” window size, in bytes
  • MPI_WIN_DISP_UNIT โ€” the displacement unit associated with the window
  • MPI_WIN_CREATE_FLAVOR โ€” how the window was created ๐Ÿ‘€
  • MPI_WIN_MODEL โ€” the memory model for the window

๐ŸŽจ WINDOW FLAVORS ๐ŸŽจ

  • MPI_WIN_FLAVOR_CREATE โ€” window was created with MPI_WIN_CREATE
  • MPI_WIN_FLAVOR_ALLOCATE โ€” window was created with MPI_WIN_ALLOCATE
  • MPI_WIN_FLAVOR_DYNAMIC โ€” window was created with MPI_WIN_CREATE_DYNAMIC
  • MPI_WIN_FLAVOR_SHARED โ€” window was created with MPI_WIN_ALLOCATE_SHARED

๐Ÿง  WINDOW MEMORY MODEL ๐Ÿง 

  • MPI_WIN_SEPARATE โ€” separate public and private copies of window memory
  • MPI_WIN_UNIFIED โ€” the public and private copies are identical (and by identical we mean that updates are eventually observed without additional RMA operations) ๐Ÿ’œ

๐Ÿ”’ WINDOW LOCK TYPES ๐Ÿ”’

  • MPI_LOCK_EXCLUSIVE โ€” only one process at a time will execute accesses inside the lock. it's giving exclusive, it's giving main character ๐Ÿ‘‘
  • MPI_LOCK_SHARED โ€” not exclusive; multiple processes may execute accesses inside the lock ๐Ÿซถ

๐Ÿ“ข WINDOW ASSERTIONS ๐Ÿ“ข

See section 11.5 in MPI 3.1 for a detailed description of each of these assertion values. (not me telling you to go read the source, but bestie... go read it ๐Ÿ“–)
  • MPI_MODE_NOCHECK โ€” the matching calls to MPI_WIN_POST or MPI_WIN_START have already completed, or no process holds or will attempt to acquire a conflicting lock
  • MPI_MODE_NOSTORE โ€” the local window has not been updated by stores since the last synchronization
  • MPI_MODE_NOPUT โ€” the local window will not be updated by put or accumulate until the next synchronization
  • MPI_MODE_NOPRECEDE โ€” the fence does not complete any locally issued RMA calls
  • MPI_MODE_NOSUCCEED โ€” the fence does not start any locally issued RMA calls

๐Ÿ”ฎ PREDEFINED INFO OBJECT ๐Ÿ”ฎ

  • MPI_INFO_ENV โ€” contains the execution environment ๐Ÿฆ‹

๐Ÿ“ฌ MPI STATUS ๐Ÿ“ฌ

so the MPI_Status datatype is a structure in C. the three elements that are actually for you, the programmer, are:

  • MPI_SOURCE โ€” who sent the message
  • MPI_TAG โ€” what tag the message was sent with
  • MPI_ERROR โ€” any error return (only when the error returned by the routine has error class MPI_ERR_IN_STATUS) โš ๏ธ

and then the chaotic duo:

  • MPI_STATUS_IGNORE โ€” ignore a single MPI_Status argument ๐Ÿ™ˆ
  • MPI_STATUSES_IGNORE โ€” ignore an array of MPI_Status ๐Ÿ™ˆ๐Ÿ™ˆ

๐Ÿšจ SPECIAL VALUE FOR ERROR CODES ARRAY ๐Ÿšจ

  • MPI_ERRCODES_IGNORE โ€” ignore an array of error codes ๐Ÿ’€

๐Ÿ› ๏ธ MPI_T CONSTANTS ๐Ÿ› ๏ธ

verbosity, the user edition ๐Ÿ’–

  • MPI_T_VERBOSITY_USER_BASIC โ€” basic info that's of interest to users
  • MPI_T_VERBOSITY_USER_DETAIL โ€” detailed info that's of interest to users
  • MPI_T_VERBOSITY_USER_ALL โ€” all the remaining info that's of interest to users

verbosity, the tuner edition ๐ŸŽ›๏ธ

  • MPI_T_VERBOSITY_TUNER_BASIC โ€” basic info required for tuning
  • MPI_T_VERBOSITY_TUNER_DETAIL โ€” detailed info required for tuning
  • MPI_T_VERBOSITY_TUNER_ALL โ€” all remaining info required for tuning

verbosity, the implementor edition ๐Ÿง‘โ€๐Ÿ”ฌ

  • MPI_T_VERBOSITY_MPIDEV_BASIC โ€” basic info for MPI implementors
  • MPI_T_VERBOSITY_MPIDEV_DETAIL โ€” detailed info for MPI implementors
  • MPI_T_VERBOSITY_MPIDEV_ALL โ€” all remaining info for MPI implementors

binding scopes โ€” what is this variable even attached to ๐Ÿงท

  • MPI_T_BIND_NO_OBJECT โ€” applies globally to the entire MPI process
  • MPI_T_BIND_MPI_COMM โ€” MPI communicators
  • MPI_T_BIND_MPI_DATATYPE โ€” MPI datatypes
  • MPI_T_BIND_MPI_ERRHANDLER โ€” MPI error handlers
  • MPI_T_BIND_MPI_FILE โ€” MPI file handles
  • MPI_T_BIND_MPI_GROUP โ€” MPI groups
  • MPI_T_BIND_MPI_OP โ€” MPI reduction operators
  • MPI_T_BIND_MPI_REQUEST โ€” MPI requests
  • MPI_T_BIND_MPI_WIN โ€” MPI windows for one-sided communication
  • MPI_T_BIND_MPI_MESSAGE โ€” MPI message object
  • MPI_T_BIND_MPI_INFO โ€” MPI info object
  • MPI_T_BIND_MPI_SESSION โ€” MPI session object

scopes โ€” who has to agree on a write โœ๏ธ

  • MPI_T_SCOPE_CONSTANT โ€” read-only, the value is constant. untouched, unbothered โœจ
  • MPI_T_SCOPE_READONLY โ€” read-only, cannot be written, but it can change
  • MPI_T_SCOPE_LOCAL โ€” may be writeable, and writing it is a local operation
  • MPI_T_SCOPE_GROUP โ€” may be writeable, must be done to a group of processes, and all processes in a group must be set to consistent values
  • MPI_T_SCOPE_GROUP_EQ โ€” may be writeable, must be done to a group of processes, and all processes in a group must be set to the same value
  • MPI_T_SCOPE_ALL โ€” may be writeable, must be done to all processes, and all connected processes must be set to consistent values
  • MPI_T_SCOPE_ALL_EQ โ€” may be writeable, must be done to all processes, and all connected processes must be set to the same value

pvar classes โ€” the category of your performance variable ๐Ÿ“Š

  • MPI_T_PVAR_CLASS_STATE โ€” a set of discrete states (MPI_INT)
  • MPI_T_PVAR_CLASS_LEVEL โ€” utilization level of a resource
  • MPI_T_PVAR_CLASS_SIZE โ€” size of a resource
  • MPI_T_PVAR_CLASS_PERCENTAGE โ€” percentage utilization of a resource
  • MPI_T_PVAR_CLASS_HIGHWATERMARK โ€” high watermark of a resource
  • MPI_T_PVAR_CLASS_LOWWATERMARK โ€” low watermark of a resource
  • MPI_T_PVAR_CLASS_COUNTER โ€” number of occurrences of an event
  • MPI_T_PVAR_CLASS_AGGREGATE โ€” aggregate value over an event (e.g. the sum of all memory allocations)
  • MPI_T_PVAR_CLASS_TIMER โ€” aggregate time spent executing an event โฑ๏ธ
  • MPI_T_PVAR_CLASS_GENERIC โ€” used for any other type of performance variable

๐Ÿงต THREAD LEVELS ๐Ÿงต

how much threading chaos are you signing up for:

  • MPI_THREAD_SINGLE โ€” only one thread executes ๐Ÿง˜
  • MPI_THREAD_FUNNELED โ€” only the main thread makes MPI calls
  • MPI_THREAD_SERIALIZED โ€” only one thread at a time makes MPI calls
  • MPI_THREAD_MULTIPLE โ€” multiple threads may make MPI calls. full chaos mode, slay ๐Ÿ”ฅ

๐Ÿช„ SPECIAL MPI TYPES AND FUNCTIONS ๐Ÿช„

  • MPI_Aint โ€” a C type that holds any valid address
  • MPI_Count โ€” a C type that holds any valid count
  • MPI_Offset โ€” a C type that holds any valid file offset
  • MPI_Handler_function โ€” a C function for handling errors (see MPI_Errhandler_create)
  • MPI_User_function โ€” a C function to combine values (see collective operations and MPI_Op_create)
  • MPI_Copy_function โ€” a function to copy attributes (see MPI_Keyval_create)
  • MPI_Delete_function โ€” a function to delete attributes (see MPI_Keyval_create)
  • MPI_ERRORS_ARE_FATAL โ€” error handler that forces exit on error ๐Ÿ’€
  • MPI_ERRORS_RETURN โ€” error handler that returns error codes (as the value of the MPI routine in C, and through the last argument in Fortran)
  • MPI_ERRORS_ABORT โ€” error handler that forces exit on error (it only aborts the local process if the error handler is invoked on a session)

๐Ÿท๏ธ MPI ATTRIBUTE DEFAULT FUNCTIONS ๐Ÿท๏ธ

the prebuilt copy / delete / duplicate trio for each object type, so you don't have to write your own (you can though, you're iconic):

  • MPI_COMM_NULL_COPY_FN โ€” predefined attribute copy function for communicators
  • MPI_COMM_NULL_DELETE_FN โ€” predefined attribute delete function for communicators
  • MPI_COMM_DUP_FN โ€” predefined attribute duplicate function for communicators
  • MPI_WIN_NULL_COPY_FN โ€” predefined attribute copy function for windows
  • MPI_WIN_NULL_DELETE_FN โ€” predefined attribute delete function for windows
  • MPI_WIN_DUP_FN โ€” predefined attribute duplicate function for windows
  • MPI_TYPE_NULL_COPY_FN โ€” predefined attribute copy function for datatypes
  • MPI_TYPE_NULL_DELETE_FN โ€” predefined attribute delete function for datatypes
  • MPI_TYPE_DUP_FN โ€” predefined attribute duplicate function for datatypes

๐ŸŽ€ MPI-1 ATTRIBUTE DEFAULT FUNCTIONS ๐ŸŽ€

bestie these three are the pre-baked, ready-to-go functions you slap into your attribute copy/delete/dup slots so you don't have to roll your own. built in, zero effort, iconic:

  • MPI_NULL_COPY_FN โ€” the predefined copy function โœจ
  • MPI_NULL_DELETE_FN โ€” the predefined delete function ๐Ÿ—‘๏ธ
  • MPI_DUP_FN โ€” the predefined duplication function ๐Ÿซถ

๐Ÿ’ฅ MPI ERROR CLASSES ๐Ÿ’ฅ

okay so this is THE master list, the whole return-code wardrobe. every error MPI can hand you back lives here. yes it's long. yes you're gonna need it. screenshot it, pin it, love it ๐Ÿ’…

  • MPI_SUCCESS โ€” it worked!! the successful return code, the slay we're all chasing ๐Ÿ’–
  • MPI_ERR_BUFFER โ€” your buffer pointer is invalid, not it ๐Ÿšซ
  • MPI_ERR_COUNT โ€” the count argument is invalid
  • MPI_ERR_TYPE โ€” the datatype argument is invalid
  • MPI_ERR_TAG โ€” the tag argument is invalid
  • MPI_ERR_COMM โ€” invalid communicator, tragic
  • MPI_ERR_RANK โ€” invalid rank
  • MPI_ERR_ROOT โ€” invalid root
  • MPI_ERR_GROUP โ€” you passed a null group to the function ๐Ÿ˜ญ
  • MPI_ERR_OP โ€” invalid operation
  • MPI_ERR_TOPOLOGY โ€” invalid topology
  • MPI_ERR_DIMS โ€” illegal dimension argument
  • MPI_ERR_ARG โ€” invalid argument, the classic
  • MPI_ERR_UNKNOWN โ€” unknown error (mysterious, unbothered, no explanation)
  • MPI_ERR_TRUNCATE โ€” message got truncated on receive ๐Ÿ˜ต
  • MPI_ERR_OTHER โ€” some other error; go ask Error_string about it
  • MPI_ERR_INTERN โ€” internal error code
  • MPI_ERR_IN_STATUS โ€” the error value is chillin' in the status, look there
  • MPI_ERR_PENDING โ€” pending request
  • MPI_ERR_REQUEST โ€” invalid mpi_request handle
  • MPI_ERR_ACCESS โ€” permission denied, absolutely not getting in ๐Ÿšช
  • MPI_ERR_AMODE โ€” error relating to the amode you passed to MPI_FILE_OPEN
  • MPI_ERR_BAD_FILE โ€” invalid file name (like, path name too long and everything)
  • MPI_ERR_CONVERSION โ€” an error happened inside a user-supplied data conversion function
  • MPI_ERR_DUP_DATAREP โ€” the conversion functions couldn't be registered because a data representation identifier that was already defined got passed to MPI_REGISTER_DATAREP
  • MPI_ERR_FILE_EXISTS โ€” the file already exists
  • MPI_ERR_FILE_IN_USE โ€” the file operation couldn't finish because the file is currently open by some process
  • MPI_ERR_FILE โ€” invalid file handle
  • MPI_ERR_IO โ€” some other I/O error
  • MPI_ERR_NO_SPACE โ€” not enough space ๐Ÿ•ณ๏ธ
  • MPI_ERR_NO_SUCH_FILE โ€” file does not exist
  • MPI_ERR_READ_ONLY โ€” read-only file or file system, hands off โœ‹
  • MPI_ERR_UNSUPPORTED_DATAREP โ€” unsupported datarep got passed to MPI_FILE_SET_VIEW
  • MPI_ERR_INFO โ€” invalid info argument
  • MPI_ERR_INFO_KEY โ€” key is longer than MPI_MAX_INFO_KEY
  • MPI_ERR_INFO_VALUE โ€” value is longer than MPI_MAX_INFO_VAL
  • MPI_ERR_INFO_NOKEY โ€” invalid key passed to MPI_INFO_DELETE
  • MPI_ERR_NAME โ€” invalid service name passed to MPI_LOOKUP_NAME
  • MPI_ERR_NO_MEM โ€” Alloc_mem could not allocate memory ๐Ÿ’€
  • MPI_ERR_NOT_SAME โ€” a collective argument wasn't identical on all processes, or the collective routines got called in a different order by different processes (chaos, honestly)
  • MPI_ERR_PORT โ€” invalid port name passed to MPI_COMM_CONNECT
  • MPI_ERR_QUOTA โ€” quota exceeded
  • MPI_ERR_SERVICE โ€” invalid service name passed to MPI_UNPUBLISH_NAME
  • MPI_ERR_SPAWN โ€” error in spawning processes
  • MPI_ERR_UNSUPPORTED_OPERATION โ€” unsupported operation, like trying to seek on a file that only supports sequential access
  • MPI_ERR_WIN โ€” invalid win argument
  • MPI_ERR_BASE โ€” invalid base passed to MPI_FREE_MEM
  • MPI_ERR_LOCKTYPE โ€” invalid locktype argument
  • MPI_ERR_KEYVAL โ€” erroneous attribute key
  • MPI_ERR_RMA_CONFLICT โ€” conflicting accesses to the window ๐Ÿ˜ค
  • MPI_ERR_RMA_SYNC โ€” wrong synchronization of RMA calls
  • MPI_ERR_SIZE โ€” invalid size argument
  • MPI_ERR_DISP โ€” invalid disp argument
  • MPI_ERR_ASSERT โ€” invalid assert argument
  • MPI_ERR_RMA_RANGE โ€” target memory is not part of the window (and if the window was created with MPI_WIN_CREATE_DYNAMIC, then the target memory isn't attached)
  • MPI_ERR_RMA_ATTACH โ€” memory can't be attached (like, because of resource exhaustion)
  • MPI_ERR_RMA_SHARED โ€” memory can't be shared (like when some process in the group of the specified communicator can't expose shared memory)
  • MPI_ERR_RMA_FLAVOR โ€” passed window has the wrong flavor for the (real talk: the sentence literally ends there in the source, mid-thought, and I respect it ๐Ÿ’€)
  • MPI_ERR_SESSION โ€” invalid session argument
  • MPI_ERR_PROC_ABORTED โ€” you're trying to communicate with aborted processes, they are not picking up ๐Ÿชฆ
  • MPI_ERR_VALUE_TOO_LARGE โ€” the value is too large to store
  • MPI_ERR_ERRHANDLER โ€” invalid error handler argument for the called function
  • MPI_ERR_LASTCODE โ€” the last error code, and it's always at the end, periodt ๐Ÿ

๐Ÿฆ‹ ERROR CODES FOR MPI_T ๐Ÿฆ‹

and now the exclusive lil' collection that belongs to MPI_T only. tool-writers, this one's for you, mwah ๐Ÿ’œ

  • MPI_T_ERR_MEMORY โ€” out of memory
  • MPI_T_ERR_NOT_INITIALIZED โ€” interface not initialized
  • MPI_T_ERR_CANNOT_INIT โ€” interface isn't in a state where it can be initialized
  • MPI_T_ERR_INVALID_INDEX โ€” the index is invalid or it has been deleted
  • MPI_T_ERR_INVALID_HANDLE โ€” the handle is invalid
  • MPI_T_ERR_OUT_OF_HANDLES โ€” no more handles available
  • MPI_T_ERR_OUT_OF_SESSIONS โ€” no more sessions available
  • MPI_T_ERR_INVALID_SESSION โ€” the session argument is not valid
  • MPI_T_ERR_CVAR_SET_NOT_NOW โ€” the cvar cannot be set at this moment
  • MPI_T_ERR_CVAR_SET_NEVER โ€” the cvar cannot be set until the end of execution, so don't even try
  • MPI_T_ERR_PVAR_NO_STARTSTOP โ€” the pvar can't be started or stopped
  • MPI_T_ERR_PVAR_NO_WRITE โ€” the pvar can't be written or reset
  • MPI_T_ERR_PVAR_NO_ATOMIC โ€” the pvar can't be read/written atomically
  • MPI_T_ERR_INVALID_NAME โ€” the name doesn't match
  • MPI_T_ERR_INVALID โ€” invalid use of the interface, or bad parameter value(s) โ€” yes, the source spells it values(s) and I'm keeping it exactly like that, no cap ๐Ÿ“

and that's a wrap on the whole Constants(3) page, babes ๐Ÿซถ this was the Constants(3) manual page, dated 4/10/2026 โ€” constants for dayyys, errors for centuries, and you now know every single one of them. go forth and debug like a main character ๐Ÿ‘‘โœจ

๐Ÿ“ฆ where this page comes from