Init_DomainDecomposition_t Subroutine

public subroutine Init_DomainDecomposition_t(this, enableMPI)

Arguments

TypeIntentOptionalAttributesName
class(DomainDecomposition_t), intent(inout) :: this
logical, intent(in) :: enableMPI

Contents


Source Code

  subroutine Init_DomainDecomposition_t(this,enableMPI)
#undef __FUNC__
#define __FUNC__ "Init_DomainDecomposition_t"
    implicit none
    class(DomainDecomposition_t),intent(inout) :: this
    logical,intent(in) :: enableMPI
    ! Local
    integer       :: ierror

    this%mpiComm = 0
    this%mpiPrec = prec
    this%rankId = 0
    this%nRanks = 1
    this%nElem = 0
    this%mpiEnabled = enableMPI

    if(enableMPI) then
      this%mpiComm = MPI_COMM_WORLD
      print*,__FILE__," : Initializing MPI"
      call mpi_init(ierror)
      call mpi_comm_rank(this%mpiComm,this%rankId,ierror)
      call mpi_comm_size(this%mpiComm,this%nRanks,ierror)
      print*,__FILE__," : Rank ",this%rankId+1,"/",this%nRanks," checking in."
    else
      print*,__FILE__," : MPI not initialized. No domain decomposition used."
    endif

    if(prec == real32) then
      this%mpiPrec = MPI_FLOAT
    else
      this%mpiPrec = MPI_DOUBLE
    endif

    allocate(this%offsetElem(1:this%nRanks+1))

  endsubroutine Init_DomainDecomposition_t