NAMD
Public Member Functions | List of all members
PmePencilMap Class Reference
Inheritance diagram for PmePencilMap:

Public Member Functions

 PmePencilMap (int i_a, int i_b, int n_b, int n, int *d)
 
virtual int registerArray (CkArrayIndexMax &, CkArrayID)
 
virtual int procNum (int, const CkArrayIndex &i)
 
virtual void populateInitial (int, CkArrayIndexMax &, void *msg, CkArrMgr *mgr)
 

Detailed Description

Definition at line 170 of file ComputePme.C.

Constructor & Destructor Documentation

PmePencilMap::PmePencilMap ( int  i_a,
int  i_b,
int  n_b,
int  n,
int *  d 
)
inline

Definition at line 172 of file ComputePme.C.

173  : ia(i_a), ib(i_b), nb(n_b),
174  size(n), data(newcopyint(n,d)) {
175  }

Member Function Documentation

virtual void PmePencilMap::populateInitial ( int  ,
CkArrayIndexMax &  ,
void msg,
CkArrMgr *  mgr 
)
inlinevirtual

Definition at line 184 of file ComputePme.C.

References NAMD_bug().

184  {
185  int mype = CkMyPe();
186  for ( int i=0; i < size; ++i ) {
187  if ( data[i] == mype ) {
188  CkArrayIndex3D ai(0,0,0);
189  ai.data()[ia] = i / nb;
190  ai.data()[ib] = i % nb;
191  if ( procNum(0,ai) != mype ) NAMD_bug("PmePencilMap is inconsistent");
192  if ( ! msg ) NAMD_bug("PmePencilMap multiple pencils on a pe?");
193  mgr->insertInitial(ai,msg);
194  msg = 0;
195  }
196  }
197  mgr->doneInserting();
198  if ( msg ) CkFreeMsg(msg);
199  }
void NAMD_bug(const char *err_msg)
Definition: common.C:123
virtual int procNum(int, const CkArrayIndex &i)
Definition: ComputePme.C:180
virtual int PmePencilMap::procNum ( int  ,
const CkArrayIndex &  i 
)
inlinevirtual

Definition at line 180 of file ComputePme.C.

180  {
181  //Return the home processor number for this element of this array
182  return data[ i.data()[ia] * nb + i.data()[ib] ];
183  }
virtual int PmePencilMap::registerArray ( CkArrayIndexMax &  ,
CkArrayID   
)
inlinevirtual

Definition at line 176 of file ComputePme.C.

176  {
177  //Return an ``arrayHdl'', given some information about the array
178  return 0;
179  }

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