send_group_assignment_matrix Subroutine

public subroutine send_group_assignment_matrix(world_comm, dest_rank, ids, matrix)

Send shard-assignment ids and polymer matrix to a destination rank.

Arguments

Type IntentOptional Attributes Name
type(comm_t), intent(in) :: world_comm
integer, intent(in) :: dest_rank
integer(kind=int64), intent(in) :: ids(:)
integer, intent(in) :: matrix(:,:)

Calls

proc~~send_group_assignment_matrix~~CallsGraph proc~send_group_assignment_matrix send_group_assignment_matrix isend isend proc~send_group_assignment_matrix->isend

Called by

proc~~send_group_assignment_matrix~~CalledByGraph proc~send_group_assignment_matrix send_group_assignment_matrix proc~global_coordinator_impl global_coordinator_impl proc~global_coordinator_impl->proc~send_group_assignment_matrix proc~gmbe_pie_coordinator gmbe_pie_coordinator proc~gmbe_pie_coordinator->proc~send_group_assignment_matrix proc~global_coordinator global_coordinator proc~global_coordinator->proc~global_coordinator_impl proc~gmbe_run_distributed gmbe_context_t%gmbe_run_distributed proc~gmbe_run_distributed->proc~gmbe_pie_coordinator interface~global_coordinator global_coordinator interface~global_coordinator->proc~global_coordinator proc~mbe_run_distributed mbe_context_t%mbe_run_distributed proc~mbe_run_distributed->interface~global_coordinator

Variables

Type Visibility Attributes Name Initial
integer, private, allocatable :: buf(:)
integer(kind=int32), private :: n_cols
integer(kind=int64), private :: n_rows
type(request_t), private :: req(4)

Source Code

   subroutine send_group_assignment_matrix(world_comm, dest_rank, ids, matrix)
      !! Send shard-assignment ids and polymer matrix to a destination rank.
      type(comm_t), intent(in) :: world_comm
      integer, intent(in) :: dest_rank
      integer(int64), intent(in) :: ids(:)
      integer, intent(in) :: matrix(:, :)

      integer(int64) :: n_rows
      integer(int32) :: n_cols
      integer, allocatable :: buf(:)
      type(request_t) :: req(4)

      n_rows = size(ids, kind=int64)
      n_cols = size(matrix, 2)

      call isend(world_comm, n_rows, dest_rank, TAG_GROUP_ASSIGN, req(1))
      call isend(world_comm, ids, dest_rank, TAG_GROUP_ASSIGN, req(2))
      call isend(world_comm, n_cols, dest_rank, TAG_GROUP_POLYMERS, req(3))

      if (n_rows > 0_int64 .and. n_cols > 0) then
         allocate (buf(n_rows*n_cols))
         buf = reshape(matrix, [n_rows*n_cols])
      else
         allocate (buf(0))
      end if
      call isend(world_comm, buf, dest_rank, TAG_GROUP_POLYMERS, req(4))

      call wait(req(1))
      call wait(req(2))
      call wait(req(3))
      call wait(req(4))
      deallocate (buf)
   end subroutine send_group_assignment_matrix