setup_cell_owners Subroutine

private subroutine setup_cell_owners(mesh, flow)

Initializes contiguous-decomposition owner lookup.

Arguments

Type IntentOptional Attributes Name
type(mesh_t), intent(in) :: mesh
type(flow_mpi_t), intent(inout) :: flow

Called by

proc~~setup_cell_owners~~CalledByGraph proc~setup_cell_owners mod_mpi_flow::setup_cell_owners proc~flow_mpi_initialize mod_mpi_flow::flow_mpi_initialize proc~flow_mpi_initialize->proc~setup_cell_owners program~lowmach_react_hex lowmach_react_hex program~lowmach_react_hex->proc~flow_mpi_initialize

Source Code

   subroutine setup_cell_owners(mesh, flow)
      type(mesh_t), intent(in) :: mesh
      type(flow_mpi_t), intent(inout) :: flow
      integer :: r, first, last

      allocate(flow%cell_owner(mesh%ncells))
      flow%cell_owner = -1
      do r = 1, flow%nprocs
         first = flow%gather_firsts(r)
         last = first + flow%gather_counts(r) - 1
         if (last >= first) flow%cell_owner(first:last) = r - 1
      end do
   end subroutine setup_cell_owners