exchange_elements Subroutine

public subroutine exchange_elements(me, sparta)

Exchange mesh elements with other process The following data within treelmesh_type is updated in this routine: treeID, ElemPropertyBits, Part_First, Part_Last Data pathList is deallocated.

Arguments

Type IntentOptional Attributes Name
type(treelmesh_type), intent(inout) :: me

Tree Mesh type nElems and offset should be ready before this routine

type(tem_sparta_type), intent(in) :: sparta

How many elements to exchange with other processes


Calls

proc~~exchange_elements~~CallsGraph proc~exchange_elements exchange_elements interface~tem_exchange_sparta tem_exchange_sparta proc~exchange_elements->interface~tem_exchange_sparta proc~gather_property gather_property proc~exchange_elements->proc~gather_property mpi_allgather mpi_allgather proc~exchange_elements->mpi_allgather proc~tem_exchange_long2 tem_exchange_long2 interface~tem_exchange_sparta->proc~tem_exchange_long2 proc~tem_exchange_double tem_exchange_double interface~tem_exchange_sparta->proc~tem_exchange_double proc~tem_exchange_long tem_exchange_long interface~tem_exchange_sparta->proc~tem_exchange_long proc~tem_exchange_double2 tem_exchange_double2 interface~tem_exchange_sparta->proc~tem_exchange_double2 mpi_exscan mpi_exscan proc~gather_property->mpi_exscan mpi_alltoallv mpi_alltoallv proc~tem_exchange_long2->mpi_alltoallv proc~tem_exchange_double->mpi_alltoallv proc~tem_abort tem_abort proc~tem_exchange_double->proc~tem_abort proc~tem_exchange_long->mpi_alltoallv proc~tem_exchange_long->proc~tem_abort proc~tem_exchange_double2->mpi_alltoallv mpi_abort mpi_abort proc~tem_abort->mpi_abort

Called by

proc~~exchange_elements~~CalledByGraph proc~exchange_elements exchange_elements proc~load_tem load_tem proc~load_tem->proc~exchange_elements proc~tem_restart_readheader tem_restart_readHeader proc~tem_restart_readheader->proc~load_tem proc~tem_load_restart tem_load_restart proc~tem_load_restart->proc~tem_restart_readheader

Contents

Source Code


Source Code

  subroutine exchange_elements( me, sparta )
    ! -------------------------------------------------------------------- !
    !> Tree Mesh type
    !! nElems and offset should be ready before this routine
    type( treelmesh_type ), intent(inout) :: me
    !> How many elements to exchange with other processes
    type( tem_sparta_type ), intent(in) :: sparta
    ! -------------------------------------------------------------------- !
    integer :: iError, iProp
    ! -------------------------------------------------------------------- !

    ! Exchange treeID and propertyBits ---------------------------------
    call tem_exchange_sparta( me = sparta, &
      &                       val = me%treeID, &
      &                       nComponents = 1, &
      &                       comm = me%global%comm )
    call tem_exchange_sparta( me = sparta, &
      &                       val = me%ElemPropertyBits, &
      &                       nComponents = 1, &
      &                       comm = me%global%comm )
    ! Exchange treeID and propertyBits ---------------------------------

    ! Update Part_first and Part_Last ------------------------
    call MPI_allgather( me%treeID(1), 1, long_k_mpi,  &
      &                 me%Part_First, 1, long_k_mpi, &
      &                 me%global%comm, iError        )
    call MPI_allgather( me%treeID(me%nElems), 1, long_k_mpi, &
      &                 me%Part_Last, 1, long_k_mpi,         &
      &                 me%global%comm, iError               )
    ! Update Part_first and Part_Last ------------------------

    do iProp=1,me%global%nProperties
      call gather_Property( Property = me%Property(iProp),                     &
        &                   Header   = me%global%Property(iProp),              &
        &                   BitField = me%ElemPropertyBits,                    &
        &                   comm     = me%global%comm )
    end do

    if (allocated(me%pathList)) deallocate( me%pathList  )

  end subroutine exchange_elements