MPI_Type_get_contents(3)

πŸ“¦
version 5.0.1 Β· 5 versions
, in nixos 26.05, ubuntu stonking

✨ NAME ✨

MPI_Type_get_contents β€” get type contents. Straight from the MPI manual, bestie, and yes it's giving "let me peek inside this datatype" πŸ’….

πŸ¦‹ SYNOPSIS πŸ¦‹

int MPI_Type_get_contents(MPI_Datatype datatype, int max_integers,
       int max_addresses, int max_large_counts,
       int max_datatypes, int array_of_integers[],
       MPI_Aint array_of_addresses[],
       MPI_Count array_of_large_counts[],
       MPI_Datatype array_of_datatypes[])

and the _c version, because of course there's a _c version:

int MPI_Type_get_contents_c(MPI_Datatype datatype, MPI_Count max_integers,
       MPI_Count max_addresses, MPI_Count max_large_counts,
       MPI_Count max_datatypes, int array_of_integers[],
       MPI_Aint array_of_addresses[],
       MPI_Count array_of_large_counts[],
       MPI_Datatype array_of_datatypes[])

🌸 INPUT PARAMETERS 🌸

  • datatype β€” the datatype to access (it's a handle, bestie).
  • max_integers β€” number of elements in array_of_integers (non-negative integer, no negativity allowed periodt).
  • max_addresses β€” number of elements in array_of_addresses (non-negative integer).
  • max_large_counts β€” number of elements in array_of_large_counts (non-negative integer).
  • max_datatypes β€” number of elements in array_of_datatypes (non-negative integer).

πŸ’Ž OUTPUT PARAMETERS πŸ’Ž

  • array_of_integers β€” contains integer arguments used in constructing datatype (integer).
  • array_of_addresses β€” contains address arguments used in constructing datatype (integer).
  • array_of_large_counts β€” contains large count arguments used in constructing datatype (integer).
  • array_of_datatypes β€” contains datatype arguments used in constructing datatype (handle).

🧚 NOTES FOR FORTRAN 🧚

Okay Fortran besties, listen up. All MPI routines in Fortran β€” except for MPI_WTIME and MPI_WTICK β€” have an additional argument ierr at the end of the argument list. ierr is an integer and has the same meaning as the return value of the routine in C. In Fortran, MPI routines are subroutines, and they're invoked with the call statement.

Also: all MPI objects (e.g., MPI_Datatype, MPI_Comm) are of type INTEGER in Fortran. Not a vibe you can change, it's just how it is πŸ’….

πŸ”₯ ERRORS πŸ”₯

All MPI routines β€” except MPI_Wtime and MPI_Wtick β€” return an error value; C routines as the value of the function and Fortran routines in the last argument. Before the value is returned, the current MPI error handler is called. By default, this error handler aborts the MPI job 😭. The error handler may be changed with MPI_Comm_set_errhandler (for communicators), MPI_File_set_errhandler (for files), and MPI_Win_set_errhandler (for RMA windows). The MPI-1 routine MPI_Errhandler_set may be used but its use is deprecated (so maybe don't). 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; however, MPI implementations will attempt to continue whenever possible.

  • MPI_SUCCESS β€” No error; MPI routine completed successfully. We love a clean run ✨.
  • MPI_ERR_ARG β€” Invalid argument. Some argument is invalid and is not identified by a specific error class (e.g., MPI_ERR_RANK).
  • MPI_ERR_TYPE β€” Invalid datatype argument. Additionally, this error can occur if an uncommitted MPI_Datatype (see MPI_Type_commit) is used in a communication call.
  • MPI_ERR_OTHER β€” Other error; use MPI_Error_string to get more information about this error code.

That's the whole page, bestie. Served fresh on 4/10/2026, from the MPI manual β€” MPI_Type_get_contents(3) πŸ’–βœ¨πŸ¦‹. Go get those type contents, you main character.

πŸ“¦ where this page comes from