MPI_CARTDIM_GET(3)
π MPI_CARTDIM_GET(3) β Open MPI
okay so bestie, welcome to the MPI_CARTDIM_GET page from the Open MPI manual (yes, section 3, the library-calls girlies) β¨ this one is short and sweet and it slaps.
π NAME π
MPI_Cartdim_get β retrieves Cartesian topology information associated with a communicator. that's it, that's the whole vibe check π¦
β¨ 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β a communicator that's got that Cartesian structure going on (it's a handle, bestie).
π OUTPUT PARAMETERS π
ndimsβ the number of dimensions of the Cartesian structure (an integer). literally the whole point of the call πierrorβ Fortran only: the error status (an integer).
π« DESCRIPTION π«
MPI_Cartdim_get hands you back the number of dimensions of the Cartesian structure. that's the tea, no cap β
π₯ ERRORS π₯
okay so this part is long but it's important so stay with me π«Ά β almost all MPI routines return an error value; C routines give it to you as the return result of the function, and Fortran routines stick it in the last argument.
Before that error value comes back to you, the current MPI error handler associated with the communication object (like, a communicator, a window, or a file β you know the type) gets called. if there's no communication object associated with the MPI call, then the call counts as attached to MPI_COMM_SELF and it'll call that associated MPI error handler. and when MPI_COMM_SELF is not initialized (i.e., before MPI_Init/MPI_Init_thread, after MPI_Finalize, or when you're using the Sessions Model exclusively β all of those π), the error raises the initial error handler. that initial error handler can be changed by calling MPI_Comm_set_errhandler on MPI_COMM_SELF when you're using the World model, or via 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. periodt π
Open MPI includes three predefined error handlers you can use:
MPI_ERRORS_ARE_FATALβ causes the program to abort all connected MPI processes. yeah. all of them. πMPI_ERRORS_ABORTβ an error handler that can be invoked on a communicator, window, file, or session. when it's called on a communicator, it acts as ifMPI_Abortwas called on that communicator. if it's 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 it's called on a session, it aborts only the local process.MPI_ERRORS_RETURNβ returns an error code to the application. the chill one π§
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. like, do not assume you can just keep going, 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! π source + version: The Open MPI Community, 2003-2026, dated Sep 11, 2026 β go get that topology info, you main character πβ¨
π¦ where this page comes from
- arch rolling: openmpi 5.0.11-1 Β· BSD-3-Clause AND LicenseRef-MPICH
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms