NAMD
Public Member Functions | List of all members
PmePencilXMap Class Reference

#include <PmeSolver.h>

Inheritance diagram for PmePencilXMap:

Public Member Functions

 PmePencilXMap (int ia, int ib, int width, const std::vector< int > &pes)
 
int registerArray (CkArrayIndex &numElements, CkArrayID aid)
 
virtual int procNum (int, const CkArrayIndex &idx)
 
virtual void populateInitial (int, CkArrayOptions &, void *msg, CkArrMgr *mgr)
 

Detailed Description

Definition at line 33 of file PmeSolver.h.

Constructor & Destructor Documentation

PmePencilXMap::PmePencilXMap ( int  ia,
int  ib,
int  width,
const std::vector< int > &  pes 
)
inline

Definition at line 35 of file PmeSolver.h.

35 : ia(ia), ib(ib), width(width), pes(pes) {}

Member Function Documentation

virtual void PmePencilXMap::populateInitial ( int  ,
CkArrayOptions &  ,
void msg,
CkArrMgr *  mgr 
)
inlinevirtual

Definition at line 45 of file PmeSolver.h.

References NAMD_bug(), and procNum().

45  {
46  for (int i=0;i < pes.size();i++) {
47  if (pes[i] == CkMyPe()) {
48  if ( msg == NULL ) NAMD_bug("PmePencilXMap::populateInitial, multiple pencils on a pe?");
49  CkArrayIndex3D ai(0,0,0);
50  ai.data()[ib] = i / width;
51  ai.data()[ia] = i % width;
52  //fprintf(stderr, "Pe %d i %d at %d %d\n", pes[i], i, ai.data()[ia], ai.data()[ib]);
53  if ( procNum(0,ai) != CkMyPe() ) NAMD_bug("PmePencilXMap::populateInitial, map is inconsistent");
54  mgr->insertInitial(ai,msg);
55  msg = NULL;
56  }
57  }
58  mgr->doneInserting();
59  if (msg != NULL) CkFreeMsg(msg);
60  }
virtual int procNum(int, const CkArrayIndex &idx)
Definition: PmeSolver.h:39
void NAMD_bug(const char *err_msg)
Definition: common.C:123
virtual int PmePencilXMap::procNum ( int  ,
const CkArrayIndex &  idx 
)
inlinevirtual

Definition at line 39 of file PmeSolver.h.

References NAMD_bug().

Referenced by populateInitial().

39  {
40  int ind = idx.data()[ia] + idx.data()[ib] * width;
41  if (ind < 0 || ind >= pes.size())
42  NAMD_bug("PmePencilXMap::procNum, index out of bounds");
43  return pes[ind];
44  }
void NAMD_bug(const char *err_msg)
Definition: common.C:123
int PmePencilXMap::registerArray ( CkArrayIndex &  numElements,
CkArrayID  aid 
)
inline

Definition at line 36 of file PmeSolver.h.

36  {
37  return 0;
38  }

The documentation for this class was generated from the following file: