7 #include "PmeSolver.decl.h" 19 virtual int procNum(
int,
const CkArrayIndex& idx) {
24 if ( ! msg )
NAMD_bug(
"PmePencilXYZMap::populateInitial, multiple pencils on a pe?");
25 mgr->insertInitial(CkArrayIndex1D(0), msg);
29 if (msg != NULL) CkFreeMsg(msg);
37 PmePencilXMap(
int ia,
int ib,
int width,
const std::vector<int>& pes) : ia(ia), ib(ib), width(width), pes(pes) {}
41 virtual int procNum(
int,
const CkArrayIndex& idx) {
42 int ind = idx.data()[ia] + idx.data()[ib] * width;
43 if (ind < 0 || ind >= pes.size())
44 NAMD_bug(
"PmePencilXMap::procNum, index out of bounds");
48 for (
int i=0;i < pes.size();i++) {
49 if (pes[i] == CkMyPe()) {
50 if ( msg == NULL )
NAMD_bug(
"PmePencilXMap::populateInitial, multiple pencils on a pe?");
51 CkArrayIndex3D ai(0,0,0);
52 ai.data()[ib] = i / width;
53 ai.data()[ia] = i % width;
55 if (
procNum(0,ai) != CkMyPe() )
NAMD_bug(
"PmePencilXMap::populateInitial, map is inconsistent");
56 mgr->insertInitial(ai,msg);
61 if (msg != NULL) CkFreeMsg(msg);
69 const std::vector<int> pes;
78 virtual int procNum(
int,
const CkArrayIndex& idx) {
79 int ind = idx.data()[2];
80 if (ind < 0 || ind >= pes.size())
81 NAMD_bug(
"PmePencilXYMap::procNum, index out of bounds");
85 for (
int i=0;i < pes.size();i++) {
86 if (pes[i] == CkMyPe()) {
87 if ( msg == NULL )
NAMD_bug(
"PmePencilXYMap::populateInitial, multiple pencils on a pe?");
88 CkArrayIndex3D ai(0,0,0);
90 if (
procNum(0,ai) != CkMyPe() )
NAMD_bug(
"PmePencilXYMap::populateInitial, map is inconsistent");
91 mgr->insertInitial(ai, msg);
96 if (msg != NULL) CkFreeMsg(msg);
100 const std::vector<int> pes;
139 PmePencilXYZ_SDAG_CODE
165 #ifdef NODEGROUP_FORCE_REGISTER 174 PmePencilXY_SDAG_CODE
193 virtual void forwardDone();
194 virtual void backwardDone();
196 virtual void start(
const CkCallback &);
221 virtual void forwardDone();
222 virtual void backwardDone();
224 virtual void start(
const CkCallback &);
249 virtual void forwardDone();
250 virtual void backwardDone();
253 virtual void start(
const CkCallback &);
283 virtual void backwardDone();
285 virtual void start(
const CkCallback &);
288 #ifdef NODEGROUP_FORCE_REGISTER 299 #endif // PMESOLVER_H
std::array< PmeKSpaceCompute *, NUM_GRID_MAX > pmeKSpaceComputes
PmePencilXYMap(const std::vector< int > &pes)
std::vector< int > blockSizes
int registerArray(CkArrayIndex &numElements, CkArrayID aid)
virtual int procNum(int, const CkArrayIndex &idx)
virtual void backwardDone()
int registerArray(CkArrayIndex &numElements, CkArrayID aid)
std::array< FFTCompute *, NUM_GRID_MAX > fftComputes
void submitReductions(unsigned int iGrid)
std::array< PmeTranspose *, NUM_GRID_MAX > pmeTransposes
virtual void populateInitial(int, CkArrayOptions &, void *msg, CkArrMgr *mgr)
PmePencilX_SDAG_CODE PmePencilX()
std::vector< int > blockSizes
std::vector< int > blockSizes
std::array< PmeTranspose *, NUM_GRID_MAX > pmeTransposes
std::array< FFTCompute *, NUM_GRID_MAX > fftComputes
std::array< int, NUM_GRID_MAX > dataSizes
std::array< float *, NUM_GRID_MAX > dataGrid
std::array< int, NUM_GRID_MAX > energyReady
PmePencilXMap(int ia, int ib, int width, const std::vector< int > &pes)
virtual int procNum(int, const CkArrayIndex &idx)
std::array< PmeKSpaceCompute *, NUM_GRID_MAX > pmeKSpaceComputes
void NAMD_bug(const char *err_msg)
PmePencilXY_SDAG_CODE PmePencilXY()
virtual int procNum(int, const CkArrayIndex &idx)
std::vector< int > blockSizes
PmePencilXYZ_SDAG_CODE PmePencilXYZ()
std::array< PmeTranspose *, NUM_GRID_MAX > pmeTransposes
std::array< int, NUM_GRID_MAX > energyReady
PmePencilZ_SDAG_CODE PmePencilZ()
int registerArray(CkArrayIndex &numElements, CkArrayID aid)
std::array< FFTCompute *, NUM_GRID_MAX > fftComputes
std::array< FFTCompute *, NUM_GRID_MAX > fftComputes
std::array< PmeTranspose *, NUM_GRID_MAX > pmeTransposes
void submitReductions(unsigned int iGrid)
virtual void populateInitial(int, CkArrayOptions &, void *msg, CkArrMgr *mgr)
std::array< FFTCompute *, NUM_GRID_MAX > fftComputes
std::array< bool, NUM_GRID_MAX > enabledGrid
virtual void populateInitial(int, CkArrayOptions &, void *msg, CkArrMgr *mgr)
PmePencilY_SDAG_CODE PmePencilY()