MPI_CLOSE_PORT(3)
π MPI_CLOSE_PORT π
okay bestie, welcome to the <mpi.h> cinematic universe π this one's a Open MPI classic β MPI_Close_port(3) β and she's short, she's sweet, and she's here to release a network address. Periodt. β¨
β¨ NAME β¨
MPI_Close_port β releases the specified network address. that's the whole job. no notes. π
πΈ SYNTAX πΈ
π C Syntax
#include <mpi.h>
int MPI_Close_port(const char *port_name)
π Fortran Syntax
USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_CLOSE_PORT(PORT_NAME, IERROR)
CHARACTER*(*) PORT_NAME
INTEGER IERROR
π Fortran 2008 Syntax
USE mpi_f08
MPI_Close_port(port_name, ierror)
CHARACTER(LEN=*), INTENT(IN) :: port_name
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
likeβ¦ three whole syntaxes for one little port-close. iconic behavior honestly. π
π¦ INPUT PARAMETER π¦
port_nameβ a port (string). that's it, that's the argument. she's giving string energy and nothing else. π
π¦ OUTPUT PARAMETER π¦
ierrorβ Fortran only: error status (integer). C girlies get their error code back as the return value instead, iykyk. π
π DESCRIPTION π
MPI_Close_port releases the network address represented by port_name.
that's literally the whole vibe. you had a port name, you're done with it, you close it, you move on. main character energy: exit gracefully. π§
π ERRORS π
ok so listen up, because this part is giving "read the fine print" energy and it applies to basically every MPI routine ever:
Almost all MPI routines return an error value. C routines hand it back as the return result of the function, and Fortran routines drop it in the last argument. simple.
Before the error value is even returned, the current MPI error handler associated with the communication object (e.g., communicator, window, file) gets called. and if no communication object is associated with the MPI call? then the call is considered attached to MPI_COMM_SELF and it'll call the associated MPI error handler instead.
When MPI_COMM_SELF is not initialized β that means before MPI_Init/MPI_Init_thread, after MPI_Finalize, or when using the Sessions Model exclusively β the error raises the initial error handler.
And you can change that initial error handler, bestie:
- by calling
MPI_Comm_set_errhandleronMPI_COMM_SELFwhen using the World model, or - via the
mpi_initial_errhandlerCLI argument tompiexec, or - via the info key to
MPI_Comm_spawn/MPI_Comm_spawn_multiple.
If no other appropriate error handler has been set, then MPI_ERRORS_RETURN is called for MPI I/O functions, and MPI_ERRORS_ABORT is called for all other MPI functions. that's the default pipeline, no cap. π₯
π the three predefined error handlers
Open MPI ships with three of them, and they're all a little different:
MPI_ERRORS_ARE_FATALβ causes the program to abort all connected MPI processes. yes, all of them. bestie said "we go down together." π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.MPI_ERRORS_RETURNβ returns an error code to the application. chill. respectful. π«Ά
π§ make your own, you DIY queen
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_errhandler, or 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. fr fr. don't assume you can just casually keep vibing after an error, because you might not be able to. π
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.
π Copyright π
2003-2026, The Open MPI Community
and that's the whole page, babe π β MPI_CLOSE_PORT(3) from the Open MPI crew, dated Sep 10, 2026, copyright held by The Open MPI Community (2003-2026). go forth and close your ports responsibly. slay. π
β¨
π¦ 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