Loading...
Searching...
No Matches
pot::OracleBatchLayout Struct Reference

How a step's oracle points are shared out. More...

#include <gpr/potentials/OracleBatch.h>

Static Public Member Functions

static OracleBatchLayout world (Eigen::Index chunk=0, int owner_offset=0)
 The layout of the running communicator (rank 0 of 1 without MPI).

Public Attributes

int rank = 0
int nprocs = 1
Eigen::Index chunk = 0
int owner_offset = 0
OracleBatchComm comm = oracleBatchWorld()

Detailed Description

How a step's oracle points are shared out.

Definition at line 46 of file OracleBatch.h.

Member Function Documentation

◆ world()

OracleBatchLayout pot::OracleBatchLayout::world ( Eigen::Index chunk = 0,
int owner_offset = 0 )
static

The layout of the running communicator (rank 0 of 1 without MPI).

Definition at line 43 of file OracleBatch.cpp.

44{
45 OracleBatchLayout layout;
46 layout.chunk = chunk < 0 ? 0 : chunk;
47 layout.owner_offset = owner_offset;
48#ifdef GPR_HAVE_MPI
49 if (mpiRunning()) {
50 MPI_Comm_rank(layout.comm, &layout.rank);
51 MPI_Comm_size(layout.comm, &layout.nprocs);
52 }
53#endif
54 return layout;
55}

Member Data Documentation

◆ chunk

Eigen::Index pot::OracleBatchLayout::chunk = 0

0: point i belongs to rank (i + owner_offset) % nprocs and every point a rank owns forms one batch call. An engine that loops over its batch then gives the same values at every layout. K > 0: contiguous chunks of K points, chunk c owned by rank (c + owner_offset) % nprocs, one batch call per chunk. An engine whose batched forward depends on the batch composition (a UMA band package traced at a fixed batch size) then sees the same chunks at every layout once K is that batch size.

Definition at line 57 of file OracleBatch.h.

◆ comm

OracleBatchComm pot::OracleBatchLayout::comm = oracleBatchWorld()

Definition at line 62 of file OracleBatch.h.

◆ nprocs

int pot::OracleBatchLayout::nprocs = 1

Definition at line 48 of file OracleBatch.h.

◆ owner_offset

int pot::OracleBatchLayout::owner_offset = 0

Rotation of the owner map, applied when more than one point is shared out. A lone point always sits on the root, so the root's engine instance stays the warm one for the common single call.

Definition at line 61 of file OracleBatch.h.

◆ rank

int pot::OracleBatchLayout::rank = 0

Definition at line 47 of file OracleBatch.h.


The documentation for this struct was generated from the following files: