tem_set_sparta Subroutine

private subroutine tem_set_sparta(me, comm, nParts, send_count)

Arguments

Type IntentOptional Attributes Name
type(tem_sparta_type), intent(inout) :: me
integer, intent(in) :: comm
integer, intent(in) :: nParts
integer, intent(in) :: send_count(0:nParts-1)

Calls

proc~~tem_set_sparta~~CallsGraph proc~tem_set_sparta tem_set_sparta mpi_alltoall mpi_alltoall proc~tem_set_sparta->mpi_alltoall

Called by

proc~~tem_set_sparta~~CalledByGraph proc~tem_set_sparta tem_set_sparta proc~tem_balance_sparta tem_balance_sparta proc~tem_balance_sparta->proc~tem_set_sparta proc~tem_derive_sparta tem_derive_sparta proc~tem_derive_sparta->proc~tem_set_sparta proc~load_tem load_tem proc~load_tem->proc~tem_balance_sparta 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 tem_set_sparta( me, comm, nParts, send_count )
    type( tem_sparta_type ), intent(inout) :: me
    integer, intent(in) :: comm, nParts
    integer, intent(in) :: send_count(0:nParts-1)

    integer :: iProc, iErr

    ! Each process needs to know how many elements to receive from which process
    call mpi_alltoall(send_count, 1, mpi_integer, &
      &               me%recv_count, 1, mpi_integer,  &
      &               comm, iErr)

    ! Create additional structures for alltoallv ------------------------------
    me%send_index(0) = 0
    me%recv_index(0) = 0
    me%send_count(0) = send_count(0)
    do iProc = 1,nParts-1
      me%send_count(iProc) = send_count(iProc)
      me%send_index(iProc) = me%send_index(iProc-1) + send_count(iProc-1)
      me%recv_index(iProc) = me%recv_index(iProc-1) + me%recv_count(iProc-1)
    end do
    ! Create additional structures for alltoallv ------------------------------

    me%old_size = sum(me%send_count)
    me%new_size = sum(me%recv_count)

  end subroutine tem_set_sparta