OpenAtom  Version1.5a
pcMaps.h
1 #include "debug_flags.h"
2 #include "pcMaps.decl.h"
3 #include "charm++.h"
4 
5 #ifndef PC_MAPS_H
6 #define PC_MAPS_H
7 /*
8  * @addtogroup mapping
9  * @{
10  */
11 
12 /// Paircalc's map group that provides procNum() to place paircalc chares as determined by the map logic
13 class SCalcMap : public CkArrayMap
14 {
15  private:
16  MapType4 maptable;
17 
18  public:
19  SCalcMap(const MapType4 _mtable): maptable(_mtable) { }
20 
21  void pup(PUP::er &p)
22  {
23  CkArrayMap::pup(p);
24  p|maptable;
25  }
26 
27  inline int procNum(int, const CkArrayIndex &iIndex)
28  {
29  int proc;
30  short *sindex=(short *) iIndex.data();
31  proc = maptable.get(sindex[0], sindex[1], sindex[2], sindex[3]);
32  CkAssert(proc>=0);
33  if(numPes!=CkNumPes())
34  return(proc%CkNumPes());
35  else
36  return(proc);
37  }
38 
39  /// Let local code access the paircalc maptable I store. (for use by Ortho mapping code)
40  MapType4* getMapTable() { return &maptable; }
41 };
42 /*@}*/
43 #endif // PC_MAPS_H
44 
Paircalc's map group that provides procNum() to place paircalc chares as determined by the map logic...
Definition: pcMaps.h:13
int procNum(int, const CkArrayIndex &iIndex)
this one uses a lookup table built by calling the slow version
Definition: pcMaps.h:27
Definition: IntMap.h:26
MapType4 * getMapTable()
Let local code access the paircalc maptable I store. (for use by Ortho mapping code) ...
Definition: pcMaps.h:40
Useful debugging flags.