MPI_CARTDIM_GET(3)
π MPI_CARTDIM_GET(3) β the Open MPI one, bestie π
okay so you're deep in Open MPI land and you found the MPI_Cartdim_get page?? slay. this is the MPI_CARTDIM_GET(3) manual page and we are going to read it TOGETHER, no cap. grab your iced coffee. π§
β¨ NAME β¨
MPI_Cartdim_get β retrieves Cartesian topology information associated with a communicator.
like. it just tells you stuff about your cart comm. that's the whole job. iconic behavior honestly. π
πΈ SYNTAX πΈ
C Syntax
#include <mpi.h>
int MPI_Cartdim_get(MPI_Comm comm, int *ndims)
Fortran Syntax
USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_CARTDIM_GET(COMM, NDIMS, IERROR)
INTEGER COMM, NDIMS, IERROR
Fortran 2008 Syntax
USE mpi_f08
MPI_Cartdim_get(comm, ndims, ierror)
TYPE(MPI_Comm), INTENT(IN) :: comm
INTEGER, INTENT(OUT) :: ndims
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
π«Ά INPUT PARAMETER π«Ά
commβ the communicator that has Cartesian structure, i.e. the handle. it's giving "already cart, already cute". π
π OUTPUT PARAMETERS π
ndimsβ how many dimensions your Cartesian structure has (that's an integer bestie).ierrorβ Fortran only: the error status (integer). so Fortran girlies get an extra little slot for it. π
π DESCRIPTION π
MPI_Cartdim_get returns the number of dimensions of the Cartesian structure. that's it. that's the function. it's a one-job queen and she does her job. periodt. β¨
π ERRORS π
almost all MPI routines return an error value, lowkey. C routines hand it back as the return result of the function, and Fortran routines put it in the last argument. classic.
before that error value even comes back to you, the current MPI error handler associated with the communication object (think: communicator, window, file) gets called. and if there is no communication object associated with the MPI call?? then the call is considered attached to MPI_COMM_SELF and it'll call the error handler associated with that. and when MPI_COMM_SELF is not initialized (aka before MPI_Init / MPI_Init_thread, after MPI_Finalize, or when you're using the Sessions Model exclusively) the error raises the initial error handler. π
you can change that initial error handler by calling MPI_Comm_set_errhandler on MPI_COMM_SELF when you're using the World model, or with the mpi_initial_errhandler CLI argument to mpiexec, or via the info key to MPI_Comm_spawn / MPI_Comm_spawn_multiple. and if no other appropriate error handler has been set?? then the MPI_ERRORS_RETURN error handler is called for MPI I/O functions, and the MPI_ERRORS_ABORT error handler is called for all other MPI functions.
Open MPI ships three predefined error handlers that you can use, and here they are:
MPI_ERRORS_ARE_FATALβ causes the program to abort all connected MPI processes. dramatic. as she should. πMPI_ERRORS_ABORTβ an error handler that can be invoked on a communicator, window, file, or session. when called on a communicator, it acts as ifMPI_Abortwas called on that communicator. if called on a window or file, it acts as ifMPI_Abortwas called on a communicator containing the group of processes in the corresponding window or file. if called on a session, it aborts only the local process. it's a whole vibe per-object. π¦MPI_ERRORS_RETURNβ returns an error code to the application. polite. love that for her. π«Ά
MPI applications can also implement their own error handlers by calling:
MPI_Comm_create_errhandlerthenMPI_Comm_set_errhandlerMPI_File_create_errhandlerthenMPI_File_set_errhandlerMPI_Session_create_errhandlerthenMPI_Session_set_errhandleror atMPI_Session_initMPI_Win_create_errhandlerthenMPI_Win_set_errhandler
β οΈ note that MPI does not guarantee that an MPI program can continue past an error. so like. don't count on it bestie. π
see the MPI man page for a full list of MPI error codes.
see the Error Handling section of the MPI-3.1 standard for more information.
π See also: π
MPI_Cart_get
π Copyright π
2003-2026, The Open MPI Community
and that's the whole page, bestie!! you ate this one fr fr β go get those Cartesian dimensions. this was Open MPI, MPI_CARTDIM_GET(3), dated Sep 10, 2026. mwah. πππ¦β¨
π¦ where this page comes from
- ubuntu stonking: openmpi-doc 5.0.10-6 Β· other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms