NAMD
Public Member Functions | Public Attributes | List of all members
MsmGridCutoff Class Reference
Inheritance diagram for MsmGridCutoff:
MsmGridCutoffKernel< Float, Float >

Public Member Functions

 MsmGridCutoff ()
 
 MsmGridCutoff (CkMigrateMessage *m)
 
void init ()
 
void setup (MsmGridCutoffInitMsg *bmsg)
 
void setupSections (MsmGridCutoffSetupMsg *msg)
 
void compute (GridMsg *gmsg)
 
- Public Member Functions inherited from MsmGridCutoffKernel< Float, Float >
 MsmGridCutoffKernel ()
 
void init ()
 
void setup (MsmGridCutoffInitMsg *bmsg)
 
void setupWeights (const msm::Grid< Float > *ptrgc, const msm::Grid< Float > *ptrgvc)
 
void compute (GridMsg *gmsg)
 

Public Attributes

CProxyElement_MsmBlock msmBlockElementProxy
 
CkSectionInfo cookie
 
msm::Grid< Floatehfull
 
- Public Attributes inherited from MsmGridCutoffKernel< Float, Float >
ComputeMsmMgrmgrLocal
 
msm::Mapmap
 
msm::BlockIndex qhblockIndex
 
msm::BlockSend ehblockSend
 
int eia
 
int eib
 
int eja
 
int ejb
 
int eka
 
int ekb
 
int eni
 
int enj
 
int enk
 
int isfold
 
msm::Grid< Floatqh
 
msm::Grid< Floateh
 
msm::Grid< Floatehfold
 
const msm::Grid< Float > * pgc
 
const msm::Grid< Float > * pgvc
 
int priority
 
int sequence
 

Detailed Description

Definition at line 2193 of file ComputeMsm.C.

Constructor & Destructor Documentation

◆ MsmGridCutoff() [1/2]

MsmGridCutoff::MsmGridCutoff ( )
inline

Definition at line 2204 of file ComputeMsm.C.

2204 { }

◆ MsmGridCutoff() [2/2]

MsmGridCutoff::MsmGridCutoff ( CkMigrateMessage *  m)
inline

Definition at line 2206 of file ComputeMsm.C.

2208  { }

Member Function Documentation

◆ compute()

void MsmGridCutoff::compute ( GridMsg gmsg)
inline

Definition at line 2273 of file ComputeMsm.C.

References msm::Array< T >::buffer(), MsmTimer::COMM, MsmGridCutoffKernel< Vtype, Mtype >::compute(), cookie, msm::Grid< T >::data(), MsmGridCutoffKernel< Float, Float >::eh, MsmGridCutoffKernel< Float, Float >::ehblockSend, ehfull, msm::Ivec::i, msm::Ivec::j, msm::Ivec::k, msm::Array< T >::len(), msm::BlockIndex::level, MsmGridCutoffKernel< Float, Float >::mgrLocal, ComputeMsmMgr::msmBlock, msmBlockElementProxy, msm::BlockIndex::n, msm::BlockSend::nblock_wrap, msm::IndexRange::nn(), MsmGridCutoffKernel< Float, Float >::priority, GridMsg::put(), msm::Grid< T >::reset(), MsmGridCutoffKernel< Float, Float >::sequence, and SET_PRIORITY.

