Proto
3.2
|
Classes | |
class | AMRData |
AMR Data Hierarchy. More... | |
class | AMRGrid |
AMR Grid. More... | |
class | AMROp |
AMR-Scope Operator. More... | |
class | AMRSolver |
AMR Solver. More... | |
class | Array |
A templated constant size array object similar to std::array, but with the ability to be used inside of device kernels. More... | |
class | ArrayIterator |
class | AutoStart |
class | AutoStartLeaf |
struct | BCStencil |
A variation of Stencil used for applying boundary conditions. Consider the diagram below. BCStencil is designed to extrapolate the value of a ghost cell (A) using interior data (C) in addition to an edge centered value on the boundary (B). Note that a different MBStencil is needed to fill ghost cells at different distances from the boundary. The updated value (A) may have different units than the source values (B, C, D, ...); for example, A might be a flux while the source values have units of the associated state. The diagram below corresponds to the case where a ghost cell in the second layer of a low-face is being filled. More... | |
class | BoundaryCondition |
Library of utility functions for assisiting in the application of boundary conditions. More... | |
class | Box |
An interval in DIM dimensional space. More... | |
class | BoxData |
Multidimensional Rectangular Array. More... | |
class | BoxIterator |
Iterator for Boxes. More... | |
class | BoxOp |
Abstract Box-Scope Operator. More... | |
class | BoxPartition |
Box Partition. More... | |
struct | BufferEntry |
class | CInterval |
Component-Space Interval. More... | |
class | CoarseFineBoundary |
class | CompositeOp |
class | ConstArrayIterator |
class | ConstBC |
Constant Ghost Value. More... | |
class | ConstDirichletBC |
Not Really Dirichlet BC. More... | |
class | CoordPermutation |
Defines discrete rotations in logically rectangular coordinate systems. More... | |
class | Copier |
Abstract Generic Parallel Copier. More... | |
class | CopierIterator |
class | DataIndex |
Data Index. More... | |
class | DataIterator |
Distributed Data Iterator. More... | |
struct | DataWrapper |
class | describeInfo |
class | DisjointBoxLayout |
Disjoint Box Layout. More... | |
class | DistributedSet |
struct | Face |
class | FinitePointSet |
class | FluxBoxData |
class | FluxRegisterCopier |
Flux Register Copier. More... | |
class | FluxRegisterCopierOp |
Flux Register Copier Op. More... | |
class | InterpStencil |
class | InterpStencil1D |
Interpolation Stencil. More... | |
struct | LazyInterpStencil |
struct | LazyStencil |
An Unevaluated Stencil Operation. | |
class | LevelBC |
Storage for the LevelBCOps on each face. More... | |
class | LevelBoxData |
Level Box Data. More... | |
class | LevelCopier |
Level Copier. More... | |
class | LevelCopierOp |
Level Copier Operator. More... | |
class | LevelExchangeCopier |
Exchange Copier. More... | |
class | LevelFluxRegister |
Flux Register. More... | |
class | LevelOp |
Level-Scope Operator. More... | |
class | LevelSolver |
Level Solver. More... | |
class | MayDay |
Error-reporting Functions. More... | |
class | MBAMRBoxPartition |
class | MBAMRData |
Multiblock AMR Data. More... | |
class | MBAMRLayout |
Multiblock AMR Grid. More... | |
class | MBAMRMap |
class | MBBoundaryCopier |
Copier. More... | |
class | MBBoundaryCopierOp |
Copier Operator. More... | |
struct | MBBoundaryData |
class | MBBoundaryRegister |
Boundary Register. More... | |
class | MBBoxOp |
Abstract Box-Scope Operator for Mapped Multiblock. More... | |
class | MBBoxPartition |
class | MBDataIndex |
class | MBDataIterator |
class | MBDataPoint |
class | MBDisjointBoxLayout |
class | MBFluxRegisterCopier |
class | MBFluxRegisterCopierOp |
class | MBGraph |
Graph of a mapped multiblock domain. Nodes represent blocks and arcs represent boundaries between blocks. Does not contain any information about the size of blocks; that information is provided by MBProblemDomain. More... | |
struct | MBGraphArc |
An internal structure defining an arc in the MBGraph. More... | |
struct | MBGraphNode |
An internal structure defining a node in the MBGraph. More... | |
class | MBInterpLayout |
class | MBInterpOp |
Mapped Multiblock Block Boundary Interpolation Operator. More... | |
class | MBLevelArgs |
class | MBLevelBC |
class | MBLevelBoxData |
Multiblock Level Box Data. More... | |
struct | MBLevelBoxDataWrapper |
class | MBLevelCopier |
Level Copier. More... | |
class | MBLevelCopierOp |
Level Copier Operator. More... | |
class | MBLevelExchangeCopier |
Exchange Copier. More... | |
class | MBLevelExchangeCopierOp |
Exchange Copier Operator. More... | |
class | MBLevelFluxRegister |
class | MBLevelFluxRegisterTester |
class | MBLevelFullCopier |
Full Level Copier (Includes all ghost cells) More... | |
class | MBLevelFullCopierOp |
Full Level Copier Operator (Includes all ghost cells) More... | |
class | MBLevelMap |
Single Level Mapped Multiblock Map. More... | |
class | MBLevelOp |
Level-Scope Operator. More... | |
class | MBMapOp |
struct | MBPoint |
class | MBPointID |
class | MBPointInterpOp |
Mapped Multiblock Block Boundary Interpolation Operator. More... | |
class | MBProblemDomain |
Mapped Multi-Block Problem Domain. More... | |
class | memInfo |
class | Morton |
Morton Indexer. More... | |
struct | MotionItem |
class | NeighborIterator |
class | NullBC |
No Boundary Condition. More... | |
class | PeriodicBC |
Periodic Boundary Condition. More... | |
class | Point |
Integer Valued Vector. More... | |
class | ProblemDomain |
Represents a rectangular domain over which a problem can be defined, including periodic images. More... | |
class | Reduction |
struct | Register |
class | Shift |
Stencil Shift. More... | |
class | Side |
Side. More... | |
class | SideIterator |
Side Iterator. More... | |
class | Stack |
class | Stencil |
A Linear Stencil Operation. More... | |
class | traceInfo |
class | TraceTimer |
class | Var |
Pointwise Variable. More... | |
Typedefs | |
typedef Point | PatchID |
typedef DataIndex< BoxPartition > | LevelIndex |
typedef DataIterator< BoxPartition > | LevelIterator |
typedef MotionItem< BoxPartition, BoxPartition > | LevelMotionItem |
typedef AMRData< short, 1, MEMTYPE_DEFAULT, PR_CELL > | AMRTagData |
typedef LevelBoxData< short, 1, MEMTYPE_DEFAULT, PR_CELL > | LevelTagData |
typedef LevelBoxData< short, 1, MemType::HOST, PR_CELL > | LevelTagDataHost |
typedef BoxData< short, 1, MEMTYPE_DEFAULT > | TagData |
typedef BoxData< short, 1, MemType::HOST > | TagDataHost |
typedef std::tuple< Point, BlockIndex, int > | MBAMRPatchID_t |
Multiblock AMR Box Partition. More... | |
typedef MotionItem< MBBoxPartition, MBBoxPartition > | MBMotionItem |
typedef DataIndex< MBBoxPartition > | MBIndex |
typedef DataIterator< MBBoxPartition > | MBIterator |
typedef int | BlockIndex |
Defines what type is used for indexing block entities. More... | |
Enumerations | |
enum | BoxDataOp { Invalid = -1, Copy = 0, Add = 1, Assign, Subtract, Multiply, Divide, NUM_OP_TYPES } |
enum | Centering { PR_CELL = -1, PR_FACE_0 = 0, PR_FACE_1, PR_FACE_2, PR_FACE_3, PR_FACE_4, PR_FACE_5, PR_FACE_6, PR_NODE = 7, PR_FACE, PR_EDGE } |
enum | MotionType { LOCAL, FROM, TO } |
enum | MemType { INVALID =0, HOST =1, DEVICE =2, BOTH =3 } |
enum | Operation { Max, Min, Abs, Sum, SumAbs, SumSquare } |
enum | Atomic { Warp, Block, None } |
Functions | |
template<typename T , size_t N> | |
ACCEL_DECORATION Array< T, N > & | operator* (int scale, Array< T, N > &arr) |
Premultiplication by a scalar int. More... | |
template<typename T , size_t N> | |
ACCEL_DECORATION Array< T, N > & | operator* (double scale, Array< T, N > &arr) |
Premultiplication by a scalar double. More... | |
template<typename T , size_t N> | |
ACCEL_DECORATION Array< T, N > & | operator- (Array< T, N > &arr) |
Unary negation. More... | |
template<typename T , size_t N> | |
std::ostream & | operator<< (std::ostream &stream, const Array< T, N > &arr) |
Ostream operator. More... | |
std::ostream & | operator<< (std::ostream &a_os, const Box &a_box) |
OStream Operator. More... | |
std::istream & | operator>> (std::istream &a_is, Box &a_box) |
OStream Operator. More... | |
template<MemType MEM> | |
void | null_deleter_boxdata (void *ptr) |
template<typename T , unsigned int CL, unsigned int CR, MemType MEM, unsigned int DL, unsigned int DR, unsigned int E = 1> | |
BoxData< T, CL, MEM, DR, E > | matrixProduct (const BoxData< T, CL, MEM, DL, E > &A, const BoxData< T, CR, MEM, DR, E > &B, T scale=1.0) |
template<typename T , unsigned int CL, unsigned int CR, MemType MEM, unsigned int DL, unsigned int DR, unsigned int E = 1> | |
BoxData< T, DL, MEM, DR, E > | matrixProductLeftTranspose (const BoxData< T, CL, MEM, DL, E > &A, const BoxData< T, CR, MEM, DR, E > &B, T scale=1.0) |
template<typename T , unsigned int CL, unsigned int CR, MemType MEM, unsigned int DL, unsigned int DR, unsigned int E = 1> | |
BoxData< T, CL, MEM, CR, E > | matrixProductRightTranspose (const BoxData< T, CL, MEM, DL, E > &A, const BoxData< T, CR, MEM, DR, E > &B, T scale=1.0) |
std::ostream & | operator<< (std::ostream &a_os, const CInterval &a_int) |
CInterval IOStream Operator. More... | |
template<typename T , std::size_t... I> | |
auto | tupleFromVector (const std::vector< T > &v, std::index_sequence< I... >) |
template<typename T , std::size_t N> | |
auto | tupleFromVector (const std::vector< T > &v) |
CoordPermutation | operator* (const CoordPermutation &a_A, const CoordPermutation &a_B) |
std::ostream & | operator<< (std::ostream &os, const LevelIndex &a_dbl) |
std::ostream & | operator<< (std::ostream &os, const DisjointBoxLayout &a_dbl) |
Side::LoHiSide | flip (const Side::LoHiSide &a_side) |
Flip Side. More... | |
int | sign (const Side::LoHiSide &a_side) |
Sign. More... | |
template<typename T , unsigned int C, MemType MEM, unsigned int D, unsigned int E> | |
BoxData< T, C, MEM, D, E > & | operator+= (BoxData< T, C, MEM, D, E > &a_dst, const LazyInterpStencil< T, C, MEM, D, E > &&a_op) |
template<typename T , unsigned int C, MemType MEM, unsigned int D, unsigned int E> | |
BoxData< T, C, MEM, D, E > & | operator|= (BoxData< T, C, MEM, D, E > &a_dst, const LazyInterpStencil< T, C, MEM, D, E > &&a_op) |
template<typename T , unsigned int C, MemType MEM, Centering CTR> | |
void | interpBoundaries (LevelBoxData< T, C, MEM, CTR > &a_crse, LevelBoxData< T, C, MEM, CTR > &a_fine, InterpStencil< T > &a_interp) |
Interpolate Boundaries. More... | |
template<typename T , unsigned int C, MemType MEM, Centering CTR> | |
void | interpBoundaries (LevelBoxData< T, C, MEM, CTR > &a_crse, LevelBoxData< T, C, MEM, CTR > &a_fine, LevelBoxData< T, C, MEM, CTR > &a_crseFine, InterpStencil< T > &a_interp) |
Interpolate Boundaries. More... | |
template<typename T , unsigned int C, MemType MEM, Centering CTR> | |
void | averageDown (LevelBoxData< T, C, MEM, CTR > &a_crse, LevelBoxData< T, C, MEM, CTR > &a_fine, Point a_refRatio) |
Average Down. More... | |
template<typename T , unsigned int C, MemType MEM, Centering CTR> | |
void | averageDown (LevelBoxData< T, C, MEM, CTR > &a_crse, LevelBoxData< T, C, MEM, CTR > &a_fine, int a_refRatio) |
Average Down (Scalar Refinement Ratio) More... | |
template<typename T , unsigned int C, MemType MEM, Centering CTR> | |
void | averageDown (LevelBoxData< T, C, MEM, CTR > &a_crse, LevelBoxData< T, C, MEM, CTR > &a_fine, LevelBoxData< T, C, MEM, CTR > &a_crseFine, Point a_refRatio) |
Average Down. More... | |
template<typename T , unsigned int C, MemType MEM, Centering CTR> | |
void | averageDown (LevelBoxData< T, C, MEM, CTR > &a_crse, LevelBoxData< T, C, MEM, CTR > &a_fine, LevelBoxData< T, C, MEM, CTR > &a_crseFine, int a_refRatio) |
Average Down (Scalar Refinement Ratio) More... | |
template<typename T , MemType MEM> | |
PROTO_KERNEL_START void | f_proto_iotaF (Point &a_pt, Var< T, DIM, MEM > &a_X, Array< T, DIM > a_dx, Array< T, DIM > a_offset, int a_ctr) |
template<typename IN > | |
const IN & | parse_level_arg (LevelIndex &a_index, const IN &a_arg) |
template<typename T , unsigned int C, MemType MEM, Centering CTR> | |
const BoxData< T, C, MEM > & | parse_level_arg (LevelIndex &a_index, const LevelBoxData< T, C, MEM, CTR > &a_arg) |
template<int I = 0, typename Func , typename... LArgs, typename... FArgs> | |
std::enable_if< I==sizeof...(LArgs), void >::type | call_level_forall (Func &a_func, LevelIndex &a_index, std::tuple< LArgs... > a_args, FArgs &&... a_fargs) |
template<unsigned int P> | |
int | ipow (int M) |
Template Based Integer Exponentiation. More... | |
template<> | |
int | ipow< 0 > (int M) |
int | ipow (int a_base, unsigned int a_exp) |
int | factorial (int value) |
template<typename T > | |
T | taylor (int index) |
template<MemType SRC_MEM = MEMTYPE_DEFAULT, MemType DST_MEM = MEMTYPE_DEFAULT> | |
void | proto_memcpy (const void *a_src, void *a_dst, size_t a_nbytes) |
Copy Memory. More... | |
template<MemType MEM = MEMTYPE_DEFAULT> | |
void * | proto_malloc (size_t a_nbytes) |
Allocate Memory. More... | |
template<MemType MEM = MEMTYPE_DEFAULT> | |
void | proto_free (void *a_buffer) |
Free Memory. More... | |
MemType | pointerMemType (const void *a_ptr) |
Query Pointer MemType. More... | |
template<typename T > | |
constexpr T | proto_unallocated () |
std::string | parseMemType (MemType a_mem) |
std::ostream & | pr_out () |
Use this in place of std::cout for program output. More... | |
void | setPoutBaseName (const std::string &a_Name) |
Changes the base part of the filename for pr_out() files. More... | |
const std::string & | poutFileName () |
Accesses the filename for the local pr_out() file. More... | |
template<class T > | |
int | linearSize (const T &inputT) |
template<class T > | |
void | linearIn (T &a_outputT, const void *const inBuf) |
template<class T > | |
void | linearOut (void *const a_outBuf, const T &inputT) |
template<> | |
void | linearIn< std::vector< Point > > (std::vector< Point > &a_outputT, const void *const a_inBuf) |
template<> | |
void | linearOut< std::vector< Point > > (void *const a_outBuf, const std::vector< Point > &a_inputT) |
template<> | |
int | linearSize< std::vector< Point > > (const std::vector< Point > &a_input) |
std::ostream & | operator<< (std::ostream &os, const ProblemDomain &a_pd) |
Stream output for ProblemDomain. More... | |
template<typename T , Operation OP> | |
ACCEL_KERNEL void | initKernel (T *ptr) |
int | procID () |
Get Local Process ID. More... | |
int | PRprocID () |
unsigned int | numProc () |
Get Number of Ranks. More... | |
void | barrier () |
Parallel Barrier. More... | |
PROTO_KERNEL_START void | maxTagFcnF (Var< short, 1 > &a_tag, Var< short, 1 > &a_coarse) |
std::ostream & | operator<< (std::ostream &a_os, const MBDataPoint &a_point) |
std::ostream & | operator<< (std::ostream &os, const DataIndex< MBBoxPartition > &a_index) |
std::ostream & | operator<< (std::ostream &a_os, const MBIndex &a_di) |
template<typename MAP , typename T , unsigned int C, MemType MEM, Centering CTR> | |
void | interpBoundaries (MBLevelBoxData< T, C, MEM, CTR > &a_data, unsigned int a_order=4) |
template<typename MAP , typename T , unsigned int C, MemType MEM, Centering CTR> | |
void | interpBoundaries (MBLevelBoxData< T, C, MEM, CTR > &a_data, MBLevelMap< MAP, MEM > &a_map, unsigned int a_order=4) |
template<typename IN > | |
const IN & | parse_mb_level_arg (MBIndex &a_index, Centering C, const IN &a_arg) |
template<typename T , unsigned int C, MemType MEM, Centering CTR> | |
const BoxData< T, C, MEM > & | parse_mb_level_arg (MBIndex &a_index, Centering _CTR, const MBLevelBoxData< T, C, MEM, CTR > &a_arg) |
template<typename Func , typename MAP , MemType MEM> | |
const BoxData< double, DIM, MEM > | parse_mb_level_arg (MBIndex &a_index, Centering C, const MBLevelMap< MAP, MEM > &a_arg) |
template<int I = 0, typename Func , typename... LArgs, typename... FArgs> | |
std::enable_if< I==sizeof...(LArgs), void >::type | call_mb_level_forall (Func &a_func, MBIndex &a_index, Centering CTR, std::tuple< LArgs... > a_args, FArgs &&... a_fargs) |
exchange () | |
template<typename T , MemType MEM> | |
PROTO_KERNEL_START void | f_binomialPower_tmp (Var< T, 1, MEM > &a_xp, const Var< T, DIM, MEM > &a_x, Point a_p) |
MBPoint | operator+ (const MBPoint &mbpoint, const Point &p) |
MBPoint | operator+ (const Point &p, const MBPoint &mbpoint) |
MBPoint | operator+ (const MBPoint &p1, const MBPoint &p2) |
Alias and Slice Operators | |
The alias and slice operations facilitate BoxData operations while avoiding unnecessary copies. See the sample code below for an explanation of the syntax. Example Example | |
template<class T , unsigned int C = 1, unsigned int D = 1, unsigned int E = 1, MemType MEM = MEMTYPE_DEFAULT> | |
BoxData< T, C, MEM, D, E > | alias (BoxData< T, C, MEM, D, E > &a_original, const Point &a_shift=Point::Zeros()) |
Alias (Non-Const) More... | |
template<class T , unsigned int C = 1, unsigned int D = 1, unsigned int E = 1, MemType MEM = MEMTYPE_DEFAULT> | |
const BoxData< T, C, MEM, D, E > | alias (const BoxData< T, C, MEM, D, E > &a_original, const Point &a_shift=Point::Zeros()) |
Alias (Const) More... | |
template<typename T , unsigned int C, MemType MEM = MEMTYPE_DEFAULT, unsigned int D = 1, unsigned int E = 1> | |
BoxData< T, 1, MEM, 1, 1 > | slice (const BoxData< T, C, MEM, D, E > &a_src, unsigned int a_c, unsigned int a_d=0, unsigned int a_e=0) |
Slice Arbitrary Component (Non-Const) More... | |
template<typename T , unsigned int C, unsigned int CC, MemType MEM = MEMTYPE_DEFAULT> | |
BoxData< T, CC, MEM, 1, 1 > | slice (const BoxData< T, C, MEM, 1, 1 > &a_src, unsigned int a_startcomp) |
Vector Slice (Non-Const) More... | |
template<typename T , unsigned int C, unsigned int D, MemType MEM = MEMTYPE_DEFAULT> | |
BoxData< T, C, MEM, 1, 1 > | plane (const BoxData< T, C, MEM, D, 1 > &a_src, unsigned int a_d) |
Pointwise Operators | |
The suite of forall functions facilitate writing functions that operate pointwise on BoxData. To this end, the user must write a function with one of the following structures: PROTO_KERNEL_START void F_temp(Var<T,C,MEMTYPE,D,E>&, Args...) { ... } PROTO_KERNEL_END(F_temp, F) // OR PROTO_KERNEL_START void F_p_temp(Point&, Var<T,C,MEMTYPE,D,E>&, Args...) { ... } PROTO_KERNEL_END(F_p_temp, F_p)
Refer to the following code snippet for some sample valid forall input functions: | |
template<typename T , unsigned int C = 1, MemType MEMTYPE = MEMTYPE_DEFAULT, unsigned int D = 1, unsigned int E = 1, typename Func , typename... Srcs> | |
BoxData< T, C, MEMTYPE, D, E > | forall (const Func &a_F, Srcs &&... a_srcs) |
Pointwise Operator. More... | |
template<typename T , unsigned int C = 1, MemType MEMTYPE = MEMTYPE_DEFAULT, unsigned int D = 1, unsigned int E = 1, typename Func , typename... Srcs> | |
BoxData< T, C, MEMTYPE, D, E > | forallOp (unsigned long long int a_num_flops_point, const char *a_timername, const Func &a_F, Srcs &&... a_srcs) |
Pointwise Operator (Instrumented) More... | |
template<typename T , unsigned int C = 1, MemType MEMTYPE = MEMTYPE_DEFAULT, unsigned int D = 1, unsigned int E = 1, typename Func , typename... Srcs> | |
BoxData< T, C, MEMTYPE, D, E > | forall (const Func &a_F, Box a_box, Srcs &&... a_srcs) |
Pointwise Operator (Explicit Range Box) More... | |
template<typename T , unsigned int C = 1, MemType MEMTYPE = MEMTYPE_DEFAULT, unsigned int D = 1, unsigned int E = 1, typename Func , typename... Srcs> | |
BoxData< T, C, MEMTYPE, D, E > | forallOp (unsigned long long int a_num_flops_point, const char *a_timername, const Func &a_F, Box a_box, Srcs &&... a_srcs) |
Pointwise Operator (Explicit Range Box, Instrumented) More... | |
template<typename T , unsigned int C = 1, MemType MEMTYPE = MEMTYPE_DEFAULT, unsigned int D = 1, unsigned int E = 1, typename Func , typename... Srcs> | |
BoxData< T, C, MEMTYPE, D, E > | forall_p (const Func &a_F, Srcs &&... a_srcs) |
Pointwise Operator (Pointwise Dependence) More... | |
template<typename T , unsigned int C = 1, MemType MEMTYPE = MEMTYPE_DEFAULT, unsigned int D = 1, unsigned int E = 1, typename Func , typename... Srcs> | |
BoxData< T, C, MEMTYPE, D, E > | forall_p (const Func &a_F, Box a_box, Srcs &&... a_srcs) |
Pointwise Operator (Pointwise Dependence, Explicit Range Box) More... | |
template<typename Func , typename... Srcs> | |
void | forallInPlace (const Func &a_F, Srcs &&... a_srcs) |
In-Place Pointwise Operator. More... | |
template<typename Func , typename... Srcs> | |
void | forallInPlace (const Func &a_F, Box a_box, Srcs &&... a_srcs) |
In-Place Pointwise Operator (Explicit Range Box) More... | |
template<typename Func , typename... Srcs> | |
void | forallInPlace_p (const Func &a_F, Srcs &&... a_srcs) |
In-Place Pointwise Operator (Pointwise Dependence) More... | |
template<typename Func , typename... Srcs> | |
void | forallInPlace_p (const Func &a_F, Box a_box, Srcs &&... a_srcs) |
In-Place Pointwise Operator (Pointwise Dependence, Explicit Box Range) More... | |
External Operators | |
std::ostream & | operator<< (std::ostream &a_os, const Point &a_pt) |
Stream Operator. More... | |
std::istream & | operator>> (std::istream &a_os, Point &a_pt) |
Stream Operator. More... | |
Point | operator* (int a_scale, Point a_pt) |
Premultiplication by scalar. More... | |
Point | operator- (Point a_pt) |
Unary Negation. More... | |
Point | minPoint (Point a_p1, Point a_p2) |
Point | maxPoint (Point a_p1, Point a_p2) |
Point | absMaxPoint (Point a_p1, Point a_p2) |
Non-Member Functions | |
template<typename T > | |
Stencil< T > | operator* (T a_coef, Shift a_shift) |
Coefficient Shift Product "Constructor". More... | |
template<typename T > | |
Stencil< T > | operator* (T a_coef, const Stencil< T > a_stencil) |
Scalar Multiplication of Stencil Coefficients. More... | |
template<typename T > | |
Stencil< T > | operator- (Stencil< T > a_stencil) |
Stencil Unary Negation. More... | |
template<typename T , unsigned int C, MemType MEMTYPE, unsigned int D, unsigned int E> | |
BoxData< T, C, MEMTYPE, D, E > & | operator|= (BoxData< T, C, MEMTYPE, D, E > &a_dest, LazyStencil< T, C, MEMTYPE, D, E > &&a_op) |
Application by Replacement. More... | |
template<class T , unsigned int C, MemType MEMTYPE, unsigned int D, unsigned int E> | |
BoxData< T, C, MEMTYPE, D, E > & | operator+= (BoxData< T, C, MEMTYPE, D, E > &a_dest, LazyStencil< T, C, MEMTYPE, D, E > &&a_op) |
Application by Increment. More... | |
Variables | |
template<int I = 0, typename Func , typename... LArgs, typename... FArgs> | |
std::enable_if< I< sizeof...(LArgs), void >::typecall_level_forall(Func &a_func, LevelIndex &a_index, std::tuple< LArgs... > a_args, FArgs &&... a_fargs){ auto &arg=parse_level_arg(a_index, std::get< I >a_args));call_level_forall< I+1 >a_func, a_index, a_args, a_fargs..., arg);}template< typename T, unsigned int C, MemType MEM, Centering CTR >template< typename Func, typename... Srcs >void LevelBoxData< T, C, MEM, CTR >::initialize(Func &a_func, Srcs &... a_srcs){ PROTO_ASSERT(m_isDefined, "LevelBoxData::initialize | Error: Object not defined");auto srcs=std::tuple< Srcs &... >a_srcs...);for(auto iter :m_layout) { auto &patch=(*this)[iter];call_level_forall(a_func, iter, srcs, patch);}}template< typename T, unsigned int C, MemType MEM, Centering CTR >BoxLevelBoxData< T, C, MEM, CTR >::patchBox(const DataIndex< BoxPartition > &a_index) const { PROTO_ASSERT(m_isDefined, "LevelBoxData::patchBox | Error: Object not defined");PROTO_ASSERT(DIM<=6, "LevelBoxData::patchBox | Error: This function will fail for DIM > 6");Box B;if(CTR==PR_CELL) { B=layout()[a_index];} else if(CTR==PR_NODE) { B=layout()[a_index].extrude(Point::Ones());} else { int ctr=(int) CTR;B=layout()[a_index].extrude(Point::Basis(ctr, 1));} return B;}template< typename T, unsigned int C, MemType MEM, Centering CTR >unsigned intLevelBoxData< T, C, MEM, CTR >::patchSize() const { PROTO_ASSERT(m_isDefined, "LevelBoxData::patchSize | Error: Object not defined");int size=1;Point boxSize=layout().boxSize()+2 *ghost();switch(CTR) { case PR_NODE:boxSize+=Point::Ones();break;case PR_CELL:break;default:MayDay< void >::Abort("LevelBoxData::patchSize | Specified centering not implemented");} for(int ii=0;ii< DIM;ii++) { size *=boxSize[ii];} return C *size;}template< typename T, unsigned int C, MemType MEM, Centering CTR >unsigned intLevelBoxData< T, C, MEM, CTR >::offset(int a_proc) const { return layout().offset(a_proc) *patchSize();}template< typename T, unsigned int C, MemType MEM, Centering CTR >unsigned int LevelBoxData< T, C, MEM, CTR >::numBoxes() const { return m_layout.size();}template< typename T, unsigned int C, MemType MEM, Centering CTR >void LevelBoxData< T, C, MEM, CTR >::setToZero(int a_comp){ setVal(0, a_comp);}template< typename T, unsigned int C, MemType MEM, Centering CTR >void LevelBoxData< T, C, MEM, CTR >::setVal(T a_value, int a_comp){ PROTO_ASSERT(m_isDefined, "LevelBoxData::setVal | Error: Object not defined");PROTO_ASSERT((a_comp >=-1) &&(a_comp< DIM), "LevelBoxData::setVal | Error: %i is not a valid component specification.", a_comp);for(auto iter :m_layout) { auto &patch=(*this)[iter];if(a_comp==-1) { patch.setVal(a_value);} else { auto patch_i=slice(patch, a_comp);patch_i.setVal(a_value);} }}template< typename T, unsigned int C, MemType MEM, Centering CTR >void LevelBoxData< T, C, MEM, CTR >::setDomainBoundary(T a_value, int a_comp){ PROTO_ASSERT(m_isDefined, "LevelBoxData::setBoundary | Error: Object not defined");PROTO_ASSERT((a_comp >=-1) &&(a_comp< DIM), "LevelBoxData::setBoundary | Error: \%i is not a valid component specification.", a_comp);if(ghost()==Point::Zeros()){ return;} for(auto iter :m_layout) { if(!layout().onLevelBoundary(m_layout.point(iter))) { continue;} auto &patch=(*this)[iter];if(a_comp==-1) { BoxData< T, C, MEM > tmp(layout()[iter]);patch.copyTo(tmp);patch.setVal(a_value);tmp.copyTo(patch);} else { auto patch_i=slice(patch, a_comp);BoxData< T, 1, MEM > tmp(layout()[iter]);patch_i.copyTo(tmp);patch_i.setVal(a_value);tmp.copyTo(patch_i);} } exchange();}template< typename T, unsigned int C, MemType MEM, Centering CTR >void LevelBoxData< T, C, MEM, CTR >::setRandom(T a_low, T a_high){ for(auto iter :m_layout) { auto &patch=(*this)[iter];patch.setRandom(a_low, a_high);} exchange();}template< typename T, unsigned int C, MemType MEM, Centering CTR >void LevelBoxData< T, C, MEM, CTR >::exchange(){ PROTO_ASSERT(m_isDefined, "LevelBoxData::exchange | Error: Object not defined");if(m_ghost==Point::Zeros()) { return;} PR_TIME("LevelBoxData::exchange");PROTO_ASSERT(m_exchangeCopier !=nullptr, "LevelBoxData::exchange | Error: exchange copier is not defined");m_exchangeCopier-> | execute () |
constexpr int | line = 128 |
int | num_procs |
template<int I = 0, typename Func , typename... LArgs, typename... FArgs> | |
std::enable_if< I< sizeof...(LArgs), void >::typecall_mb_level_forall(Func &a_func, MBIndex &a_index, Centering CTR, std::tuple< LArgs... > a_args, FArgs &&... a_fargs){ auto &arg=parse_mb_level_arg(a_index, CTR, std::get< I >a_args));call_mb_level_forall< I+1 >a_func, a_index, CTR, a_args, a_fargs..., arg);}template< typename T, unsigned int C, MemType MEM, Centering CTR >template< typename Func, typename... Srcs >void MBLevelBoxData< T, C, MEM, CTR >::initialize(Func &a_func, Srcs &... a_srcs){ auto srcs=std::tuple< Srcs &... >a_srcs...);for(auto iter :(m_layout)) { auto &patch=(*this)[iter];auto block=layout().block(iter);call_mb_level_forall(a_func, iter, CTR, srcs, patch, block);} }template< typename T, unsigned int C, MemType MEM, Centering CTR >template< typename Func, typename... Srcs >void MBLevelBoxData< T, C, MEM, CTR >::initConvolve(Func &a_func, Srcs &... a_srcs){ auto g=ghost();g[0]=g[0]+Point::Ones();MBLevelBoxData< T, C, MEM, CTR > tmp(m_layout, g);tmp.initialize(a_func, a_srcs...);for(auto iter :m_layout) { auto &tmp_i=tmp[iter];auto &patch=(*this)[iter];Operator::convolve(patch, tmp_i);}}template< typename T, unsigned int C, MemType MEM, Centering CTR >void MBLevelBoxData< T, C, MEM, CTR >::setVal(T a_value){ for(auto data :m_data) { data-> | setVal (a_value) |
TraceTimer class is a self-tracing code instrumentation system
TraceTimer class is a self-tracing code instrumentation system for Chombo (or any other package really). The user interface is specified by a small set of macros. The usage model is that you just leave these timers in the code, for good. Initially, your application will have 'main' and a few hewavy functions instrumented, and the lower level Chombo library instrumentation. As your tool or application matures, it will garner a larger set of instrumentation giving clear views of your code performance. After a routine has been cleverly and lovingly optimized, you leave in the timers, to spot when some later bug fix or improvement undoes your previous labors.
The first macro is what people will use the most:
This is the simplest interface for timers. you place this macro call in a function you wish to be timed. It handles making the timer, calling 'start' when you enter the function, and calling 'stop' when you leave the function. A good idea is to use a 'label' specific enough to be unambiguous without being overwhelming. for instance:
In this case, we have a class with many constructors and define functions that all funnel into a single general function. We can just call this 'define' and not worry about naming/instrumenting all the different overloaded instances. If you slip up and use the same label twice, that is not a real problem, the two locations will be timed and tracked properly (even if one is a sibling or parent of the other). The only place it will make things a little harder is in the output where you might have the same name show up and look confusing.
In serial, you will see a file called time.table (in parallel, you will get a time.table.n (where n is the rank number) files). If you want fewer files, you can do setenv PR_OUTPUT_INTERVAL nproc and it will only output every nproc processors time.table.n files (where nnproc == 0). I won't go into this file format. It is kind of gprof-ish, with what I consider improvements. The real benefit here is profiling that understands our Chombo context, a smaller information set to observe, and the fact that, so far in my testing, the timers have negligible impact on the run time or memory use of the code.
By default, Chombo compiles in the instructions for the timers wherever the macros appear. If the compiler macro PR_NTIMER is defined, then all the PR_TIME* macros evaluate to empty expressions at compile time.
The next level up in complexity is the set of four macros for when you want sub-function resolution in your timers. For instance, in a really huge function that you have not figured out how to re-factor, or built with lots of bad cut n paste code 're-use'.
PR_TIMERS has the same semantic as PR_TIME, except that you can declare an arbitrary number of children after it in the same function scope. The children here do not autostart and autostop, you have to tell them where to start and stop timing. The children can themselves be parents for timers in called functions, of course. The children obey a set of mutual exclusions. The following generate run time errors:
the following will generate compile time errors:
You do not have to put any calls in your main routine to activate the clocks or generate a report at completion, this is handled with static iniitalization and an atexit function.
There is a larger argument of manual instrumentation being counter to good development. Profiling the code is supposed to tell you where to expend your optimization effort. Manual instrumentation opens the door to people wasting time assuming what parts of the code are going to take up lots of time and instrumenting them, before seeing any real performance data. Good judgement is needed. We have a body of knowledge about Chombo that will inform us about a good minimal first set of functions to instrument.
typedef Point Proto::PatchID |
typedef DataIndex<BoxPartition> Proto::LevelIndex |
typedef DataIterator<BoxPartition> Proto::LevelIterator |
typedef AMRData<short, 1, MEMTYPE_DEFAULT, PR_CELL> Proto::AMRTagData |
typedef LevelBoxData<short, 1, MEMTYPE_DEFAULT, PR_CELL> Proto::LevelTagData |
typedef LevelBoxData<short, 1, MemType::HOST, PR_CELL> Proto::LevelTagDataHost |
typedef BoxData<short, 1, MEMTYPE_DEFAULT> Proto::TagData |
typedef BoxData<short, 1, MemType::HOST> Proto::TagDataHost |
typedef std::tuple<Point, BlockIndex, int> Proto::MBAMRPatchID_t |
Multiblock AMR Box Partition.
typedef MotionItem< MBBoxPartition, MBBoxPartition > Proto::MBMotionItem |
typedef DataIndex<MBBoxPartition> Proto::MBIndex |
typedef DataIterator<MBBoxPartition> Proto::MBIterator |
typedef int Proto::BlockIndex |
Defines what type is used for indexing block entities.
enum Proto::BoxDataOp |
enum Proto::Centering |
enum Proto::MotionType |
enum Proto::MemType |
enum Proto::Operation |
enum Proto::Atomic |
|
inline |
Premultiplication by a scalar int.
Referenced by Proto::BoxData< T, C, MEM, D, E >::defined(), and Proto::Copier< FluxRegisterCopierOp< T, C, MEM >, BoxPartition, BoxPartition, MEM, MEM >::makeItSoLocal().
|
inline |
Premultiplication by a scalar double.
|
inline |
Unary negation.
Referenced by Proto::BoxData< T, C, MEM, D, E >::defined(), and Proto::Stencil< double >::operator!=().
|
inline |
Ostream operator.
Referenced by Proto::Point::unpack().
|
inline |
OStream Operator.
References Proto::Box::str().
|
inline |
OStream Operator.
References Proto::Box::Box(), Proto::Box::high(), and Proto::Box::low().
Referenced by Proto::Point::unpack().
|
inline |
|
inline |
auto Proto::tupleFromVector | ( | const std::vector< T > & | v, |
std::index_sequence< I... > | |||
) |
auto Proto::tupleFromVector | ( | const std::vector< T > & | v | ) |
References PROTO_ASSERT.
|
inline |
|
inline |
|
inline |
|
inline |
Flip Side.
Utility function for flipping between Side::Lo and Side::Hi
References Proto::Side::Hi, and Proto::Side::Lo.
|
inline |
|
inline |
Pointwise Operator.
Computes the function a_F
at each Point of this BoxData. This version of forall returns a new BoxData corresponding to the first argument of a_F
which must be a Var
. The domain of the created output is equal to the intersection of all other BoxData inputs (the function will fail if there are no other inputs). This function MUST specify the template parameters of the output BoxData. See the example code snippet below.
Example Usage: Input Function:
Calling forall:
a_F | Pointwise function |
a_srcs | Inputs (BoxData and primitive data) |
|
inline |
|
inline |
Pointwise Operator (Explicit Range Box)
Computes the function a_F
at each Point of this BoxData. This version of forall returns a new BoxData corresponding to the first argument of a_F
which must be a Var
. This function MUST specify the template parameters of the output BoxData. See the example code snippet below.
In general, this function should not be used unless absolutely necessary. Some valid use cases are:
a_box
must be a subset of the union of all input BoxData domains.Example Usage: Input Function:
Calling forall:
a_F | Pointwise function |
a_box | Range on which a_F will be evaluated |
a_srcs | Inputs (BoxData and primitive data) |
|
inline |
Pointwise Operator (Explicit Range Box, Instrumented)
Overload of the pointwise operator with additional instrumentation inputs
|
inline |
Pointwise Operator (Pointwise Dependence)
Computes the function a_F
at each Point of this BoxData. This version of forall allows the input function to be dependent on the Point at which it is applied. Hence, the first argument of a_F is a Point&, followed by the Var corresponding to the output BoxData. This function MUST specify the template parameters of the output BoxData. See the example code snippet below.
Example Usage: Input Function:
Calling forall:
a_F | Pointwise function |
a_srcs | Inputs (BoxData and primitive data) |
|
inline |
Pointwise Operator (Pointwise Dependence, Explicit Range Box)
Computes the function a_F
at each Point of this BoxData. This version of forall allows the input function to be dependent on the Point at which it is applied. Hence, the first argument of a_F is a Point&, followed by the Var corresponding to the output BoxData. This function MUST specify the template parameters of the output BoxData. See the example code snippet below.
In general, this function should not be used unless absolutely necessary. a_box
must be a subset of the union of all input BoxData domains.
Example Usage: Input Function:
Calling forall:
a_F | Pointwise function |
a_srcs | Inputs (BoxData and primitive data) |
a_box | Range on which a_F will be evaluated |
|
inline |
In-Place Pointwise Operator.
Computes the function a_F
at each Point of this BoxData. The "InPlace" versions of forall execute on existing BoxData and do not produce a new array. The range of the function evaluation is equal to the intersection of all BoxData inputs.
Example Usage: Input Function:
Calling forall:
a_F | Pointwise function |
a_srcs | Inputs (BoxData and primitive data) |
|
inline |
In-Place Pointwise Operator (Explicit Range Box)
Computes the function a_F
at each Point of this BoxData. The "InPlace" versions of forall execute on existing BoxData and do not produce a new array. a_F
will be applied at all points of the input a_box
.
In general, this function should not be used unless you want to restrict the range of a_F's application to be something smaller than the intersection of all the inputs. a_box
must be a subset of the union of all input BoxData domains.
Example Usage: Input Function:
Calling forall:
a_F | Pointwise function |
a_box | Range of computation. |
a_srcs | Inputs (BoxData and primitive data) |
|
inline |
In-Place Pointwise Operator (Pointwise Dependence)
Computes the function a_F
at each Point of this BoxData. This version of forall allows the input function to be dependent on the Point at which it is applied. Hence, the first argument of a_F
is a Point&
, followed by the normal Var
inputs
Example Usage: Input Function:
Calling forall:
a_F | Pointwise function |
a_srcs | Inputs (BoxData and primitive data) |
|
inline |
In-Place Pointwise Operator (Pointwise Dependence, Explicit Box Range)
Computes the function a_F
at each Point of this BoxData. This version of forall allows the input function to be dependent on the Point at which it is applied. Hence, the first argument of a_F
is a Point&
, followed by the normal Var
inputs
In general, this function should not be used unless you want to restrict the domain of a_F's application to be something smaller than the intersection of all the inputs. a_box
must be a subset of the union of all input BoxData domains.
Example Usage: Input Function:
Calling forall:
a_F | Pointwise function |
a_srcs | Inputs (BoxData and primitive data) |
a_box | Range of computation |
BoxData<T,C,MEM,D,E>& Proto::operator+= | ( | BoxData< T, C, MEM, D, E > & | a_dst, |
const LazyInterpStencil< T, C, MEM, D, E > && | a_op | ||
) |
BoxData<T,C,MEM,D,E>& Proto::operator|= | ( | BoxData< T, C, MEM, D, E > & | a_dst, |
const LazyInterpStencil< T, C, MEM, D, E > && | a_op | ||
) |
Referenced by operator-().
void Proto::interpBoundaries | ( | LevelBoxData< T, C, MEM, CTR > & | a_crse, |
LevelBoxData< T, C, MEM, CTR > & | a_fine, | ||
InterpStencil< T > & | a_interp | ||
) |
Interpolate Boundaries.
General utility function for interpolating data into coarse-fine boundaries. This version creates a temporary LevelBoxData representing the coarsened fine region.
void Proto::interpBoundaries | ( | LevelBoxData< T, C, MEM, CTR > & | a_crse, |
LevelBoxData< T, C, MEM, CTR > & | a_fine, | ||
LevelBoxData< T, C, MEM, CTR > & | a_crseFine, | ||
InterpStencil< T > & | a_interp | ||
) |
Interpolate Boundaries.
General utility function for interpolating data into coarse-fine boundaries. This version does not create any temporary LevelBoxData but requires an additional input dataholder representing the coarsened fine region.
void Proto::averageDown | ( | LevelBoxData< T, C, MEM, CTR > & | a_crse, |
LevelBoxData< T, C, MEM, CTR > & | a_fine, | ||
Point | a_refRatio | ||
) |
Average Down.
General utility function for averaging fine data onto coarse data
void Proto::averageDown | ( | LevelBoxData< T, C, MEM, CTR > & | a_crse, |
LevelBoxData< T, C, MEM, CTR > & | a_fine, | ||
int | a_refRatio | ||
) |
Average Down (Scalar Refinement Ratio)
General utility function for averaging fine data onto coarse data
void Proto::averageDown | ( | LevelBoxData< T, C, MEM, CTR > & | a_crse, |
LevelBoxData< T, C, MEM, CTR > & | a_fine, | ||
LevelBoxData< T, C, MEM, CTR > & | a_crseFine, | ||
Point | a_refRatio | ||
) |
Average Down.
General utility function for averaging fine data onto coarse data
void Proto::averageDown | ( | LevelBoxData< T, C, MEM, CTR > & | a_crse, |
LevelBoxData< T, C, MEM, CTR > & | a_fine, | ||
LevelBoxData< T, C, MEM, CTR > & | a_crseFine, | ||
int | a_refRatio | ||
) |
Average Down (Scalar Refinement Ratio)
General utility function for averaging fine data onto coarse data
PROTO_KERNEL_START void Proto::f_proto_iotaF | ( | Point & | a_pt, |
Var< T, DIM, MEM > & | a_X, | ||
Array< T, DIM > | a_dx, | ||
Array< T, DIM > | a_offset, | ||
int | a_ctr | ||
) |
const IN& Proto::parse_level_arg | ( | LevelIndex & | a_index, |
const IN & | a_arg | ||
) |
const BoxData<T,C,MEM>& Proto::parse_level_arg | ( | LevelIndex & | a_index, |
const LevelBoxData< T, C, MEM, CTR > & | a_arg | ||
) |
std::enable_if<I == sizeof...(LArgs), void>::type Proto::call_level_forall | ( | Func & | a_func, |
LevelIndex & | a_index, | ||
std::tuple< LArgs... > | a_args, | ||
FArgs &&... | a_fargs | ||
) |
|
inline |
Template Based Integer Exponentiation.
|
inline |
|
inline |
|
inline |
Referenced by taylor().
|
inline |
References factorial().
|
inline |
Copy Memory.
Executes a low level memory copy between buffers of the specified MemTypes. If both SRC_MEM and DST_MEM are HOST, this is equivalent to std::memcpy
. When at least one MemType is DEVICE, this function will call cudaMemcpy
or equivalent functions as appropriate.
SRC_MEM | MemType of the source buffer |
DST_MEM | MemType of the destination buffer |
a_src | Source buffer |
a_dst | Destination buffer |
a_nbytes | Number of bytes to copy |
|
inline |
Allocate Memory.
Returns a pointer to a region of allocated memory. If MEM==HOST
this function is equivalent to std::malloc
. If MEM==DEVICE
, this function will call cudaMalloc
or other equivalent functions as appropriate.
MEM | MemType of the desired buffer |
a_nbytes | Number of bytes to allocate |
|
inline |
Free Memory.
Frees a pointer previously allocated using proto_malloc
. If MEM==HOST
this function is equivalent to std::free
. If MEM==DEVICE
, this function will call cudaFree
or other equivalent functions as appropriate.
MEM | MemType of the buffer. |
a_buffer | A buffer. |
|
inline |
Query Pointer MemType.
This is an EXPERIMENTAL tool for checking the MemType of an arbitrary pointer. Initial testing suggests that this function can distinguish between HOST and DEVICE for cuda pointers. Untested with HIP. Use with healthy skepticism.
a_ptr | A pointer. |
|
inline |
References PR_UNALLOCATED_FLOAT.
|
inline |
Use this in place of std::cout for program output.
Replaces std::cout in most of the Chombo code. In serial this just returns std::cout. In parallel, this creates a separate file for each proc called <basename>.n where n is the procID and <basename> defaults to "pout" but can be set by calling setPoutBaseName(). Output is then directed to these files. This keeps the output from different processors from getting all jumbled up. If you want fewer files, you can do setenv CH_OUTPUT_INTERVAL nproc and it will only output every nproc processors pout.n files (where nnproc == 0).
Referenced by Proto::MBBoundaryData< T, C, MEM >::print().
|
inline |
Changes the base part of the filename for pr_out() files.
When in parallel, changes the base name of the pr_out() files. If pr_out() has already been called, it closes the current output file and opens a new one (unless the name is the same, in which case it does nothing). In serial, ignores the argument and does nothing.
|
inline |
Accesses the filename for the local pr_out() file.
Returns the name used for the local pr_out() file. In parallel this is "<pout_basename>.<procID>", where <pout_basename> defaults to "pout" and can be modified by calling setPoutBaseName(), and <procID> is the local proc number. In serial, this always returns the string "cout". It is an error (exit code 111) to call this in parallel before MPI_Initialize().
References Proto::Point::abs().
int Proto::linearSize | ( | const T & | inputT | ) |
void Proto::linearIn | ( | T & | a_outputT, |
const void *const | inBuf | ||
) |
Referenced by Proto::BoxData< T, C, MEM, D, E >::defined().
void Proto::linearOut | ( | void *const | a_outBuf, |
const T & | inputT | ||
) |
Referenced by Proto::BoxData< T, C, MEM, D, E >::defined().
void Proto::linearIn< std::vector< Point > > | ( | std::vector< Point > & | a_outputT, |
const void *const | a_inBuf | ||
) |
void Proto::linearOut< std::vector< Point > > | ( | void *const | a_outBuf, |
const std::vector< Point > & | a_inputT | ||
) |
int Proto::linearSize< std::vector< Point > > | ( | const std::vector< Point > & | a_input | ) |
|
inline |
Stream output for ProblemDomain.
ACCEL_KERNEL void Proto::initKernel | ( | T * | ptr | ) |
|
inline |
Get Local Process ID.
Returns the ID of the locally running process in the range 0 <= procID() < numProc(). This has no relation to the operating system pid. There is always a procID() == 0.
Referenced by Proto::memInfo< MEMTYPE >::getMemInfo(), Proto::DataIndex< BoxPartition >::local(), Proto::LevelBoxData< T, C, SRC_MEM, CTR >::offset(), Proto::DisjointBoxLayout::offset(), Proto::memInfo< MEMTYPE >::printInfo(), and PRprocID().
|
inline |
References procID().
|
inline |
Get Number of Ranks.
Returns the number of parallel processes running. Always returns at least 1.
Referenced by Proto::memInfo< MEMTYPE >::getMemInfo(), and Proto::memInfo< MEMTYPE >::printInfo().
|
inline |
Parallel Barrier.
All MPI ranks wait here to sync-up. Calls MPI_Barrier(comm). This is a no-op in the non-MPI/serial case.
|
inline |
|
inline |
std::ostream& Proto::operator<< | ( | std::ostream & | a_os, |
const MBIndex & | a_di | ||
) |
|
inline |
|
inline |
const IN& Proto::parse_mb_level_arg | ( | MBIndex & | a_index, |
Centering | C, | ||
const IN & | a_arg | ||
) |
const BoxData<T,C,MEM>& Proto::parse_mb_level_arg | ( | MBIndex & | a_index, |
Centering | _CTR, | ||
const MBLevelBoxData< T, C, MEM, CTR > & | a_arg | ||
) |
const BoxData<double,DIM,MEM> Proto::parse_mb_level_arg | ( | MBIndex & | a_index, |
Centering | C, | ||
const MBLevelMap< MAP, MEM > & | a_arg | ||
) |
std::enable_if<I == sizeof...(LArgs), void>::type Proto::call_mb_level_forall | ( | Func & | a_func, |
MBIndex & | a_index, | ||
Centering | CTR, | ||
std::tuple< LArgs... > | a_args, | ||
FArgs &&... | a_fargs | ||
) |
Proto::exchange | ( | ) |
PROTO_KERNEL_START void Proto::f_binomialPower_tmp | ( | Var< T, 1, MEM > & | a_xp, |
const Var< T, DIM, MEM > & | a_x, | ||
Point | a_p | ||
) |
References Proto::MBPoint::block, Proto::MBPoint::MBPoint(), and Proto::MBPoint::point.
Referenced by Proto::BoxData< T, C, MEM, D, E >::defined(), and Proto::Stencil< double >::operator!=().
std::enable_if<I < sizeof...(LArgs), void>::typecall_level_forall(Func& a_func, LevelIndex& a_index, std::tuple<LArgs...> a_args, FArgs&&... a_fargs){ auto& arg = parse_level_arg(a_index, std::get<I>a_args)); call_level_forall<I+1>a_func, a_index, a_args, a_fargs..., arg);}template<typename T, unsigned int C, MemType MEM, Centering CTR>template<typename Func, typename... Srcs>void LevelBoxData<T, C, MEM, CTR>::initialize(Func& a_func, Srcs&... a_srcs){ PROTO_ASSERT(m_isDefined, "LevelBoxData::initialize | Error: Object not defined"); auto srcs = std::tuple<Srcs&...>a_srcs...); for (auto iter : m_layout) { auto& patch = (*this)[iter]; call_level_forall(a_func, iter, srcs, patch); }}template<typename T, unsigned int C, MemType MEM, Centering CTR>BoxLevelBoxData<T, C, MEM, CTR>::patchBox(const DataIndex<BoxPartition>& a_index) const{ PROTO_ASSERT(m_isDefined, "LevelBoxData::patchBox | Error: Object not defined"); PROTO_ASSERT(DIM <= 6, "LevelBoxData::patchBox | Error: This function will fail for DIM > 6"); Box B; if (CTR == PR_CELL) { B = layout()[a_index]; } else if (CTR == PR_NODE) { B = layout()[a_index].extrude(Point::Ones()); } else { int ctr = (int)CTR; B = layout()[a_index].extrude(Point::Basis(ctr,1)); } return B;}template<typename T, unsigned int C, MemType MEM, Centering CTR>unsigned intLevelBoxData<T, C, MEM, CTR>::patchSize() const{ PROTO_ASSERT(m_isDefined, "LevelBoxData::patchSize | Error: Object not defined"); int size = 1; Point boxSize = layout().boxSize() + 2*ghost(); switch (CTR) { case PR_NODE: boxSize += Point::Ones(); break; case PR_CELL: break; default: MayDay<void>::Abort("LevelBoxData::patchSize | Specified centering not implemented"); } for (int ii = 0; ii < DIM; ii++) { size *= boxSize[ii]; } return C*size;}template<typename T, unsigned int C, MemType MEM, Centering CTR>unsigned intLevelBoxData<T, C, MEM, CTR>::offset(int a_proc) const{ return layout().offset(a_proc)*patchSize();}template<typename T, unsigned int C, MemType MEM, Centering CTR>unsigned int LevelBoxData<T, C, MEM, CTR>::numBoxes() const{ return m_layout.size();}template<typename T, unsigned int C, MemType MEM, Centering CTR>void LevelBoxData<T, C, MEM, CTR>::setToZero(int a_comp){ setVal(0, a_comp);}template<typename T, unsigned int C, MemType MEM, Centering CTR>void LevelBoxData<T, C, MEM, CTR>::setVal(T a_value, int a_comp){ PROTO_ASSERT(m_isDefined, "LevelBoxData::setVal | Error: Object not defined"); PROTO_ASSERT((a_comp >= -1) && (a_comp < DIM), "LevelBoxData::setVal | Error: %i is not a valid component specification.", a_comp); for (auto iter : m_layout) { auto& patch = (*this)[iter]; if (a_comp == -1) { patch.setVal(a_value); } else { auto patch_i = slice(patch, a_comp); patch_i.setVal(a_value); } }}template<typename T, unsigned int C, MemType MEM, Centering CTR>void LevelBoxData<T, C, MEM, CTR>::setDomainBoundary(T a_value, int a_comp){ PROTO_ASSERT(m_isDefined, "LevelBoxData::setBoundary | Error: Object not defined"); PROTO_ASSERT((a_comp >= -1) && (a_comp < DIM), "LevelBoxData::setBoundary | Error: \ %i is not a valid component specification.", a_comp); if (ghost() == Point::Zeros()){ return; } for (auto iter : m_layout) { if (!layout().onLevelBoundary(m_layout.point(iter))) { continue; } auto& patch = (*this)[iter]; if (a_comp == -1) { BoxData<T, C, MEM> tmp(layout()[iter]); patch.copyTo(tmp); patch.setVal(a_value); tmp.copyTo(patch); } else { auto patch_i = slice(patch, a_comp); BoxData<T, 1, MEM> tmp(layout()[iter]); patch_i.copyTo(tmp); patch_i.setVal(a_value); tmp.copyTo(patch_i); } } exchange();}template<typename T, unsigned int C, MemType MEM, Centering CTR>void LevelBoxData<T, C, MEM, CTR>::setRandom(T a_low, T a_high){ for (auto iter : m_layout) { auto& patch = (*this)[iter]; patch.setRandom(a_low, a_high); } exchange();}template<typename T, unsigned int C, MemType MEM, Centering CTR>void LevelBoxData<T, C, MEM, CTR>::exchange(){ PROTO_ASSERT(m_isDefined, "LevelBoxData::exchange | Error: Object not defined"); if (m_ghost == Point::Zeros()) { return; } PR_TIME("LevelBoxData::exchange"); PROTO_ASSERT(m_exchangeCopier != nullptr, "LevelBoxData::exchange | Error: exchange copier is not defined"); m_exchangeCopier-> Proto::execute() |
constexpr int Proto::line = 128 |
Referenced by Proto::memInfo< MEMTYPE >::printInfo().
int Proto::num_procs |
std::enable_if<I < sizeof...(LArgs), void>::typecall_mb_level_forall(Func& a_func, MBIndex& a_index, Centering CTR, std::tuple<LArgs...> a_args, FArgs&&... a_fargs){ auto& arg = parse_mb_level_arg(a_index, CTR, std::get<I>a_args)); call_mb_level_forall<I+1>a_func, a_index, CTR, a_args, a_fargs..., arg);}template <typename T, unsigned int C, MemType MEM, Centering CTR>template <typename Func, typename... Srcs>void MBLevelBoxData<T, C, MEM, CTR>::initialize(Func &a_func, Srcs&... a_srcs){ auto srcs = std::tuple<Srcs&...>a_srcs...); for (auto iter : (m_layout)) { auto& patch = (*this)[iter]; auto block = layout().block(iter); call_mb_level_forall(a_func, iter, CTR, srcs, patch, block); } }template <typename T, unsigned int C, MemType MEM, Centering CTR>template <typename Func, typename... Srcs>void MBLevelBoxData<T, C, MEM, CTR>::initConvolve(Func &a_func, Srcs&... a_srcs){ auto g = ghost(); g[0] = g[0] + Point::Ones(); MBLevelBoxData<T, C, MEM, CTR> tmp(m_layout, g); tmp.initialize(a_func, a_srcs...); for (auto iter : m_layout) { auto& tmp_i = tmp[iter]; auto& patch = (*this)[iter]; Operator::convolve(patch, tmp_i); }}template <typename T, unsigned int C, MemType MEM, Centering CTR>void MBLevelBoxData<T, C, MEM, CTR>::setVal(T a_value){ for (auto data : m_data) { data-> Proto::setVal(a_value) |
Referenced by Proto::BoxData< T, C, MEM, D, E >::defined().