MPI_Comm_accept(3OpenMPI)
π MPI_Comm_accept β the Open MPI glow-up edition π
okay bestie, welcome to MPI_Comm_accept(3OpenMPI), straight outta the Open MPI fam. this is the page where your root node sits by the phone waiting for a client to hit it up, and honestly? it's giving "waiting for your situationship to text back" but make it parallel computing. β¨
πΈ NAME πΈ
MPI_Comm_accept β establishes communication with a client. that's it, that's the whole job. π«Ά
β¨ SYNTAX β¨
π C Syntax
#include <mpi.h>
int MPI_Comm_accept(const char *port_name, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *newcomm)
π Fortran Syntax
USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_COMM_ACCEPT(PORT_NAME, INFO, ROOT, COMM, NEWCOMM, IERROR)
CHARACTER*(*) PORT_NAME
INTEGER INFO, ROOT, COMM, NEWCOMM, IERROR
π Fortran 2008 Syntax
USE mpi_f08
MPI_Comm_accept(port_name, info, root, comm, newcomm, ierror)
CHARACTER(LEN=*), INTENT(IN) :: port_name
TYPE(MPI_Info), INTENT(IN) :: info
INTEGER, INTENT(IN) :: root
TYPE(MPI_Comm), INTENT(IN) :: comm
TYPE(MPI_Comm), INTENT(OUT) :: newcomm
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
π C++ Syntax
#include <mpi.h>
MPI::Intercomm MPI::Intracomm::Accept(const char* port_name,
const MPI::Info& info, int root) const
π INPUT PARAMETERS π
port_nameβ the port name, bestie. it's a string, and heads up: it's used only on root. so everybody else incommcan just vibe, this one's on the root node.infoβ options that root is passing in for the accept. it's a handle, and again, used only on root. and the tea? no options are currently supported. it's giving "we built the field but left it empty" πrootβ the rank incommof the root node. an integer. this is your main character for this call. πcommβ the intracommunicator that this whole call is collective over. a handle. everybody in it is in on this together, no solo acts. π
π OUTPUT PARAMETERS π
newcommβ an intercommunicator where the client is the remote group. a handle. this is the little connection y'all just made. π¦IERRORβ Fortran only: the error status, as an integer. the "did it work tho" report card. π
π§ DESCRIPTION π§
so like, MPI_Comm_accept establishes communication with a client. that's the whole vibe. it's collective over the calling communicator β meaning every process in comm has to show up, no ghosting, no "sorry I was busy."
it hands you back an intercommunicator that lets you talk to the client. and when does the client show up? after the client has connected with the MPI_Comm_accept function using the MPI_Comm_connect function. yes bestie, connect on one side, accept on the other. it's a two-way thing, like any good friendship. π«Ά
the port_name? it must have been established through a call to MPI_Open_port on the root. so you can't just make up a port name out of thin air, that's not how this works, that's not how any of this works. π
π ERRORS π
almost all MPI routines return an error value, okay? here's the breakdown so you're not caught off guard:
- C routines: the error value is the return value of the function.
- Fortran routines: it lands in the last argument.
- C++ functions: they do not return errors. periodt.
and if the default error handler is set to MPI::ERRORS_THROW_EXCEPTIONS, then on error the C++ exception mechanism will be used to throw an MPI::Exception object. so C++ besties, get ready to catch. π
before the error value is returned, the current MPI error handler gets called. by default, this error handler aborts the MPI job β except for I/O function errors, those get a pass. the error handler may be changed with MPI_Comm_set_errhandler, and the predefined error handler MPI_ERRORS_RETURN may be used to cause error values to be returned instead. so like, if you don't want the whole job to just perish, MPI_ERRORS_RETURN is your girl. π
see the MPI man page for a full list of MPI error codes. iykyk. π
π₯ SEE ALSO π₯
MPI_Comm_connectMPI_Open_port
and that's the page, bestie! π this whole thing is Open MPI version 4.1.6, dated Sep 30, 2023, and yes it's the MPI_Comm_accept(3OpenMPI) manual page, iconic as ever. now go accept that connection β you got this, no cap. πβ¨π¦π
π¦ where this page comes from
- ubuntu noble: openmpi-doc 4.1.6-7ubuntu2
- Copyright 2013 Los Alamos National Security, LLC. All rights reserved
- Copyright 2009-2010 Cisco Systems, Inc. All rights reserved
- Copyright 2007, Sun Microsystems, Inc
- Copyright (c) 1996 Thinking Machines Corporation
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms