initialize_mpi
– Initialized MPI is MPI_Init has not been called yet.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | comm |
subroutine initialize_mpi(comm) integer, intent(in) :: comm logical :: mpi_already_initialized integer :: ierror integer :: provided call MPI_Initialized(mpi_already_initialized, ierror) if (.not. mpi_already_initialized) then call MPI_Init_thread(MPI_THREAD_SINGLE, provided, ierror) _VERIFY(ierror) _ASSERT(provided == MPI_THREAD_SINGLE, "MPI_THREAD_SINGLE not supported by this MPI.") end if call MPI_Comm_rank(comm, pe_rank, ierror); _VERIFY(ierror) call MPI_Comm_size(comm, npes_world, ierror); _VERIFY(ierror) end subroutine initialize_mpi