initialize_mpi Subroutine

public subroutine initialize_mpi(this, unusable, rc)

Type Bound

ExtDataDriver

Arguments

Type IntentOptional Attributes Name
class(ExtDataDriver), intent(inout) :: this
class(KeywordEnforcer), intent(in), optional :: unusable
integer, intent(out), optional :: rc

Calls

proc~~initialize_mpi~2~~CallsGraph proc~initialize_mpi~2 ExtDataDriver%initialize_mpi interface~mapl_assert MAPL_Assert proc~initialize_mpi~2->interface~mapl_assert mpi_comm_rank mpi_comm_rank proc~initialize_mpi~2->mpi_comm_rank mpi_comm_size mpi_comm_size proc~initialize_mpi~2->mpi_comm_size mpi_init mpi_init proc~initialize_mpi~2->mpi_init proc~mapl_return MAPL_Return proc~initialize_mpi~2->proc~mapl_return proc~mapl_verify MAPL_Verify proc~initialize_mpi~2->proc~mapl_verify at at proc~mapl_return->at insert insert proc~mapl_return->insert proc~mapl_throw_exception MAPL_throw_exception proc~mapl_return->proc~mapl_throw_exception proc~mapl_verify->proc~mapl_throw_exception

Called by

proc~~initialize_mpi~2~~CalledByGraph proc~initialize_mpi~2 ExtDataDriver%initialize_mpi proc~newextdatadriver newExtDataDriver proc~newextdatadriver->proc~initialize_mpi~2 interface~extdatadriver ExtDataDriver interface~extdatadriver->proc~newextdatadriver

Source Code

   subroutine initialize_mpi(this, unusable, rc) 
      class (ExtDataDriver), intent(inout) :: this
      class (KeywordEnforcer), optional, intent(in) :: unusable
      integer, optional, intent(out) :: rc

      integer :: ierror
      integer :: npes_world

      _UNUSED_DUMMY(unusable)

      call MPI_Init(ierror)
      _VERIFY(ierror)

      this%comm_world=MPI_COMM_WORLD
      call MPI_Comm_rank(this%comm_world, this%rank, ierror); _VERIFY(ierror)
      call MPI_Comm_size(this%comm_world, npes_world, ierror); _VERIFY(ierror)

      if ( this%cap_options%npes_model == -1) then
         ! just a feed back to cap_options to maintain integrity
          this%cap_options%npes_model = npes_world
      endif
      _ASSERT(npes_world >= this%cap_options%npes_model, "npes_world is smaller than npes_model")

      _RETURN(_SUCCESS)

   end subroutine initialize_mpi