include/pops/mesh/storage/mf_arith.hpp Source FileΒΆ
|
adc_cpp 0.3.0
Model-free C++23 core for coupled hyperbolic-elliptic systems on adaptive (AMR) meshes, with MPI and GPU (Kokkos) backends
|
mf_arith.hpp
Go to the documentation of this file.
28// the block path (#64): these operations are first-instantiated from the MG V-cycle, itself pulled
29// from an external TU (native harness/loader); an extended lambda at this spot makes nvcc stumble on
72// Reducer f(i,j,comp) -> sum / signed max / signed min over one component. Same device-clean named
74// instantiated from a generated problem.so, an external TU). MaxKernel/MinKernel are SIGNED (no fabs,
146// ranks (all-reduce). Building block of Krylov solvers (BiCGStab: rho, alpha, omega, betas). Each
151// WITH NO box (local_size()==0, which then contributes 0 to the local sum). Without this call on all
156// to a lexicographic sum (deterministic/idempotent nonetheless, all Kokkos spaces). Under MPI, the all-reduce
157// returns the SAME value to all ranks (MPI_SUM over one same set of local contributions), so the
Box2D: the integer index space of a 2D cell-centered Cartesian grid.
ConstArray4 const_array() const
READ handle (POD device-copyable) over this Fab. Valid as long as the Fab lives.
Definition fab2d.hpp:96
Array4 array()
WRITE handle (POD device-copyable) over this Fab. Valid as long as the Fab lives.
Definition fab2d.hpp:91
Field distributed over a level: decomposition (BoxArray) + distribution (DistributionMapping) + ncomp...
Definition multifab.hpp:33
Fab2D & fab(int li)
Local fab at index li (0 <= li < local_size()), for writing.
Definition multifab.hpp:67
const Box2D & box(int li) const
VALID box of local fab li.
Definition multifab.hpp:71
int local_size() const
Number of fabs OWNED by this rank (bound on local indices).
Definition multifab.hpp:65
Parallel seam: minimal MPI abstraction (rank/size + collectives) with serial fallback.
Fab2D: single-grid data on a Box2D (in-house equivalent of AMReX's FArrayBox); Array4 / ConstArray4: ...
for_each_cell and reductions: the parallelism SEAM over the cells of a Box2D; sync_host / sync_device...
MultiFab: a field DISTRIBUTED over a level (equivalent of AMReX's MultiFab).
Definition amr_hierarchy.hpp:29
Real dot_all(const MultiFab &x, const MultiFab &y)
FULL-component dot Sum_{cells, c} x(.,.,c) * y(.,.,c) over ALL components, reduced over ALL ranks (al...
Definition mf_arith.hpp:182
void for_each_cell(const Box2D &b, F f)
Applies f to EACH cell (i, j) of box b (bounds inclusive), via Kokkos::parallel_for (Serial / OpenMP ...
Definition for_each.hpp:138
Real dot(const MultiFab &x, const MultiFab &y, int comp=0)
Dot product Sum_cells x.y over component comp, reduced over ALL ranks (all_reduce).
Definition mf_arith.hpp:163
void saxpy(MultiFab &y, Real a, const MultiFab &x)
y <- y + a x over ALL components of the valid cells. Identical layouts required.
Definition mf_arith.hpp:102
Real reduce_min(const MultiFab &mf, int comp=0)
Signed minimum min_cells f(.,.,comp) over component comp, reduced over ALL ranks (all_reduce_min) β t...
Definition mf_arith.hpp:223
Real reduce_sum_cell(const Box2D &b, F f)
SUM reduction with a REDUCING FUNCTOR: f receives (i, j, Real& acc) and accumulates,...
Definition for_each.hpp:274
Real reduce_max_cell(const Box2D &b, F f)
MAX reduction with a REDUCING FUNCTOR: f receives (i, j, Real& acc) and updates acc,...
Definition for_each.hpp:240
void lincomb(MultiFab &z, Real a, const MultiFab &x, Real b, const MultiFab &y)
z <- a x + b y over ALL components of the valid cells. Identical layouts; aliasing safe.
Definition mf_arith.hpp:133
Real reduce_max(const MultiFab &mf, int comp=0)
Signed maximum max_cells f(.,.,comp) over component comp, reduced over ALL ranks (all_reduce_max) β t...
Definition mf_arith.hpp:211
Real reduce_sum(const MultiFab &mf, int comp=0)
Sum Sum_cells f(.,.,comp) over component comp, reduced over ALL ranks (all_reduce_sum) β the compiled...
Definition mf_arith.hpp:198
Real norm_inf(const MultiFab &mf, int comp=0)
Infinity norm max |f(.,.,comp)| over the valid cells (LOCAL, without MPI all_reduce).
Definition mf_arith.hpp:123
WRITE POD handle (raw pointer + strides) over a Fab2D buffer, indexed by (i, j, c) IN GLOBAL INDICES ...
Definition fab2d.hpp:29
READ-only handle (const counterpart of Array4): same layout and same contract (POD device-copyable,...
Definition fab2d.hpp:44
Definition mf_arith.hpp:66
POPS_HD void operator()(int i, int j, Real &acc) const
Definition mf_arith.hpp:69
Definition mf_arith.hpp:40
POPS_HD void operator()(int i, int j) const
Definition mf_arith.hpp:45
Definition mf_arith.hpp:81
POPS_HD void operator()(int i, int j, Real &acc) const
Definition mf_arith.hpp:84
Definition mf_arith.hpp:90
POPS_HD void operator()(int i, int j, Real &acc) const
Definition mf_arith.hpp:93
Definition mf_arith.hpp:52
POPS_HD void operator()(int i, int j, Real &acc) const
Definition mf_arith.hpp:55
Definition mf_arith.hpp:32
POPS_HD void operator()(int i, int j) const
Definition mf_arith.hpp:37
Definition mf_arith.hpp:76
POPS_HD void operator()(int i, int j, Real &acc) const
Definition mf_arith.hpp:79
Base scalar types and the POPS_HD macro (host+device portability).
Generated by