prepare_matrix_gather Subroutine

private subroutine prepare_matrix_gather(flow, ncomp, ncells, nlocal_comp)

Updates cached count/displacement arrays for a packed component count.

Arguments

Type IntentOptional Attributes Name
type(flow_mpi_t), intent(inout) :: flow
integer, intent(in) :: ncomp
integer, intent(in) :: ncells
integer, intent(out) :: nlocal_comp

Calls

proc~~prepare_matrix_gather~~CallsGraph proc~prepare_matrix_gather mod_mpi_flow::prepare_matrix_gather proc~fatal_error mod_kinds::fatal_error proc~prepare_matrix_gather->proc~fatal_error

Called by

proc~~prepare_matrix_gather~~CalledByGraph proc~prepare_matrix_gather mod_mpi_flow::prepare_matrix_gather proc~flow_allgather_owned_matrix mod_mpi_flow::flow_allgather_owned_matrix proc~flow_allgather_owned_matrix->proc~prepare_matrix_gather proc~flow_allgather_owned_matrix_inplace mod_mpi_flow::flow_allgather_owned_matrix_inplace proc~flow_allgather_owned_matrix_inplace->proc~prepare_matrix_gather proc~flow_allgather_owned_v4 mod_mpi_flow::flow_allgather_owned_v4 proc~flow_allgather_owned_v4->proc~prepare_matrix_gather proc~flow_gather_owned_matrix_root mod_mpi_flow::flow_gather_owned_matrix_root proc~flow_gather_owned_matrix_root->proc~prepare_matrix_gather proc~flow_allgather_owned_vector mod_mpi_flow::flow_allgather_owned_vector proc~flow_allgather_owned_vector->proc~flow_allgather_owned_matrix

Source Code

   subroutine prepare_matrix_gather(flow, ncomp, ncells, nlocal_comp)
      type(flow_mpi_t), intent(inout) :: flow
      integer, intent(in) :: ncomp, ncells
      integer, intent(out) :: nlocal_comp

      if (.not. allocated(flow%gather_matrix_sendbuf)) then
         call fatal_error('mpi_flow', 'owned matrix gather buffers are not initialized')
      end if

      if (ncomp > flow%gather_max_components) then
         call fatal_error('mpi_flow', 'owned matrix gather component count exceeds cached buffer size')
      end if

      if (sum(flow%gather_counts) /= ncells) then
         call fatal_error('mpi_flow', 'owned matrix gather cell count mismatch')
      end if

      nlocal_comp = flow%nlocal * ncomp
      flow%gather_matrix_counts = flow%gather_counts * ncomp
      flow%gather_matrix_displs = flow%gather_displs * ncomp
   end subroutine prepare_matrix_gather