2273  {
2274 #ifdef DEBUG_MSM_GRID
2275  printf("MsmGridCutoff %d: compute()\n", thisIndex);
2276 #endif
2277  // base class consumes this grid message
2279 
2280 #ifdef MSM_TIMING
2281  double startTime, stopTime;
2282  startTime = CkWallTimer();
2283 #endif
2284 #ifdef MSM_REDUCE_GRID
2285 
2286  // perform section reduction over potential grids
2287  CProxy_CkMulticastMgr mcastProxy =
2288  CkpvAccess(BOCclass_group).multicastMgr;
2289  CkMulticastMgr *mcastPtr =
2290  CProxy_CkMulticastMgr(mcastProxy).ckLocalBranch();
2291  CkCallback cb(CkIndex_MsmBlock::sumReducedPotential(NULL),
2293  // sum into "full" sized buffer needed for contribute
2294  ehfull.reset(0);
2295  ehfull += eh;
2296  mcastPtr->contribute(
2297  ehfull.nn() * sizeof(Float), ehfull.data().buffer(),
2298  CkReduction::sum_float, cookie, cb);
2299 
2300 #else
2301  // place eh into message
2302  const msm::BlockIndex& bindex = ehblockSend.nblock_wrap;
2303  int msgsz = eh.data().len() * sizeof(Float);
2304  GridMsg *gm = new(msgsz, sizeof(int)) GridMsg;
2306  gm->put(eh, bindex.level, sequence);
2307  // lookup in ComputeMsmMgr proxy array by level
2308  mgrLocal->msmBlock[bindex.level](
2309  bindex.n.i, bindex.n.j, bindex.n.k).addPotential(gm);
2310 
2311 #endif // MSM_REDUCE_GRID
2312 
2313 #ifdef MSM_TIMING
2314  stopTime = CkWallTimer();
2315  mgrLocal->msmTiming[MsmTimer::COMM] += stopTime - startTime;
2316  mgrLocal->doneTiming();
2317 #endif
2318  } // compute()
msm::Grid< Float > ehfull
Definition: ComputeMsm.C:2201
void reset(const T &t)
Definition: MsmMap.h:670
CkSectionInfo cookie
Definition: ComputeMsm.C:2199
BlockIndex nblock_wrap
Definition: MsmMap.h:869
int k
Definition: MsmMap.h:411
int i
Definition: MsmMap.h:411
void compute(GridMsg *gmsg)
Definition: ComputeMsm.C:1904
int j
Definition: MsmMap.h:411
CProxyElement_MsmBlock msmBlockElementProxy
Definition: ComputeMsm.C:2198
const T * buffer() const
Definition: MsmMap.h:259
int nn() const
Definition: MsmMap.h:443
void put(const msm::Grid< T > &g, int id, int seq)
Definition: ComputeMsm.C:126
const Array< T > & data() const
Definition: MsmMap.h:666
float Float
Definition: MsmMap.h:74
msm::Array< CProxy_MsmBlock > msmBlock
Definition: ComputeMsm.C:464
int len() const
Definition: MsmMap.h:218
#define SET_PRIORITY(MSG, SEQ, PRIO)
Definition: Priorities.h:18

◆ init()

void MsmGridCutoff::init ( )
inline

Definition at line 2233 of file ComputeMsm.C.

References MsmGridCutoffKernel< Vtype, Mtype >::init().

◆ setup()

void MsmGridCutoff::setup ( MsmGridCutoffInitMsg bmsg)
inline

Definition at line 2237 of file ComputeMsm.C.

References msm::Map::blockLevel, MsmGridCutoffKernel< Float, Float >::ehblockSend, ehfull, msm::Map::gc, msm::Map::gvc, msm::Ivec::i, msm::Grid< T >::init(), msm::Ivec::j, msm::Ivec::k, msm::BlockIndex::level, MsmGridCutoffKernel< Float, Float >::map, msm::BlockIndex::n, msm::BlockSend::nblock_wrap, MsmGridCutoffKernel< Vtype, Mtype >::setup(), and MsmGridCutoffKernel< Vtype, Mtype >::setupWeights().

2237  {
2238  // base class consumes this init proxy message
2240  // access type dependent constants from map
2244  );
2245 #ifdef MSM_REDUCE_GRID
2246  // allocate full buffer space needed for section reduction
2247  int level = ehblockSend.nblock_wrap.level;
2248  int i = ehblockSend.nblock_wrap.n.i;
2249  int j = ehblockSend.nblock_wrap.n.j;
2250  int k = ehblockSend.nblock_wrap.n.k;
2251  ehfull.init( map->blockLevel[level](i,j,k).nrange );
2252 #endif // MSM_REDUCE_GRID
2253 #ifdef DEBUG_MSM_GRID
2254  printf("MsmGridCutoff[%d]: setup()"
2255  " send to level=%d block=(%d,%d,%d)\n",
2256  thisIndex, ehblockSend.nblock_wrap.level,
2260 #endif
2261  }
msm::Grid< Float > ehfull
Definition: ComputeMsm.C:2201
BlockIndex nblock_wrap
Definition: MsmMap.h:869
int k
Definition: MsmMap.h:411
int i
Definition: MsmMap.h:411
Array< Grid< BlockDiagram > > blockLevel
Definition: MsmMap.h:956
int j
Definition: MsmMap.h:411
void init(const IndexRange &n)
Definition: MsmMap.h:603
void setupWeights(const msm::Grid< Mtype > *ptrgc, const msm::Grid< Mtype > *ptrgvc)
Definition: ComputeMsm.C:1895
void setup(MsmGridCutoffInitMsg *bmsg)
Definition: ComputeMsm.C:1838
Array< Grid< Float > > gc
Definition: MsmMap.h:944
Array< Grid< Float > > gvc
Definition: MsmMap.h:945

◆ setupSections()

void MsmGridCutoff::setupSections ( MsmGridCutoffSetupMsg msg)
inline

Definition at line 2263 of file ComputeMsm.C.

References cookie, MsmGridCutoffSetupMsg::get(), and msmBlockElementProxy.

2263  {
2264 #ifdef DEBUG_MSM_GRID
2265  CkPrintf("MSM GRID CUTOFF %d setup section on PE %d\n",
2266  thisIndex, CkMyPe());
2267 #endif
2268  CkGetSectionInfo(cookie, msg); // init the cookie
2269  msg->get(&msmBlockElementProxy); // get proxy to MsmBlock
2270  delete msg;
2271  }
CkSectionInfo cookie
Definition: ComputeMsm.C:2199
CProxyElement_MsmBlock msmBlockElementProxy
Definition: ComputeMsm.C:2198
void get(CProxyElement_MsmBlock *q)
Definition: ComputeMsm.C:259

Member Data Documentation

◆ cookie

CkSectionInfo MsmGridCutoff::cookie

Definition at line 2199 of file ComputeMsm.C.

Referenced by compute(), and setupSections().

◆ ehfull

msm::Grid<Float> MsmGridCutoff::ehfull

Definition at line 2201 of file ComputeMsm.C.

Referenced by compute(), and setup().

◆ msmBlockElementProxy

CProxyElement_MsmBlock MsmGridCutoff::msmBlockElementProxy

Definition at line 2198 of file ComputeMsm.C.

Referenced by compute(), and setupSections().


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