Init_DomainDecomposition_t Subroutine

public subroutine Init_DomainDecomposition_t(this)

Arguments

TypeIntentOptionalAttributesName
class(DomainDecomposition_t), intent(inout) :: this

Calls

proc~~init_domaindecomposition_t~~CallsGraph proc~init_domaindecomposition_t Init_DomainDecomposition_t mpi_init mpi_init proc~init_domaindecomposition_t->mpi_init mpi_comm_size mpi_comm_size proc~init_domaindecomposition_t->mpi_comm_size mpi_comm_rank mpi_comm_rank proc~init_domaindecomposition_t->mpi_comm_rank

Contents


Source Code

  subroutine Init_DomainDecomposition_t(this)
    implicit none
    class(DomainDecomposition_t),intent(inout) :: this
    ! Local
    integer       :: ierror

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

    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."

    if(this%nRanks > 1) then
      this%mpiEnabled = .true.
    else
      print*,__FILE__," : 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))

    this%initialized = .true.

    this%initialized = .true.

  endsubroutine Init_DomainDecomposition_t