initialize_mpi Subroutine

subroutine initialize_mpi(comm)

initialize_mpi – Initialized MPI is MPI_Init has not been called yet.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: comm

Calls

proc~~initialize_mpi~~CallsGraph proc~initialize_mpi initialize_mpi interface~mapl_assert MAPL_Assert proc~initialize_mpi->interface~mapl_assert mpi_comm_rank mpi_comm_rank proc~initialize_mpi->mpi_comm_rank mpi_comm_size mpi_comm_size proc~initialize_mpi->mpi_comm_size mpi_init_thread mpi_init_thread proc~initialize_mpi->mpi_init_thread mpi_initialized mpi_initialized proc~initialize_mpi->mpi_initialized proc~mapl_abort MAPL_abort proc~initialize_mpi->proc~mapl_abort proc~mapl_verify MAPL_Verify proc~initialize_mpi->proc~mapl_verify mpi_abort mpi_abort proc~mapl_abort->mpi_abort proc~mapl_throw_exception MAPL_throw_exception proc~mapl_verify->proc~mapl_throw_exception

Called by

proc~~initialize_mpi~~CalledByGraph proc~initialize_mpi initialize_mpi program~main~8 main program~main~8->proc~initialize_mpi

Source Code

   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