The plain default-integer handle this communicator is known by –
what comm_from_handle takes back, and what a handle-based API (one
that is not itself written against pic-mpi, such as MPI_Comm_c2f’s C
callers) expects. Under mpi_f08 this is MPI_Comm’s MPI_VAL component;
the MPI standard guarantees it is the same integer the legacy mpi
module would hand back for the same communicator, so a caller on
either backend gets a value usable the same way.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(comm_t), | intent(in) | :: | this |
function comm_fortran_handle(this) result(fh) !! The plain default-integer handle this communicator is known by -- !! what `comm_from_handle` takes back, and what a handle-based API (one !! that is not itself written against pic-mpi, such as MPI_Comm_c2f's C !! callers) expects. Under mpi_f08 this is MPI_Comm's MPI_VAL component; !! the MPI standard guarantees it is the same integer the legacy `mpi` !! module would hand back for the same communicator, so a caller on !! either backend gets a value usable the same way. class(comm_t), intent(in) :: this integer :: fh if (.not. this%is_valid) then error stop "Cannot get a Fortran handle from a null Comm" end if fh = this%m_comm%MPI_VAL end function comm_fortran_handle