private function create_comm_from_handle(fhandle) result(comm)
Builds an OWNED comm_t from a caller’s Fortran MPI communicator handle.
There is no MPI here and exactly one communicator, so there is nothing
to duplicate: any handle that is not the null one names the single
rank, and the result is the same comm_t comm_world() gives. The
signature exists so that code written against the API compiles and
runs unchanged in a serial build – which is the whole point of this
backend.
Not collective, unlike the real backends: there is only one rank to be
collective over. A handle naming MPI_COMM_NULL returns an invalid
comm_t.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Where possible, edges connecting nodes are
given different colours to make them easier to distinguish in
large graphs.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Where possible, edges connecting nodes are
given different colours to make them easier to distinguish in
large graphs.
Source Code
function create_comm_from_handle(fhandle)result(comm)!! Builds an OWNED comm_t from a caller's Fortran MPI communicator handle.!!!! There is no MPI here and exactly one communicator, so there is nothing!! to duplicate: any handle that is not the null one names the single!! rank, and the result is the same comm_t comm_world() gives. The!! signature exists so that code written against the API compiles and!! runs unchanged in a serial build -- which is the whole point of this!! backend.!!!! Not collective, unlike the real backends: there is only one rank to be!! collective over. A handle naming MPI_COMM_NULL returns an invalid!! comm_t.integer,intent(in)::fhandletype(comm_t)::commif(fhandle==MPI_COMM_NULL%v)thencomm=create_null_comm()elsecomm=create_world_comm()end if end function create_comm_from_handle