changa 3.5
Loading...
Searching...
No Matches
ParallelGravity.h
Go to the documentation of this file.
1
3
4#ifndef PARALLELGRAVITY_H
5#define PARALLELGRAVITY_H
6
7#include "config.h"
8#include <string>
9#include <map>
10#include <vector>
11#include <algorithm>
12
13#include "pup_stl.h"
14#include "ckio.h"
15
16#include "Vector3D.h"
17#include "tree_xdr.h"
18#include "TipsyFile.h"
19#include "SFC.h"
20#include "TreeNode.h"
21#include "GenericTreeNode.h"
22#include "Interval.h"
23#include "parameters.h"
24#include "param.h"
25#include "dumpframe.h"
26#include <liveViz.h>
27
28#include "rand.h"
29
30#include "TaggedVector3D.h"
31
32#include "codes.h"
33#include "CacheInterface.h"
34
35#ifdef SPCUDA
36#include "EwaldCUDA.h"
37#endif
38
39#ifdef CUDA
40#include "cuda_typedef.h"
41#include "hapi.h"
42#endif
43
44#include "keytype.h"
45
46PUPbytes(InDumpFrame);
47PUPbytes(COOL);
48PUPbytes(COOLPARAM);
49
50#ifdef HPM_COUNTER
51#include <libhpm.h>
52#endif
53
54#include <map>
55
56#define MERGE_REMOTE_REQUESTS_VERBOSE(X) /*CkPrintf x*/
57
59inline void CkMustAssert(bool cond, const char *err)
60{
61 if (!cond) CkAbort("%s", err);
62}
63
64using namespace std;
65
66using namespace Tree;
67
70 Null=0,
71 Multistep,
72 Orb3d,
73 Multistep_notopo,
74 MultistepNode_notopo,
75 Orb3d_notopo,
76 MultistepOrb,
77 Multistep_SFC,
78 HierarchOrb
79};
80PUPbytes(LBStrategy);
81
82#ifdef SELECTIVE_TRACING
83enum TraceState {
84 TraceNormal = 0,
85 TraceSkip
86};
87#endif
88
91 SFC_dec=0, // Space Filling Curve with Morton ordering
92 Oct_dec=1, // Oct tree
93 ORB_dec=2, // Bisect the longest axis, balancing particles
94 SFC_peano_dec=3, // SFC with Peano-Hilbert ordering
95 SFC_peano_dec_3D=4, // Joachim Stadel's implementation of P-H ordering
96 SFC_peano_dec_2D=5, // 2D version of Peano-Hilbert ordering
97 ORB_space_dec=6 // Bisect space
98};
99
102 LEFT = 0,
103 RIGHT
104};
105PUPbytes(NborDir);
106
108const double ddTolerance = 0.1;
109
110inline void operator|(PUP::er &p,DomainsDec &d) {
111 int di;
112 if (p.isUnpacking()) {
113 p | di;
114 d = (DomainsDec)di;
115 } else {
116 di = (int)d;
117 p | di;
118 }
119}
120
121#include "GravityParticle.h"
122
123class SmoothParams;
124
127{
128 public:
129 int64_t nMaxOrderGas;
130 int64_t nMaxOrderDark;
131 int64_t nMaxOrder;
132 void pup(PUP::er& p) {
133 p| nMaxOrderGas;
134 p| nMaxOrderDark;
135 p| nMaxOrder;
136 }
137 };
138
139#include "InOutput.h"
140
141#include "ParallelGravity.decl.h"
142
143extern CProxy_Main mainChare;
144extern int verbosity;
145extern bool _cache;
146extern int _nocache;
147extern int _cacheLineDepth;
148extern unsigned int _yieldPeriod;
149extern DomainsDec domainDecomposition;
150extern double dExtraStore;
151extern double dMaxBalance;
152extern double dGlassDamper;
153extern int bUseCkLoopPar;
154extern GenericTrees useTree;
155extern CProxy_TreePiece treeProxy;
156#ifdef REDUCTION_HELPER
157extern CProxy_ReductionHelper reductionHelperProxy;
158#endif
159extern CProxy_LvArray lvProxy; // Proxy for the liveViz array
160extern CProxy_LvArray smoothProxy; // Proxy for smooth reduction
161extern CProxy_LvArray gravityProxy; // Proxy for gravity reduction
162extern CProxy_TreePiece streamingProxy;
163extern CProxy_DataManager dMProxy;
164extern CProxy_IntraNodeLBManager nodeLBMgrProxy;
165extern unsigned int numTreePieces;
166extern unsigned int particlesPerChare;
167extern int nIOProcessor;
168
169extern CProxy_DumpFrameData dfDataProxy;
170extern CProxy_PETreeMerger peTreeMergerProxy;
171extern CProxy_CkCacheManager<KeyType> cacheGravPart;
172extern CProxy_CkCacheManager<KeyType> cacheSmoothPart;
173extern CProxy_CkCacheManager<KeyType> cacheNode;
174
176extern CkGroupID dataManagerID;
177
178extern int START_REG;
179extern int START_IB;
180extern int START_PW;
181
182extern int boundaryEvaluationUE;
183extern int weightBalanceUE;
184extern int networkProgressUE;
185extern int nodeForceUE;
186extern int partForceUE;
187
188extern int tbFlushRequestsUE;
189extern int prefetchDoneUE;
190
191extern int _prefetch;
192extern int _randChunks;
193extern int _numChunks;
194extern unsigned int bucketSize;
195
196//jetley
197extern int localNodesPerReq;
198extern int remoteNodesPerReq;
199extern int remoteResumeNodesPerReq;
200extern int localPartsPerReq;
201extern int remotePartsPerReq;
202extern int remoteResumePartsPerReq;
203
204extern double largePhaseThreshold;
205
206extern cosmoType theta;
207extern cosmoType thetaMono;
208
209extern int numInitDecompBins;
210extern int octRefineLevel;
211
213class dummyMsg : public CMessage_dummyMsg{
214public:
215};
216
217#if COSMO_STATS > 0
218class TreePieceStatistics {
219 u_int64_t nodesOpenedLocal;
220 u_int64_t nodesOpenedRemote;
221 u_int64_t nodeInterLocal;
222 u_int64_t nodeInterRemote;
223 u_int64_t particleInterLocal;
224 u_int64_t particleInterRemote;
225 u_int64_t openCriterionCalls;
226 int nActive;
227
228 TreePieceStatistics() : nodesOpenedLocal(0), nodesOpenedRemote(0),
229 nodeInterLocal(0), nodeInterRemote(0), particleInterLocal(0),
230 particleInterRemote(0), openCriterionCalls(0), nActive(0) { }
231
232 public:
233 TreePieceStatistics(u_int64_t nol, u_int64_t nor, u_int64_t occ, u_int64_t nil, u_int64_t nir,
234 u_int64_t pil, u_int64_t pir, int na) :
235 nodesOpenedLocal(nol), nodesOpenedRemote(nor), nodeInterLocal(nil),
236 nodeInterRemote(nir), particleInterLocal(pil), particleInterRemote(pir),
237 openCriterionCalls(occ), nActive(na) { }
238
239 void printTo(CkOStream &os) {
240 os << " TreePiece: " << nActive << " particles active." << endl;
241 os << " TreePiece: " << nodesOpenedLocal << " local nodes opened, ";
242 os << nodesOpenedRemote << " remote" << endl;
243 os << " TreePiece: " << openCriterionCalls << " num of open criterion calls" << endl;
244 os << " TreePiece: " << nodeInterLocal << " local particle-node interactions, ";
245 os << nodeInterRemote << " remote" << endl;
246 os << " TreePiece: " << particleInterLocal << " local particle-particle interactions, ";
247 os << particleInterRemote << " remote" << endl;
248 os << " TreePiece: "
249 << (particleInterLocal + particleInterRemote)/(double) nActive
250 << " particles, "
251 << (nodeInterLocal + nodeInterRemote)/(double) nActive
252 << " nodes per particle" << endl;
253 }
254
255 static CkReduction::reducerType sum;
256
257 static CkReductionMsg *sumFn(int nMsg, CkReductionMsg **msgs) {
258 TreePieceStatistics ret;
259 for (int i=0; i<nMsg; ++i) {
260 CkAssert(msgs[i]->getSize() == sizeof(TreePieceStatistics));
261 TreePieceStatistics *data = (TreePieceStatistics *)msgs[i]->getData();
262 ret.nodesOpenedLocal += data->nodesOpenedLocal;
263 ret.nodesOpenedRemote += data->nodesOpenedRemote;
264 ret.openCriterionCalls += data->openCriterionCalls;
265 ret.nodeInterLocal += data->nodeInterLocal;
266 ret.nodeInterRemote += data->nodeInterRemote;
267 ret.particleInterLocal += data->particleInterLocal;
268 ret.particleInterRemote += data->particleInterRemote;
269 ret.nActive += data->nActive;
270 }
271 return CkReductionMsg::buildNew(sizeof(TreePieceStatistics), &ret);
272 }
273};
274#endif
275
277class ComputeChunkMsg : public CMessage_ComputeChunkMsg {
278 ComputeChunkMsg() {} // not available
279 public:
280 int chunkNum;
281
282 ComputeChunkMsg(int i) : chunkNum(i) {
283 }
284};
285
291class ORBSplittersMsg : public CMessage_ORBSplittersMsg{
292public:
296 double *pos;
298 char *dim;
300 CkCallback cb;
301
302 ORBSplittersMsg(int len, CkCallback callback): length (len), cb(callback) {}
303
304};
305
307class ParticleShuffleMsg : public CMessage_ParticleShuffleMsg{
308public:
309 int nloads;
310 int n;
311 int nSPH;
312 int nStar;
313 double *loads;
314 unsigned int *parts_per_phase;
315 GravityParticle *particles;
316 extraSPHData *pGas;
317 extraStarData *pStar;
318 ParticleShuffleMsg(int nload, int npart, int nsph, int nstar):
319 nloads(nload), n(npart), nSPH(nsph), nStar(nstar) {}
320};
321
322#ifdef PUSH_GRAVITY
323#include "ckmulticast.h"
324
325struct BucketMsg : public CkMcastBaseMsg, public CMessage_BucketMsg {
326 GenericTreeNode *buckets;
327 int numBuckets;
328 ExternalGravityParticle *particles;
329 int numParticles;
330 int whichTreePiece;
331};
332#endif
333
336struct EwaldMsg: public CMessage_EwaldMsg {
337 bool fromInit;
338};
339
342{
343 public:
344 int index; /* chare index */
345 int nAddGas;
346 int nDelGas;
347 int nAddDark;
348 int nDelDark;
349 int nAddStar;
350 int nDelStar;
351
352 void pup(PUP::er& p) {
353 p | index;
354 p | nAddGas;
355 p | nDelGas;
356 p | nAddDark;
357 p | nDelDark;
358 p | nAddStar;
359 p | nDelStar;
360 }
361 };
362
363/*
364 * Multistepping routines
365 *
366 * Each major timestep can have MAXSUBSTEPS substeps where MAXSUBSTEPS
367 * is a large power of 2 that can fit in an integer: 1 << MAXRUNG,
368 * with MAXRUNG something like 30.
369 * A given particle is on a "Rung" such that it takes 1 << Rung
370 * substeps per major timestep. That is, it's force is updated every
371 * 1 << (MAXRUNG - Rung) smallest substeps.
372 *
373 * Needed routines:
374 * DtToRung(): take an ideal timestep, the major timestep and
375 * determine a rung.
376 */
377
378const int MAXRUNG = 30;
379const int MAXSUBSTEPS = 1 << MAXRUNG;
380const double MAXSUBSTEPS_INV = 1 / (double)MAXSUBSTEPS;
381
383inline int RungToSubsteps(int iRung) {
384 CkAssert(iRung <= MAXRUNG);
385 return 1 << (MAXRUNG - iRung);
386}
387
390inline int DtToRung(double dDelta, double dTideal) {
391 int iSteps = (int) ceil(dDelta/dTideal);
392
393 int iRung = 0;
394 iSteps--;
395 while(iSteps > 0) {
396 iRung++;
397 iSteps >>= 1;
398 }
399 return iRung;
400}
401
404inline double RungToDt(double dDelta, int iRung) {
405 return dDelta*RungToSubsteps(iRung)*MAXSUBSTEPS_INV;
406}
407
409const int PHASE_FEEDBACK = MAXRUNG + 1;
410
413
414inline double PoverRhoFloorJeans(double dResolveJeans, GravityParticle *p)
415{
416 /*
417 * Add pressure floor to keep Jeans Mass
418 * resolved. In comparison with Agertz et
419 * al. 2009, dResolveJeans should be 3.0:
420 * P_min = 3*G*max(h,eps)^2*rho^2
421 * Note that G = 1 in our code
422 */
423#ifdef JEANSSOFTONLY
424 double l2 = p->soft*p->soft;
425#else
426 double l2 = 0.25*p->fBall*p->fBall;
427#ifdef JEANSSOFT
428 double e2 = p->soft*p->soft;
429 if (l2 < e2) l2 = e2; /* Jeans scale can't be smaller than softening */
430#endif
431#endif
432 return l2*dResolveJeans*p->fDensity;
433}
434
436const double GAMMA_JEANS = 2.0;
437const double GAMMA_NONCOOL = 5.0/3.0;
438
439
449class Main : public CBase_Main {
450 CkArgMsg *args;
451 std::string basefilename;
453 OutputParams *pOutput;
454 // NChilada file names used to generate the XML description
455 std::vector<std::string> NCgasNames;
456 std::vector<std::string> NCdarkNames;
457 std::vector<std::string> NCstarNames;
459 CkCallback cbIO;
461 Ck::IO::File fIOFile;
462 CProxy_Sorter sorter;
463 int64_t nTotalParticles;
464 int64_t nTotalSPH;
465 int64_t nTotalDark;
466 int64_t nTotalStar;
468 int64_t nSink;
469 int64_t nMaxOrderGas; /* Maximum iOrders */
470 int64_t nMaxOrderDark;
471 int64_t nMaxOrder;
472
473 double dTime; /* Simulation time */
474 double dTime0;
475 double dEcosmo; /* variables for integrating
476 Lazer-Irvine eq. */
477 double dUOld;
478 double dTimeOld;
479 PRM prm; /* parameter parsing info */
480 Parameters param; /* actual parameters */
481 CkVec<double> vdOutTime; // Desired output times
482 int iOut;
483 /*
484 ** Tracking for frame dumping function
485 */
486 int bDumpFrame;
487 struct DumpFrameContext **df;
488 int bIsRestarting;
490 int bHaveAlpha;
491 int bChkFirst; /* alternate between 0 and 1 for checkpoint */
492 double dSimStartTime; // Start time for entire simulation
493 int iStop; /* indicate we're stopping the
494 simulation early */
495 int64_t nActiveGrav;
496 int64_t nActiveSPH;
497
498#ifdef CUDA
499 double localNodesPerReqDouble;
500 double remoteNodesPerReqDouble;
501 double remoteResumeNodesPerReqDouble;
502 double localPartsPerReqDouble;
503 double remotePartsPerReqDouble;
504 double remoteResumePartsPerReqDouble;
505#endif
506
507#ifdef CHECK_TIME_WITHIN_BIGSTEP
508 double wallTimeStart;
509#endif
510
513 class timing_fields {
514 public:
515 int count;
516 double tGrav;
517 double tColl;
518 double tuDot;
519 double tDD;
520 double tLoadB;
521 double tTBuild;
522 double tAdjust;
523 double tEmergAdjust;
524 double tKick;
525 double tDrift;
526 double tCache;
527 public:
529 void clear() {
530 count = 0;
531 tGrav = tColl = tuDot = tDD = tLoadB = tTBuild = tAdjust
532 = tEmergAdjust = tKick = tDrift = tCache = 0.0;
533 }
534 };
535
536 CkVec<timing_fields> timings;
537 void writeTimings(int iStep);
538
539#ifdef SELECTIVE_TRACING
540 int monitorRung;
541 int monitorStart;
542 int numTraceIterations;
543 int numSkipIterations;
544 int numMaxTrace;
545 int traceIteration;
546 int traceState;
547 bool projectionsOn;
548
549 void turnProjectionsOn(int activeRung);
550 void turnProjectionsOff();
551#endif
552
553
554public:
555
556 Main(CkArgMsg* m);
557 Main(CkMigrateMessage *m);
558
559 void niceExit();
560 void setupICs();
561 void initialForces();
562 void doSimulation();
563 void restart(CkCheckpointStatusMsg *msg);
564 void waitForGravity(const CkCallback &cb, double startTime,
565 int activeRung);
566 void advanceBigStep(int);
567 void domainDecomp(int iPhase);
568 void loadBalance(int iPhase);
569 void buildTree(int iPhase);
570 void startGravity(const CkCallback& cbGravity, int iActiveRung,
571 double *startTime) ;
572 void externalForce(int iActiveRung);
573 void updateuDot(int iActiveRung, const double duKick[],
574 const double dStartTime[], int bUpdateState, int bAll);
575 void kick(bool bClosing, int iActiveRung, int nextMaxRung,
576 const CkCallback &cbGravity, double gravStartTime);
577 void advanceBigCollStep(int);
578 int adjust(int iKickRung);
579 void rungStats();
580 void countActive(int activeRung);
581 void emergencyAdjust(int iRung);
582 void starCenterOfMass();
583 void logCollision(double, ColliderInfo*, int);
584 void writeCollLog(const char *);
585 void calcEnergy(double, double, const char *);
586 void getStartTime();
587 void getOutTimes();
588 int bOutTime();
589 void writeOutput(int iStep) ;
590 void outputBinary(OutputParams& params, int bParaWrite,
591 const CkCallback& cb);
592 void cbOpen(Ck::IO::FileReadyMsg *msg);
593 void cbIOReady(Ck::IO::SessionReadyMsg *msg);
594 void cbIOComplete(CkMessage *msg);
595 void cbIOClosed(CkMessage *msg);
596 std::string getNCNextOutput(OutputParams& params);
597 void writeNCXML(std::string filename);
598 void NCXMLattrib(ofstream *desc, std::vector<std::string>& names,
599 std::string family);
600 void updateSoft();
601 void growMass(double dTime, double dDelta);
602 void initSph();
603 void initCooling();
604 void initLWData();
605 void initStarLog();
606 void initHMStarLog();
607 int ReadASCII(char *extension, int nDataPerLine, double *dDataOut);
608 void restartGas();
609 void doSph(int activeRung, int bNeedDensity = 1);
610 void AGORAfeedbackPreCheck(double dTime, double dDelta, double dTimeToSF);
611#ifdef COLLISION
612 void doCollisions(double dTime, double dDelta, int activeRung, int iStep, double dCentMass);
613 void doNearCollisions(double dTime, double dDelta, int activeRung);
614#endif
615 void FormStars(double dTime, double dDelta);
616 void StellarFeedback(double dTime, double dDelta);
617 void outputBlackHoles(double dTime);
618 void SetSink();
619 void FormSinks(double dTime, double dDelta, int iKickRung);
620 void doSinks(double dTime, double dDelta, int iKickRung);
621 int DumpFrameInit(double dTime, double dStep, int bRestart);
622 void DumpFrame(double dTime, double dStep);
623 int nextMaxRungIncDF(int nextMaxRung);
624 void addDelParticles();
625 void memoryStats();
626 void memoryStatsCache();
627 void pup(PUP::er& p);
628 void liveVizImagePrep(liveVizRequestMsg *msg);
629 void doSIDM(double dTime,double dDelta, int activeRung); /* SIDM */
630 void restartNSIDM();
631};
632
633/* IBM brain damage */
634#undef hz
636typedef struct ewaldTable {
637 double hx,hy,hz;
638 double hCfac,hSfac;
640
641// jetley
642class MissRecord;
643class State;
644
646typedef struct OffsetNodeStruct
647{
648 GenericTreeNode *node;
649 int offsetID;
651
652#if INTERLIST_VER > 0
654typedef CkQ<OffsetNode> CheckList;
656typedef CkVec<OffsetNode> UndecidedList;
658typedef CkVec<UndecidedList> UndecidedLists;
659#endif
660
662typedef struct particlesInfoR{
663 ExternalGravityParticle* particles;
664 int numParticles;
665 Vector3D<cosmoType> offset;
666#if defined CHANGA_REFACTOR_PRINT_INTERACTIONS || defined CHANGA_REFACTOR_WALKCHECK_INTERLIST || defined CUDA
667 NodeKey key;
668#endif
669#if COSMO_DEBUG > 1
670 GenericTreeNode *nd;
671#endif
673
675typedef struct particlesInfoL{
676 GravityParticle* particles;
677 int numParticles;
678 Vector3D<cosmoType> offset;
679#if defined CHANGA_REFACTOR_PRINT_INTERACTIONS || defined CHANGA_REFACTOR_WALKCHECK_INTERLIST || defined CUDA
680 NodeKey key;
681#endif
682#if COSMO_DEBUG > 1 || defined CUDA
683 GenericTreeNode *nd;
684#endif
686
693typedef struct LoopParDataStruct {
694 CkVec<GenericTreeNode*> lowNodes;
696 CkVec<int> bucketids;
697 CkVec<int> chunkids;
698 CkVec<CkVec<OffsetNode> > clists;
699 CkVec<CkVec<RemotePartInfo> > rpilists;
700 CkVec<CkVec<LocalPartInfo> > lpilists;
703
704
705
706#ifdef CUDA
707struct BucketActiveInfo{
708 int start;
709 int size;
710};
711#endif
712
713class SmoothCompute;
714#include "Compute.h"
715
716#if INTERLIST_VER > 0 && defined CUDA
717template<typename T> class GenericList;
718#endif
719
721struct NonLocalMomentsClient {
722 TreePiece *clientTreePiece;
723 GenericTreeNode *clientNode;
724
725 NonLocalMomentsClient() :
726 clientTreePiece(NULL),
727 clientNode(NULL)
728 {}
729
730 NonLocalMomentsClient(TreePiece *tp, GenericTreeNode *node) :
731 clientTreePiece(tp),
732 clientNode(node)
733 {}
734};
735
737struct NonLocalMomentsClientList {
738 GenericTreeNode *targetNode;
739 CkVec<NonLocalMomentsClient> clients;
740
741 NonLocalMomentsClientList() :
742 targetNode(NULL)
743 {}
744
745 NonLocalMomentsClientList(GenericTreeNode *node) :
746 targetNode(node)
747 {}
748
749 void addClient(const NonLocalMomentsClient &cli){
750 clients.push_back(cli);
751 }
752};
753
755class TreePiece : public CBase_TreePiece {
756 // jetley
757 friend class PrefetchCompute;
758 friend class GravityCompute;
759 friend class SmoothCompute;
760 friend class KNearestSmoothCompute;
761 friend class ReSmoothCompute;
762 friend class MarkSmoothCompute;
763 friend class ListCompute;
764 friend class NearNeighborState;
765 friend class ReNearNeighborState;
766 friend class MarkNeighborState;
767 friend class BottomUpTreeWalk;
768#if INTERLIST_VER > 0 && defined CUDA
769 friend class DataManager;
770 template<typename T> friend class GenericList;
771#endif
772
773 friend class RemoteTreeBuilder;
774 friend class LocalTreeBuilder;
775
777 TreeWalk *sTopDown;
778 TreeWalk *twSmooth;
779#if INTERLIST_VER > 0
780 TreeWalk *sInterListWalk;
781 // clearable, used for resumed walks
782 State *sInterListStateRemoteResume;
783#endif
784 Compute *sGravity, *sPrefetch;
785 SmoothCompute *sSmooth;
786
787 Opt *sLocal, *sRemote, *sPref;
788 Opt *optSmooth;
789
790 State *sPrefetchState;
792 State *sLocalGravityState, *sRemoteGravityState, *sSmoothState;
793 typedef std::map<KeyType, CkVec<int>* > SmPartRequestType;
794 // buffer of requests for smoothParticles.
795 SmPartRequestType smPartRequests;
796
797 CkVec<ActiveWalk> activeWalks;
798 int completedActiveWalks; // XXX this should be part of the gravity
799 // walk state.
800 int nCacheAccesses; // keep track of outstanding cache accesses to
801 // know when writebacks complete. XXX this
802 // should be part of the smooth state
803
805 unsigned int nPrevActiveParts;
806 std::vector<double> savedPhaseLoad;
807 std::vector<unsigned int> savedPhaseParticle;
809 std::vector<double> savedPhaseLoadTmp;
811 std::vector<unsigned int> savedPhaseParticleTmp;
812
813 int memWithCache, memPostCache; // store memory usage.
814 int nNodeCacheEntries, nPartCacheEntries; // store memory usage.
815
816#ifdef PUSH_GRAVITY
817 bool doMerge;
818 bool createdSpanningTree;
819 CProxySection_TreePiece allTreePieceSection;
820 CkVec<GravityParticle> foreignParticles;
821 CkVec<double> foreignParticleAccelerations;
822
823 map<int,CkSectionInfo> cookieJar;
824
825 BucketMsg *createBucketMsg();
826 void unpackBuckets(BucketMsg *, GenericTreeNode *&foreignBuckets, int &numForeignBuckets);
827 void calculateForces(GenericTreeNode *foreignBuckets, int numForeignBuckets);
828
829#endif
830
831 public:
832
833#ifdef PUSH_GRAVITY
834 void startPushGravity(int am, double myTheta);
835 void recvPushBuckets(BucketMsg *);
836 void recvPushAccelerations(CkReductionMsg *);
837#endif
838
839#if COSMO_PRINT_BK > 1
840 State *getSRemoteGravityState(){ return sRemoteGravityState; }
841 State *getSLocalGravityState(){ return sLocalGravityState; }
842#endif
843 void memCacheStats(const CkCallback &cb);
844 void addActiveWalk(int iAwi, TreeWalk *tw, Compute *c, Opt *o, State *s);
845
847 void markWalkDone();
849 void finishWalk();
851 void markSmoothWalkDone();
853 void finishSmoothWalk();
854
855 int getIndex() {
856 return thisIndex;
857 }
858
860 void addToNodeInterRemote(int chunk, int howmany){
861 nodeInterRemote[chunk] += howmany;
862 }
863
865 void addToParticleInterRemote(int chunk, int howmany){
866 particleInterRemote[chunk] += howmany;
867 }
868
870 void addToNodeInterLocal(int howmany){
871 nodeInterLocal += howmany;
872 }
873
875 void addToParticleInterLocal(int howmany){
876 particleInterLocal += howmany;
877 }
878
881 void initiatePrefetch(int chunk);
883 void startRemoteChunk();
884
887 return myNumParticles;
888 }
889
891 GravityParticle *getParticles(){return myParticles;}
892
893
894#ifdef CUDA
895 // this variable holds the number of buckets active at
896 // the start of an iteration
897 // it is used to ascertain how many buckets still need to
898 // be processed via the stateReady function with regard
899 // to their local and remote-no-resume walks.
900 // if all numActiveBuckets
901 // have been processed but we still have leftover nodes/particles
902 // in the list of interations to the sent to the gpu, we flush
903 // the list
904 int numActiveBuckets;
905 int myNumActiveParticles;
906 // First and Last indices of GPU particle
907 int FirstGPUParticleIndex;
908 int LastGPUParticleIndex;
909 int NumberOfGPUParticles;
910 BucketActiveInfo *bucketActiveInfo;
911
912 // For accessing GPU memory
913 CudaMultipoleMoments *d_localMoments;
914 CudaMultipoleMoments *d_remoteMoments;
915 CompactPartData *d_localParts;
916 CompactPartData *d_remoteParts;
917 VariablePartData *d_localVars;
918 size_t sMoments;
919 size_t sCompactParts;
920 size_t sVarParts;
921 cudaStream_t stream;
922
923 int getNumBuckets(){
924 return numBuckets;
925 }
926
927 int getActiveRung(){ return activeRung; }
928 // returns either all particles or only active particles,
929 // depending on fraction of active particles to their
930 // total count.
931 int getDMNumParticles(){
932 if(largePhase()){
933 return myNumParticles;
934 }
935 else{
936 return myNumActiveParticles;
937 }
938 }
939
940 int getNumActiveParticles(){
941 return myNumActiveParticles;
942 }
943
944 void calculateNumActiveParticles(){
945 myNumActiveParticles = 0;
946 for(int i = 1; i <= myNumParticles; i++){
947 if(myParticles[i].rung >= activeRung){
948 myNumActiveParticles++;
949 }
950 }
951 }
952
953 bool largePhase(){
954 return (1.0*myNumActiveParticles/myNumParticles) >= largePhaseThreshold;
955 }
956
957 void getDMParticles(CompactPartData *fillArray, int &fillIndex){
958 NumberOfGPUParticles = 0;
959 FirstGPUParticleIndex = fillIndex;//This is for the GPU Ewald
960 if(largePhase()){
961 for(int b = 0; b < numBuckets; b++){
962 GenericTreeNode *bucket = bucketList[b];
963 int buckstart = bucket->firstParticle;
964 int buckend = bucket->lastParticle;
965 GravityParticle *buckparts = bucket->particlePointer;
966 bucket->bucketArrayIndex = fillIndex;
967 for(int i = buckstart; i <= buckend; i++){
968 fillArray[fillIndex] = buckparts[i-buckstart];
969 fillIndex++;
970 }
971 }
972 }
973 else{
974 for(int b = 0; b < numBuckets; b++){
975 GenericTreeNode *bucket = bucketList[b];
976 if(bucket->rungs < activeRung){
977 continue;
978 }
979 BucketActiveInfo *binfo = &(bucketActiveInfo[b]);
980
981 int buckstart = bucket->firstParticle;
982 int buckend = bucket->lastParticle;
983 GravityParticle *buckparts = bucket->particlePointer;
984
985 binfo->start = fillIndex;
986 for(int i = buckstart; i <= buckend; i++){
987 if(buckparts[i-buckstart].rung >= activeRung){
988 fillArray[fillIndex] = buckparts[i-buckstart];
989 fillIndex++;
990 }
991 }
992 binfo->size = fillIndex-binfo->start;
993 }
994 }
995 //This is for the GPU Ewald
996 if(FirstGPUParticleIndex == fillIndex){
997 //This means no particle is on GPU
998 FirstGPUParticleIndex = -1;
999 LastGPUParticleIndex = -1;
1000 NumberOfGPUParticles = 0;
1001 }
1002 else{
1003 LastGPUParticleIndex = fillIndex - 1;
1004 NumberOfGPUParticles = LastGPUParticleIndex - FirstGPUParticleIndex + 1;
1005 }
1006 }
1007
1008 bool isActive(int partNum){
1009 return myParticles[partNum].rung >= activeRung;
1010 }
1011
1012 void clearMarkedBuckets(CkVec<GenericTreeNode *> &markedBuckets);
1013 void clearMarkedBucketsAll();
1014
1015#ifdef HAPI_TRACE
1016 long long localNodeInteractions;
1017 long long localPartInteractions;
1018 long long remoteNodeInteractions;
1019 long long remotePartInteractions;
1020 long long remoteResumeNodeInteractions;
1021 long long remoteResumePartInteractions;
1022#endif
1023
1024#endif
1025
1026#ifdef CUDA
1027 void continueStartRemoteChunk(int chunk, intptr_t d_remoteMoments, intptr_t d_remoteParts);
1028 void fillGPUBuffer(intptr_t bufLocalParts,
1029 intptr_t bufLocalMoments,
1030 intptr_t pLocalMoments, int partIndex, int nParts, intptr_t node);
1031 void updateParticles(intptr_t data, int partIndex);
1032#else
1033 void continueStartRemoteChunk(int chunk);
1034#endif
1035 void continueWrapUp();
1036
1037#if INTERLIST_VER > 0
1038 void getBucketsBeneathBounds(GenericTreeNode *&node, int &start, int &end);
1039 void updateBucketState(int start, int end, int n, int chunk, State *state);
1040 void updateUnfinishedBucketState(int start, int end, int n, int chunk, State *state);
1041#endif
1042
1043#if defined CHANGA_REFACTOR_WALKCHECK || defined CHANGA_REFACTOR_WALKCHECK_INTERLIST
1044 void addToBucketChecklist(int bucketIndex, NodeKey k){
1045 bucketcheckList[bucketIndex].insert(k);
1046 if(bucketIndex == TEST_BUCKET && thisIndex == TEST_TP)
1047 CkPrintf("[%d] add %ld\n", thisIndex, k);
1048 }
1049#endif
1050
1051#if INTERLIST_VER > 0
1052 GenericTreeNode *getStartAncestor(int current, int previous, GenericTreeNode *dflt);
1053#endif
1056 NodeLookupType::iterator iter = nodeLookupTable.find(k);
1057 if (iter != nodeLookupTable.end()) return iter->second;
1058 else return NULL;
1059 }
1060
1061 GenericTreeNode *getBucket(int i){
1062 return bucketList[i];
1063 }
1064
1067
1068 Rand rndGen; // Random number generator for star
1069 // formation and other uses.
1070private:
1071 // liveViz
1072 liveVizRequestMsg * savedLiveVizMsg;
1073
1074 LBStrategy foundLB;
1075 // jetley - saved first internal node
1076 Vector3D<float> savedCentroid;
1078 int iPrevRungLB;
1080 int iActiveRungLB;
1081
1084 CkCallback callback;
1086 CkCallback cbGravity;
1088 CkCallback cbSmooth;
1089 CkCallback after_dd_callback;
1091 unsigned int myNumParticles;
1092 unsigned int numActiveParticles;
1094 GravityParticle* myParticles;
1095 int nbor_msgs_count_;
1097 int nStore;
1099 bool bBucketsInited;
1100
1101 // Temporary location to hold the particles that have come from outside this
1102 // TreePiece. This is used in the case where we migrate the particles and
1103 // detect completion of migration using QD.
1104 std::vector<GravityParticle> myTmpShuffleParticle;
1105 std::vector<extraSPHData> myTmpShuffleSphParticle;
1106 std::vector<extraStarData> myTmpShuffleStarParticle;
1107 ParticleShuffleMsg* myShuffleMsg;
1110 int myTreeParticles;
1111 public:
1115 int64_t nTotalSPH;
1117 int64_t nTotalDark;
1119 int64_t nTotalStar;
1120 private:
1122 unsigned int myNumSPH;
1124 extraSPHData *mySPHParticles;
1126 int nStoreSPH;
1128 unsigned int myNumStar;
1130 extraStarData *myStarParticles;
1132 int nStoreStar;
1134 int64_t nMaxOrder;
1136 int64_t nStartRead;
1138 int myIOParticles;
1139
1141 std::vector<GenericTreeNode *> bucketList;
1142
1144 std::vector<GravityParticle> mySortedParticles;
1146 std::vector<extraSPHData> mySortedParticlesSPH;
1148 std::vector<extraStarData> mySortedParticlesStar;
1150 std::vector<ParticleShuffleMsg*> incomingParticlesMsg;
1152 int incomingParticlesArrived;
1157 bool incomingParticlesSelf;
1158
1160 double piecemass;
1161
1164 int cnt;
1167 int packed;
1168
1169 // the index assigned by the CacheManager upon registration
1170 int localIndex;
1171
1172 //unsigned int numSplitters;
1173 //SFC::Key* splitters;
1174 CProxy_TreePiece pieces;
1176 //CProxy_DataManager dataManager; // unused...
1178 DataManager* dm;
1179
1182#ifndef REDUCTION_HELPER
1183 CkVec<int64_t> myBinCounts;
1184#endif
1185 std::vector<int> myBinCountsORB;
1187 int myPlace;
1190 SFC::Key leftSplitter, rightSplitter;
1191
1192 std::string basefilename;
1193 // Bounding box of the entire simulation
1194 OrientedBox<float> boundingBox;
1195 unsigned iterationNo;
1197 GenericTreeNode* root;
1199 NodePool *pTreeNodes;
1200
1201 typedef std::map<NodeKey, CkVec<int>* > MomentRequestType;
1205 MomentRequestType momentRequests;
1206
1208 //double theta; -- moved as readonly
1210 //double thetaMono; -- moved as readonly
1212 int activeRung;
1213
1215 int bUseCpu;
1216
1218 int bPeriodic;
1219 int bComove;
1221 double dRhoFac;
1222 Vector3D<cosmoType> fPeriod;
1223 int nReplicas;
1224 int bEwald; /* Perform Ewald */
1225 double fEwCut;
1226 double dEwhCut;
1227 EWT *ewt;
1228 int nMaxEwhLoop;
1229 int nEwhLoop;
1230#ifdef HEXADECAPOLE
1231 MOMC momcRoot; /* complete moments of root */
1232#endif
1233
1234 int bGasCooling;
1235#ifndef COOLING_NONE
1236 clDerivsData *CoolData;
1237#endif
1239 std::vector<int> iSeTab;
1241 int nSetupWriteStage;
1242 int64_t nStartWrite; // Particle number at which this piece starts
1243 // to write file.
1244
1246 NodeLookupType nodeLookupTable;
1247
1249 //u_int64_t prefetchWaiting;
1251 Tree::NodeKey *prefetchRoots;
1253 OrientedBox<cosmoType> prefetchReq;
1254
1256 int numChunks;
1257
1258#if COSMO_STATS > 0
1259 u_int64_t myNumMACChecks;
1260 u_int64_t nodesOpenedLocal;
1261 u_int64_t nodesOpenedRemote;
1262 u_int64_t numOpenCriterionCalls;
1263#endif
1265 u_int64_t nodeInterLocal;
1267 u_int64_t *nodeInterRemote;
1269 u_int64_t particleInterLocal;
1271 u_int64_t *particleInterRemote;
1272
1273 int nActive; // number of particles that are active
1274
1276 unsigned int numBuckets;
1277#if INTERLIST_VER > 0
1279 int prevRemoteBucket;
1281 int prevBucket;
1282#endif
1284 unsigned int ewaldCurrentBucket;
1290 BucketGravityRequest *bucketReqs;
1291
1293 //CacheManager *localCache;
1294
1295 // Entries used for the CacheManager
1296 EntryTypeGravityParticle gravityParticleEntry;
1297 EntryTypeSmoothParticle smoothParticleEntry;
1298 EntryTypeGravityNode gravityNodeEntry;
1299
1300#if COSMO_DEBUG > 1 || defined CHANGA_REFACTOR_WALKCHECK || defined CHANGA_REFACTOR_WALKCHECK_INTERLIST
1302 typedef std::vector< std::multiset<Tree::NodeKey> > DebugList;
1303 DebugList bucketcheckList;
1304#endif
1305
1307
1309 bool firstTime;
1310
1312 std::vector<int> tempBinCounts;
1313
1315 std::list<GravityParticle *> orbBoundaries;
1316
1318 int myExpectedCount;
1321 int myExpectedCountSPH;
1324 int myExpectedCountStar;
1325
1327 unsigned int chunkRootLevel;
1328
1331 OrientedBox<float>* boxes;
1332 char* splitDims;
1333
1336 int phase;
1337
1338 double myTotalMass;
1339
1340 #if INTERLIST_VER > 0
1341
1342
1343 public:
1344#endif
1345 // called when a chunk has been used completely (chunkRemaining[chunk] == 0)
1346 void finishedChunk(int chunk);
1347
1350 double tmpTime;
1351 double totalTime;
1352 public:
1353
1354#ifdef SPCUDA
1355 EwaldData *h_idata;
1356 CkCallback *cbEwaldGPU;
1357#endif
1358 void EwaldGPU();
1359 void EwaldGPUComplete();
1360
1361#if COSMO_DEBUG > 1 || defined CHANGA_REFACTOR_WALKCHECK || defined CHANGA_REFACTOR_WALKCHECK_INTERLIST
1363 void checkWalkCorrectness();
1364 void combineKeys(Tree::NodeKey key,int bucket);
1365#endif
1366
1367 /* DEBUGGING */
1368 void quiescence();
1369 /*END DEBUGGING */
1370
1371 NodeLookupType &getNodeLookupTable() {
1372 return nodeLookupTable;
1373 }
1374
1375 int getNumNodes() {
1376 return nodeLookupTable.size();
1377 }
1378
1380 void deleteTree() {
1381 if(pTreeNodes != NULL) {
1382 delete pTreeNodes;
1383 pTreeNodes = NULL;
1384 root = NULL;
1385 nodeLookupTable.clear();
1386 }
1387 else {
1388 if (root != NULL) {
1389 root->fullyDelete();
1390 delete root;
1391 root = NULL;
1392 nodeLookupTable.clear();
1393 }
1394 }
1395 }
1396
1401
1405 void checkTree(GenericTreeNode* node);
1406
1410 bool nodeOwnership(const Tree::NodeKey nkey, int &firstOwner, int &lastOwner);
1411
1412
1415 void initBuckets();
1416 template <class Tsmooth>
1417 void initBucketsSmooth(Tsmooth tSmooth);
1418 void smoothNextBucket();
1419 void reSmoothNextBucket();
1420 void markSmoothNextBucket();
1421 void smoothBucketComputation();
1425 void startNextBucket();
1429 void doAllBuckets();
1430 void reconstructNodeLookup(GenericTreeNode *node);
1431 //void rebuildSFCTree(GenericTreeNode *node,GenericTreeNode *parent,int *);
1432
1433public:
1434 TreePiece() : pieces(thisArrayID), root(0),
1435 iPrevRungLB (-1), sTopDown(0), sGravity(0),
1436 sPrefetch(0), sLocal(0), sRemote(0), sPref(0), sSmooth(0),
1437 nPrevActiveParts(0) {
1438 dm = NULL;
1439 foundLB = Null;
1440 iterationNo=0;
1441 usesAtSync = true;
1442 pTreeNodes = NULL;
1443 bucketReqs=NULL;
1444 nCacheAccesses = 0;
1445 memWithCache = 0;
1446 memPostCache = 0;
1447 nNodeCacheEntries = 0;
1448 nPartCacheEntries = 0;
1449 completedActiveWalks = 0;
1450 myPlace = -1;
1451 nSetupWriteStage = -1;
1452 //openingDiffCount=0;
1453 chunkRootLevel=0;
1454 //splitters = NULL;
1455#if COSMO_STATS > 0
1456 nodesOpenedLocal = 0;
1457 nodesOpenedRemote = 0;
1458 nodeInterLocal = 0;
1459 particleInterLocal = 0;
1460
1461 numOpenCriterionCalls=0;
1462
1463 piecemass = 0.0;
1464#endif
1465 packed=0; /* output accelerations in x,y,z
1466 packed format */
1467 cnt=0; /* Counter over x,y,z when not packed */
1468 particleInterRemote = NULL;
1469 nodeInterRemote = NULL;
1470
1471#if INTERLIST_VER > 0
1472 sInterListWalk = NULL;
1473#endif
1474 bUseCpu = 1;
1475#ifdef CUDA
1476 numActiveBuckets = -1;
1477#ifdef HAPI_TRACE
1478 localNodeInteractions = 0;
1479 localPartInteractions = 0;
1480 remoteNodeInteractions = 0;
1481 remotePartInteractions = 0;
1482 remoteResumeNodeInteractions = 0;
1483 remoteResumePartInteractions = 0;
1484#endif
1485#endif
1486
1487 tmpTime=0.0;
1488 totalTime=0.0;
1489 // temporarely set to -1, it will updated after the tree is built
1490 numChunks=-1;
1491 prefetchRoots = NULL;
1492 ewt = NULL;
1493 nMaxEwhLoop = 100;
1494
1495 incomingParticlesMsg.clear();
1496 incomingParticlesArrived = 0;
1497 incomingParticlesSelf = false;
1498
1499 myParticles = NULL;
1500 mySPHParticles = NULL;
1501 myStarParticles = NULL;
1502 myNumParticles = myNumSPH = myNumStar = 0;
1503 nStore = nStoreSPH = nStoreStar = 0;
1504 bBucketsInited = false;
1505 myTreeParticles = -1;
1506 orbBoundaries.clear();
1507 boxes = NULL;
1508 splitDims = NULL;
1509 bGasCooling = 0;
1510
1511#ifdef PUSH_GRAVITY
1512 createdSpanningTree = false;
1513#endif
1514
1515 localTreeBuildComplete = false;
1516 }
1517
1518 TreePiece(CkMigrateMessage* m): pieces(thisArrayID) {
1519
1520 usesAtSync = true;
1521 //localCache = NULL;
1522 dm = NULL;
1523 bucketReqs = NULL;
1524 numChunks=-1;
1525 nCacheAccesses = 0;
1526 memWithCache = 0;
1527 memPostCache = 0;
1528 nNodeCacheEntries = 0;
1529 nPartCacheEntries = 0;
1530 completedActiveWalks = 0;
1531 prefetchRoots = NULL;
1532 //remaining Chunk = NULL;
1533 ewt = NULL;
1534 root = NULL;
1535 pTreeNodes = NULL;
1536
1537 sTopDown = 0;
1538 sGravity = NULL;
1539 sPrefetch = NULL;
1540 sSmooth = NULL;
1541#if INTERLIST_VER > 0
1542 sInterListWalk = NULL;
1543#endif
1544
1545 incomingParticlesMsg.clear();
1546 incomingParticlesArrived = 0;
1547 incomingParticlesSelf = false;
1548
1549 cnt=0;
1550 nodeInterRemote = NULL;
1551 particleInterRemote = NULL;
1552
1553 orbBoundaries.clear();
1554 boxes = NULL;
1555 splitDims = NULL;
1556 bBucketsInited = false;
1557 myTreeParticles = -1;
1558
1559
1560 localTreeBuildComplete = false;
1561 }
1562
1563 private:
1564 void freeWalkObjects();
1565 void allocateStars() {
1566 nStoreStar = (int) (myNumStar*(1.0 + dExtraStore));
1567 // Stars tend to form out of gas, so make sure there is
1568 // enough room.
1569 nStoreStar += 12 + (int) (myNumSPH*dExtraStore);
1570 myStarParticles = new extraStarData[nStoreStar];
1571 }
1572
1573 public:
1574 ~TreePiece() {
1575 if (verbosity>1) ckout <<"Deallocating treepiece "<<thisIndex<<endl;
1576 if(nStore > 0) delete[] myParticles;
1577 if(nStoreSPH > 0) delete[] mySPHParticles;
1578 if(nStoreStar > 0) delete[] myStarParticles;
1579 delete[] nodeInterRemote;
1580 delete[] particleInterRemote;
1581 delete[] bucketReqs;
1582 delete[] ewt;
1583
1584 deleteTree();
1585
1586 if(boxes!= NULL ) delete[] boxes;
1587 if(splitDims != NULL) delete[] splitDims;
1588
1589#ifndef COOLING_NONE
1590 if(bGasCooling)
1591 CoolDerivsFinalize(CoolData);
1592#endif
1593 if (verbosity>1) ckout <<"Finished deallocation of treepiece "<<thisIndex<<endl;
1594 }
1595
1596 void setPeriodic(int nReplicas, Vector3D<cosmoType> fPeriod, int bEwald,
1597 double fEwCut, double fEwhCut, int bPeriod,
1598 int bComove, double dRhoFac);
1599 void BucketEwald(GenericTreeNode *req, int nReps,double fEwCut);
1600 void EwaldInit();
1601 void ewaldCPU(EwaldMsg *msg);
1602 void calculateEwald(EwaldMsg *m);
1603 void calculateEwaldUsingCkLoop(int yield_num);
1604 void callBucketEwald(int id);
1605 void doParallelNextBucketWork(int id, LoopParData* lpdata);
1606 void initCoolingData(const CkCallback& cb);
1607 void initLWData(const CkCallback& cb);
1608 // Scale velocities (needed to convert to canonical momenta for
1609 // comoving coordinates.)
1610 void velScale(double dScale, const CkCallback& cb);
1611
1615 void loadNChilada(const std::string& filename, const double dTuFac,
1616 const CkCallback& cb);
1617 void readFloatBinary(OutputParams& params, int bParaRead,
1618 const CkCallback& cb);
1625 void loadTipsy(const std::string& filename, const double dTuFac,
1626 const bool bDoublePos,
1627 const bool bDoubleVel,
1628 const CkCallback& cb);
1630 void readTipsyArray(OutputParams& params, const CkCallback& cb);
1631 void resetMetals(const CkCallback& cb);
1632 void getMaxIOrds(const CkCallback& cb);
1633 void RestartEnergy(double dTuFac, const CkCallback& cb);
1634 void findTotalMass(const CkCallback &cb);
1635 void recvTotalMass(CkReductionMsg *msg);
1636
1637 // Write a Tipsy file
1638 void writeTipsy(Tipsy::TipsyWriter& w,
1639 const double dvFac, // scale velocities
1640 const double duTFac, // convert temperature
1641 const bool bDoublePos,
1642 const bool bDoubleVel,
1643 const int bCool);
1644 // Find position in the file to start writing
1645 void setupWrite(int iStage, u_int64_t iPrevOffset,
1646 const std::string& filename, const double dTime,
1647 const double dvFac, const double duTFac,
1648 const bool bDoublePos,
1649 const bool bDoubleVel,
1650 const int bCool, const CkCallback& cb);
1651 // control parallelism in the write
1652 void parallelWrite(int iPass, const CkCallback& cb,
1653 const std::string& filename, const double dTime,
1654 const double dvFac, // scale velocities
1655 const double duTFac, // convert temperature
1656 const bool bDoublePos,
1657 const bool bDoubleVel,
1658 const int bCool);
1659 // serial output
1660 void serialWrite(u_int64_t iPrevOffset, const std::string& filename,
1661 const double dTime,
1662 const double dvFac, const double duTFac,
1663 const bool bDoublePos,
1664 const bool bDoubleVel,
1665 const int bCool, const CkCallback& cb);
1666 // setup for serial output
1667 void oneNodeWrite(int iIndex,
1668 int iOutParticles,
1669 int iOutSPH,
1670 int iOutStar,
1671 GravityParticle *particles, // particles to
1672 // write
1673 extraSPHData *pGas, // SPH data
1674 extraStarData *pStar, // Star data
1675 int *piSPH, // SPH data offsets
1676 int *piStar, // Star data offsets
1677 const u_int64_t iPrevOffset,
1678 const std::string& filename, // output file
1679 const double dTime, // time or expansion
1680 const double dvFac, // velocity conversion
1681 const double duTFac, // temperature
1682 // conversion
1683 const bool bDoublePos,
1684 const bool bDoubleVel,
1685 const int bCool,
1686 const CkCallback &cb);
1687 // Reorder for output
1688 void reOrder(int64_t nMaxOrder, const CkCallback& cb);
1689 // move particles around for output
1690 void ioShuffle(CkReductionMsg *msg);
1691 void ioAcceptSortedParticles(ParticleShuffleMsg *);
1694 void resetObjectLoad(const CkCallback& cb);
1695 // Assign keys after loading tipsy file and finding Bounding box
1696 void assignKeys(CkReductionMsg* m);
1697 void evaluateBoundaries(SFC::Key* keys, const int n, int isRefine, const CkCallback& cb);
1698 void unshuffleParticles(CkReductionMsg* m);
1699 void acceptSortedParticles(ParticleShuffleMsg *);
1700 void shuffleAfterQD();
1701 void unshuffleParticlesWoDD(const CkCallback& cb);
1702 void acceptSortedParticlesFromOther(ParticleShuffleMsg *);
1703 void setNumExpectedNeighborMsgs();
1704
1705 /*****ORB Decomposition*******/
1706 void initORBPieces(const CkCallback& cb);
1707 void initBeforeORBSend(unsigned int myCount, unsigned int myCountGas,
1708 unsigned int myCountStar,
1709 const CkCallback& cb, const CkCallback& cback);
1710 void sendORBParticles();
1711 void acceptORBParticles(const GravityParticle* particles, const int n);
1712 void acceptORBParticles(const GravityParticle* particles, const int n,
1713 const extraSPHData *pGas, const int nGasIn,
1714 const extraStarData *pStar, const int nStarIn);
1715 void finalizeBoundaries(ORBSplittersMsg *splittersMsg);
1716 void evaluateParticleCounts(ORBSplittersMsg *splittersMsg);
1717 /*****************************/
1718
1719 void kick(int iKickRung, double dDelta[MAXRUNG+1], int bClosing,
1720 int bNeedVPred, int bGasIsothermal, double dMaxEnergy, double duDelta[MAXRUNG+1],
1721 double gammam1, double dThermalCondSatCoeff,
1722 double dMultiPhaseMaxTime, double dMultiPhaseMinTemp, double dEvapCoeff, const CkCallback& cb);
1723 void drift(double dDelta, int bNeedVPred, int bGasIsothermal, double dvDelta,
1724 double duDelta, int nGrowMass, bool buildTree, double dMaxEnergy,
1725 const CkCallback& cb);
1726 void initAccel(int iKickRung, const CkCallback& cb);
1727#ifdef COOLING_MOLECULARH
1728 void distribLymanWerner(const CkCallback& cb);
1729#endif /*COOLING_MOLECULARH*/
1730
1731 void applyFrameAcc(int iKickRung, Vector3D<double> frameAcc, const CkCallback& cb);
1738 void externalForce(int activeRung, const ExternalForce& exForce, int bKepStep,
1739 const CkCallback& cb);
1740
1762#ifdef COLLISION
1763 void adjust(int iKickRung, int bCollStep, int bEpsAccStep,
1764 int bGravStep, int bKepStep, int bSphStep,
1765 int bViscosityLimitdt, double dEta, double dEtaCourant,
1766 double dEtauDot, double dDiffCoeff, double dEtaDiffusion,
1767 double dDelta, double dAccFac,
1768 double dCosmoFac, double dhMinOverSoft,
1769 double dResolveJeans,
1770 int bDoGas,
1771 const CkCallback& cb);
1772#else
1773 void adjust(int iKickRung, int bEpsAccStep,
1774 int bGravStep, int bSphStep,
1775 int bViscosityLimitdt, double dEta, double dEtaCourant,
1776 double dEtauDot, double dDiffCoeff, double dEtaDiffusion,
1777 double dDelta, double dAccFac,
1778 double dCosmoFac, double dhMinOverSoft,
1779 double dResolveJeans,
1780 int bDoGas,
1781 const CkCallback& cb);
1782#endif
1788 void truncateRung(int iCurrMaxRung, const CkCallback& cb);
1789 void rungStats(const CkCallback& cb);
1790 void countActive(int activeRung, const CkCallback& cb);
1792 void countType(int iType, const CkCallback& cb);
1793 void outputBlackHoles(const std::string& pszFileName, double dvFac,
1794 long lFPos, const CkCallback &cb);
1796 void SetSink(double dSinkMassMin, const CkCallback &cb);
1798 void SinkStep(int iCurrSinkRung, int iKickRung, const CkCallback &cb);
1799 void formSinks(int bJeans, double dJConst2, int bDensity,
1800 double dDensityCut, double dTime, int iKickRung, int bSimple,
1801 const CkCallback &cb);
1802 void emergencyAdjust(int iRung, double dDelta, double dDeltaThresh,
1803 const CkCallback &cb);
1804 void assignDomain(const CkCallback& cb);
1805 void starCenterOfMass(const CkCallback& cb);
1806 void calcEnergy(const CkCallback& cb);
1808 void newParticle(GravityParticle *p);
1809 void adjustTreePointers(GenericTreeNode *node, GravityParticle *newParts);
1811 void colNParts(const CkCallback &cb);
1813 void newOrder(const NewMaxOrder *nStarts, const int n, int bUseStoch, const CkCallback &cb) ;
1814
1816 void setNParts(int64_t _nTotalSPH, int64_t _nTotalDark,
1817 int64_t _nTotalStar, const CkCallback &cb);
1819 void setSoft(const double dSoft, const CkCallback &cb);
1820 void physicalSoft(const double dSoftMax, const double dFac,
1821 const int bSoftMaxMul, const CkCallback& cb);
1822 void growMass(int nGrowMass, double dDeltaM, const CkCallback& cb);
1823 void InitEnergy(double dTuFac, double z, double dTime, double gammam1,
1824 const CkCallback& cb);
1825 void updateuDot(int activeRung, double duDelta[MAXRUNG+1],
1826 double dStartTime[MAXRUNG+1], int bCool, int bAll,
1827 int bUpdateState, double gammam1, double dResolveJeans, const CkCallback& cb);
1828 void ballMax(int activeRung, double dFac, const CkCallback& cb);
1829 void sphViscosityLimiter(int bOn, int activeRung, const CkCallback& cb);
1830 void getAdiabaticGasPressure(double gamma, double gammam1, double dTuFac, double dThermalCondCoeff,
1831 double dThermalCond2Coeff, double dThermalCondSatCoeff, double dThermalCond2SatCoeff,
1832 double dEvapMinTemp, double dDtCourantFac, double dResolveJeans, const CkCallback &cb);
1833 void getCoolingGasPressure(double gamma, double gammam1, double dThermalCondCoeff,
1834 double dThermalCond2Coeff, double dThermalCondSatCoeff, double dThermalCond2SatCoeff,
1835 double dEvapMinTemp, double dDtCourantFac, double dResolveJeans, const CkCallback &cb);
1836#ifdef SPLITGAS
1837 void SplitGas(double dInitGasMass, const CkCallback& cb);
1838#endif
1839 inline COOL* Cool() {return dm->Cool;}
1840 inline LWDATA* LWData() {return dm->LWData;}
1842 void initRand(int iRand, const CkCallback &cb);
1843 void FormStars(Stfm param, double dTime, double dDelta, double dCosmoFac,
1844 const CkCallback& cb);
1845 void flushStarLog(const CkCallback& cb);
1846 void flushHMStarLog(const CkCallback& cb);
1847 void Feedback(const Fdbk &fb, double dTime, double dDelta,
1848 const CkCallback& cb);
1849 void massMetalsEnergyCheck(int bPreDist, const CkCallback& cb);
1850#ifdef COLLISION
1851 void delEjected(double dDelDist, const CkCallback& cb);
1852 void getNearCollPartners(const CkCallback& cb);
1853 void getCollInfo(const CkCallback& cb);
1854 void getCollInfo(int64_t iOrder, const CkCallback& cb);
1855 void logOverlaps(const CkCallback& cb);
1856 void resolveCollision(Collision coll, const ColliderInfo &c1, const ColliderInfo &c2,
1857 double baseStep, double timeNow, double dCentMass, const CkCallback& cb);
1858 void sameHigherRung(int64_t iord1, int rung1, int64_t iord2, int rung2, const CkCallback& cb);
1859 void resolveWallCollision(Collision coll, const ColliderInfo &c1, const CkCallback& cb);
1860 void unKickCollStep(int iKickRung, double dDeltaBase, const CkCallback& cb);
1861 void placeOnCollRung(int64_t iOrder, int collStepRung, const CkCallback& cb);
1862 void resetRungs(const CkCallback& cb);
1863 void getNeedCollStep(int collStepRung, const CkCallback& cb);
1864#endif
1865 void SetTypeFromFileSweep(int iSetMask, char *file,
1866 struct SortStruct *ss, int nss, int *pniOrder, int *pnSet);
1867 void setTypeFromFile(int iSetMask, char *file, const CkCallback& cb);
1868 void getCOM(const CkCallback& cb, int bLiveViz);
1869 void getCOMByType(int iType, const CkCallback& cb, int bLiveViz);
1870 void DumpFrame(InDumpFrame in, const CkCallback& cb, int liveVizDump) ;
1871 void liveVizDumpFrameInit(liveVizRequestMsg *msg);
1872 void setProjections(int bOn);
1873
1875#ifdef PUSH_GRAVITY
1876 void buildTree(int bucketSize, const CkCallback& cb, bool merge);
1877#else
1878 void buildTree(int bucketSize, const CkCallback& cb);
1879#endif
1880
1882 void startOctTreeBuild(CkReductionMsg* m);
1883 void recvBoundary(SFC::Key key, NborDir dir);
1884 void recvdBoundaries(CkReductionMsg* m);
1885
1886 /********ORB Tree**********/
1887 //void receiveBoundingBoxes(BoundingBoxes *msg);
1888 void startORBTreeBuild(CkReductionMsg* m);
1889 OrientedBox<float> constructBoundingBox(GenericTreeNode *node,int level, int numChild);
1890 void buildORBTree(GenericTreeNode * node, int level);
1891 /**************************/
1892
1894 bool sendFillReqNodeWhenNull(CkCacheRequestMsg<KeyType> *msg);
1896 void requestRemoteMoments(const Tree::NodeKey key, int sender);
1897 void receiveRemoteMoments(const Tree::NodeKey key, Tree::NodeType type,
1898 int firstParticle, int numParticles, int remIdx,
1899 const MultipoleMoments& moments, const OrientedBox<double>& box,
1900 const OrientedBox<double>& boxBall,
1901 const unsigned int iParticleTypes, const int64_t nSPH);
1902
1907 void calculateGravityLocal();
1910#ifdef CUDA
1911 void commenceCalculateGravityLocal(intptr_t d_localMoments,
1912 intptr_t d_localParts,
1913 intptr_t d_localVars,
1914 intptr_t streams, int numStreams,
1915 size_t sMoments, size_t sCompactParts, size_t sVarParts);
1916#else
1918#endif
1919
1924 void calculateGravityRemote(ComputeChunkMsg *msg);
1925 void executeCkLoopParallelization(LoopParData *lpdata, int startbucket,
1926 int yield_num, int chunkNum, State* gravityState);
1927 int doBookKeepingForTargetActive(int curbucket, int end, int chunkNum, bool
1928 updatestate, State* gravityState);
1929 int doBookKeepingForTargetInactive(int chunkNum, bool updatestate,
1930 State* gravityState);
1931
1933 void calculateSmoothLocal();
1934 void calculateReSmoothLocal();
1935 void calculateMarkSmoothLocal();
1936 void nextBucketSmooth(dummyMsg *msg);
1937 void nextBucketReSmooth(dummyMsg *msg);
1938 void nextBucketMarkSmooth(dummyMsg *msg);
1939#if INTERLIST_VER > 0
1940#if 0
1941 void calculateForceRemoteBucket(int bucketIndex, int chunk);
1942 void calculateForceLocalBucket(int bucketIndex);
1943#endif
1944#endif
1945
1951 void startGravity(int am, int bUseCpu_, double myTheta, const CkCallback& cb);
1953 void setupSmooth();
1961 void startSmooth(SmoothParams *p, int iLowhFix, int nSmooth,
1962 double dfBall2OverSoft2, const CkCallback &cb);
1963 void startReSmooth(SmoothParams *p, const CkCallback& cb);
1964 void startMarkSmooth(SmoothParams *p, const CkCallback& cb);
1965
1966 void finishNodeCache(const CkCallback& cb);
1967
1969 GenericTreeNode* requestNode(int remoteIndex, Tree::NodeKey lookupKey,
1970 int chunk, int reqID, int awi, void *source);
1973 void fillRequestNode(CkCacheRequestMsg<KeyType> *msg);
1978#if 0
1979 void receiveNode(GenericTreeNode &node, int chunk, unsigned int reqID);
1980#endif
1982 const GenericTreeNode* lookupNode(Tree::NodeKey key);
1984 const GravityParticle* lookupParticles(int begin);
1985
1988 void finishBucket(int iBucket);
1989
1996 void cachedWalkBucketTree(GenericTreeNode* node, int chunk, int reqID);
1997
1998#if INTERLIST_VER > 0
1999 void calculateForcesNode(OffsetNode node, GenericTreeNode *myNode,
2000 int level,int chunk);
2001 void calculateForces(OffsetNode node, GenericTreeNode *myNode,
2002 int level,int chunk);
2003#endif
2004
2005 ExternalGravityParticle *requestParticles(Tree::NodeKey key,int chunk,
2006 int remoteIndex,int begin,
2007 int end,int reqID, int awi,
2008 void *source);
2009 GravityParticle *requestSmoothParticles(Tree::NodeKey key, int chunk,
2010 int remoteIndex, int begin,int end,
2011 int reqID, int awi, void *source);
2012 void fillRequestParticles(CkCacheRequestMsg<KeyType> *msg);
2013 void fillRequestSmoothParticles(CkCacheRequestMsg<KeyType> *msg);
2014 void flushSmoothParticles(CkCacheFillMsg<KeyType> *msg);
2015 void processReqSmoothParticles();
2016
2017 void startlb(const CkCallback &cb, int activeRung, bool bDoLB);
2018 void setTreePieceLoad(int activeRung);
2019 void populateSavedPhaseData(int phase, double tpload, unsigned int activeparts);
2020 bool havePhaseData(int phase);
2021 void savePhaseData(std::vector<double> &loads, std::vector<unsigned int>
2022 &parts_per_phase, double* shuffleloads, unsigned int *shuffleparts,
2023 int shufflelen);
2024 void ResumeFromSync();
2025
2026 void outputASCII(OutputParams& params, int bParaWrite,
2027 const CkCallback& cb);
2028 void oneNodeOutVec(OutputParams& params, Vector3D<double>* avOut,
2029 int nPart, int iIndex, int bDone,
2030 const CkCallback& cb) ;
2031 void oneNodeOutArr(OutputParams& params, double* adOut,
2032 int nPart, int iIndex, int bDone,
2033 const CkCallback& cb) ;
2034 void oneNodeOutIntArr(OutputParams& params, int *aiOut,
2035 int nPart, int iIndex, const CkCallback& cb);
2036 void outputBinaryStart(OutputParams& params, int64_t nStart,
2037 const CkCallback& cb);
2038 void outputBinary(Ck::IO::Session, OutputParams& params);
2039 void minmaxNCOut(OutputParams& params, const CkCallback& cb);
2040
2041 void outputStatistics(const CkCallback& cb);
2043 void collectStatistics(const CkCallback &cb);
2044
2052 void nextBucket(dummyMsg *m);
2053 void nextBucketUsingCkLoop(dummyMsg *m);
2054
2055 void report();
2056 void printTreeViz(GenericTreeNode* node, std::ostream& os);
2057 void printTree(GenericTreeNode* node, std::ostream& os);
2058 void pup(PUP::er& p);
2059
2060 // jetley
2061 // need this in TreeWalk
2062 GenericTreeNode *getRoot() {return root;}
2063 // need this in Compute
2064 inline Vector3D<cosmoType> decodeOffset(int reqID) {
2065 int offsetcode = reqID >> 22;
2066 int x = (offsetcode & 0x7) - 3;
2067 int y = ((offsetcode >> 3) & 0x7) - 3;
2068 int z = ((offsetcode >> 6) & 0x7) - 3;
2069
2070 Vector3D<cosmoType> offset(x*fPeriod.x, y*fPeriod.y, z*fPeriod.z);
2071
2072 return offset;
2073 }
2074
2075 void receiveNodeCallback(GenericTreeNode *node, int chunk, int reqID, int awi, void *source);
2076 void receiveParticlesCallback(ExternalGravityParticle *egp, int num, int chunk, int reqID, Tree::NodeKey &remoteBucket, int awi, void *source);
2077 void receiveParticlesFullCallback(GravityParticle *egp, int num, int chunk, int reqID, Tree::NodeKey &remoteBucket, int awi, void *source);
2078
2079 void balanceBeforeInitialForces(const CkCallback &cb);
2080
2081 // For merging of remote moment requests
2082 // before sending messages during tree building
2083 public:
2084 void sendRequestForNonLocalMoments(GenericTreeNode *pickedNode);
2085 void mergeNonLocalRequestsDone();
2086 //void addTreeBuildMomentsClient(GenericTreeNode *targetNode, TreePiece *client, GenericTreeNode *clientNode);
2087 std::map<NodeKey,NonLocalMomentsClientList>::iterator createTreeBuildMomentsEntry(GenericTreeNode *pickedNode);
2088
2089
2090 private:
2091 // XXX - hashtable instead of map
2092 std::map<NodeKey,NonLocalMomentsClientList> nonLocalMomentsClients;
2093 bool localTreeBuildComplete;
2094 int getResponsibleIndex(int first, int last);
2095
2096
2097 GenericTreeNode *boundaryParentReady(GenericTreeNode *parent);
2098 void accumulateMomentsFromChild(GenericTreeNode *parent, GenericTreeNode *child);
2099
2100 void deliverMomentsToClients(GenericTreeNode *);
2101 void deliverMomentsToClients(const std::map<NodeKey,NonLocalMomentsClientList>::iterator &it);
2102 void treeBuildComplete();
2103 void processRemoteRequestsForMoments();
2104 void sendParticlesDuringDD(bool withqd);
2105 void mergeAllParticlesAndSaveCentroid();
2106 bool otherIdlePesAvail();
2107
2108};
2109
2112class LvArray : public CBase_LvArray {
2113 public:
2114 LvArray() {}
2115 LvArray(CkMigrateMessage* m) {}
2116 } ;
2117
2118int decodeReqID(int);
2119int encodeOffset(int reqID, int x, int y, int z);
2120bool bIsReplica(int reqID);
2121void printGenericTree(GenericTreeNode* node, std::ostream& os) ;
2122//bool compBucket(GenericTreeNode *ln,GenericTreeNode *rn);
2123
2124#ifdef REDUCTION_HELPER
2125
2126class TreePieceCounter : public CkLocIterator {
2127 public:
2128 TreePieceCounter() { reset(); }
2129 void addLocation(CkLocation &loc);
2130 void reset();
2131
2132 public:
2133 CkVec<TreePiece *> presentTreePieces;
2134};
2135
2136
2137
2138class ReductionHelper : public CBase_ReductionHelper {
2139 public:
2140 ReductionHelper();
2141 ReductionHelper(CkMigrateMessage *);
2142 void pup(PUP::er &p);
2143
2144 void countTreePieces(const CkCallback &cb);
2145 void reduceBinCounts(int nBins, int64_t *binCounts, const CkCallback &cb);
2146 void evaluateBoundaries(SFC::Key *keys, const int n, int isRefine, const CkCallback& cb);
2147 void evaluateBoundaries(const CkBitVector &binsToSplit, const CkCallback& cb);
2148
2149 private:
2150 void senseLocalTreePieces();
2151
2152 private:
2153
2154 CkVec<int64_t> myBinCounts;
2155 int numTreePiecesCheckedIn;
2156
2157 TreePieceCounter localTreePieces;
2158 std::vector<SFC::Key> splitters;
2159};
2160#endif
2161
2163class NonEmptyTreePieceCounter : public CkLocIterator {
2164 public:
2165 NonEmptyTreePieceCounter() { reset(); }
2166 void addLocation(CkLocation &loc);
2167 void reset();
2168
2169 public:
2170 int count;
2171};
2172
2173#endif //PARALLELGRAVITY_H
std::map< NodeKey, GenericTreeNode * > NodeLookupType
Definition GenericTreeNode.h:352
GenericTrees
Definition GenericTreeNode.h:995
void operator|(PUP::er &p, NodeType &nt)
PUP a NodeType.
Definition GenericTreeNode.h:1039
KeyType NodeKey
This key is the identification of a node inside the global tree, and it is unique for the node....
Definition GenericTreeNode.h:35
int decodeReqID(int)
Given a requestID, return the bucket number.
Definition TreePiece.cpp:3622
int verbosity
verbosity level. Higher is more verbose.
Definition ParallelGravity.cpp:66
bool bIsReplica(int reqID)
is this a periodic replica?
Definition TreePiece.cpp:3611
struct OffsetNodeStruct OffsetNode
Remote Cell interaction lists for all tree levels.
int DtToRung(double dDelta, double dTideal)
Given the size of the big step, and a desired timestep, return the rung of the largest timestep less ...
Definition ParallelGravity.h:390
double RungToDt(double dDelta, int iRung)
Given the size of the big step, and a rung, return the corresponding timestep size.
Definition ParallelGravity.h:404
struct particlesInfoR RemotePartInfo
Remote particles in an interaction list.
double PoverRhoFloorJeans(double dResolveJeans, GravityParticle *p)
Pressure floor to force Jeans length to be larger than the spatial resolution.
Definition ParallelGravity.h:414
int RungToSubsteps(int iRung)
Given a rung, return the number of substeps in one big step.
Definition ParallelGravity.h:383
void printGenericTree(GenericTreeNode *node, std::ostream &os)
Print a text version of a tree.
Definition TreePiece.cpp:6138
const int PHASE_FEEDBACK
slot in MultistepLB to hold feedback phase load information
Definition ParallelGravity.h:409
void CkMustAssert(bool cond, const char *err)
CkAssert() replacement works even in production mode.
Definition ParallelGravity.h:59
CkVec< UndecidedList > UndecidedLists
Vector of undecided lists, one for each level.
Definition ParallelGravity.h:658
LBStrategy
Load balancers that need the spatial information.
Definition ParallelGravity.h:69
const double GAMMA_JEANS
Adiabatic index to use with the Jeans pressure floor.
Definition ParallelGravity.h:436
struct particlesInfoL LocalPartInfo
Local particles in an interaction list.
CkQ< OffsetNode > CheckList
Queue of nodes to check for interactions.
Definition ParallelGravity.h:654
double dExtraStore
fraction of extra particle storage
Definition ParallelGravity.cpp:105
DomainsDec
Possible domain decomposition methods.
Definition ParallelGravity.h:90
const double ddTolerance
tolerance for unequal pieces in SFC based decompositions.
Definition ParallelGravity.h:108
unsigned int bucketSize
Definition ParallelGravity.cpp:130
int encodeOffset(int reqID, int x, int y, int z)
Given a bucket number and a periodic offset, encode these into one number.
Definition TreePiece.cpp:3631
CkVec< OffsetNode > UndecidedList
Vector of nodes that are undecided at this level.
Definition ParallelGravity.h:656
NborDir
Directions for sending boundaries.
Definition ParallelGravity.h:101
struct ewaldTable EWT
Coefficients for the Fourier space part of the Ewald sum.
struct LoopParDataStruct LoopParData
Data needed for the CkLoop intranode parallelization.
Object to bookkeep a Bucket Walk.
Definition GravityParticle.h:18
Used to pass information about collision partners between processes.
Definition collision.h:7
Base clase for all tree based computations.
Definition Compute.h:26
Class to count added and deleted particles.
Definition ParallelGravity.h:342
Definition DataManager.h:60
Cache interface to the Tree Nodes.
Definition CacheInterface.h:96
Cache interface to particles for the gravity calculation. This is a read-only cache of particles.
Definition CacheInterface.h:37
Cache interface to the particles for smooth calculations. This cache is a writeback cache.
Definition CacheInterface.h:73
Information needed to calculate gravity.
Definition GravityParticle.h:33
Fundamental type for a particle.
Definition GravityParticle.h:364
cosmoType fBall
Neighbor search radius for smoothing.
Definition GravityParticle.h:387
std::string getNCNextOutput(OutputParams &params)
Definition InOutput.cpp:2043
void restart(CkCheckpointStatusMsg *msg)
Callback to restart simulation after a checkpoint or after writing a checkpoint.
Definition ParallelGravity.cpp:2860
void waitForGravity(const CkCallback &cb, double startTime, int activeRung)
wait for gravity in the case of concurrent SPH
Definition ParallelGravity.cpp:1641
void loadBalance(int iPhase)
Perform load balance.
Definition ParallelGravity.cpp:1939
void updateuDot(int iActiveRung, const double duKick[], const double dStartTime[], int bUpdateState, int bAll)
Update time derivative of thermal energy.
Definition ParallelGravity.cpp:2095
void countActive(int activeRung)
determine number of active particles in the given rung
Definition ParallelGravity.cpp:4151
void updateSoft()
Change the softening in comoving coordinates.
Definition ParallelGravity.cpp:4202
void AGORAfeedbackPreCheck(double dTime, double dDelta, double dTimeToSF)
This routine is called when AGORA feedback is enabled. It checks for any star particles that will hav...
Definition feedback.cpp:193
void restartGas()
Read in array files for complete gas information.
Definition Sph.cpp:342
void getStartTime()
determine start time of simulation
Definition ParallelGravity.cpp:1447
void buildTree(int iPhase)
Build Tree.
Definition ParallelGravity.cpp:1974
void doSinks(double dTime, double dDelta, int iKickRung)
Process sink particles.
Definition sinks.cpp:867
void memoryStatsCache()
Definition ParallelGravity.cpp:4464
void growMass(double dTime, double dDelta)
Slowly increase mass of a subset of particles.
Definition ParallelGravity.cpp:4219
void starCenterOfMass()
Main::starCenterOfMass Calculates the total mass and center of mass of all the star particles and sav...
Definition ParallelGravity.cpp:3457
void doSph(int activeRung, int bNeedDensity=1)
Perform the SPH force calculation.
Definition Sph.cpp:712
Main(CkArgMsg *m)
Main routine to start simulation.
Definition ParallelGravity.cpp:225
void niceExit()
entry method to cleanly shutdown. Only used for debugging.
Definition ParallelGravity.cpp:1438
void writeOutput(int iStep)
Output a snapshot.
Definition ParallelGravity.cpp:3664
void emergencyAdjust(int iRung)
Change timesteps of particles experiencing sudden gas forces.
Definition ParallelGravity.cpp:4175
int adjust(int iKickRung)
Calculate timesteps of particles.
Definition ParallelGravity.cpp:4070
void initialForces()
Initial calculation of forces.
Definition ParallelGravity.cpp:3008
int ReadASCII(char *extension, int nDataPerLine, double *dDataOut)
function from PKDGRAV to read an ASCII table
Definition Sph.cpp:182
void advanceBigStep(int)
Take one base timestep of the simulation.
Definition ParallelGravity.cpp:2195
int bOutTime()
Return true if we need to write an output.
Definition ParallelGravity.cpp:1545
void addDelParticles()
Coalesce all added and deleted particles and update global quantities.
Definition ParallelGravity.cpp:4404
void domainDecomp(int iPhase)
Perform domain decomposition.
Definition ParallelGravity.cpp:1897
void outputBlackHoles(double dTime)
Output black hole orbit information.
Definition sinks.cpp:227
void SetSink()
Initial identify sinks.
Definition sinks.cpp:298
void FormSinks(double dTime, double dDelta, int iKickRung)
Form sink particles; main routine.
Definition sinks.cpp:353
void memoryStats()
Definition ParallelGravity.cpp:4450
void FormStars(double dTime, double dDelta)
Definition starform.cpp:174
void getOutTimes()
Read in desired output times and reshifts from a file.
Definition ParallelGravity.cpp:1562
void cbIOComplete(CkMessage *msg)
All IO has completed. Close the file.
Definition InOutput.cpp:2150
void outputBinary(OutputParams &params, int bParaWrite, const CkCallback &cb)
Output a Tipsy or NChilada XDR binary float array file.
Definition InOutput.cpp:1998
void externalForce(int iActiveRung)
Apply external gravitational field.
Definition ParallelGravity.cpp:2075
void doSIDM(double dTime, double dDelta, int activeRung)
Main method to perform Self Interacting Dark Matter interactions.
Definition SIDM.cpp:59
void startGravity(const CkCallback &cbGravity, int iActiveRung, double *startTime)
Routine to start self gravity; if gravity is not being calculated, then clear the accelerations.
Definition ParallelGravity.cpp:1999
void initSph()
initialize SPH quantities
Definition Sph.cpp:24
void doSimulation()
Principal method which does all the coordination of the simulation over timesteps.
Definition ParallelGravity.cpp:3106
void calcEnergy(double, double, const char *)
Calculate various energy and momentum quantities, and output them to a log file.
Definition ParallelGravity.cpp:3565
void cbIOClosed(CkMessage *msg)
File is closed. Update header for NChilada. Resume main program.
Definition InOutput.cpp:2158
void restartNSIDM()
Read in array files for SIDM interact count, if needed.
Definition SIDM.cpp:18
void setupICs()
Load particles into pieces.
Definition ParallelGravity.cpp:2465
void StellarFeedback(double dTime, double dDelta)
Definition feedback.cpp:270
void writeCollLog(const char *)
Write collision events in buffer to log file and clear the buffer.
Definition ParallelGravity.cpp:3540
void kick(bool bClosing, int iActiveRung, int nextMaxRung, const CkCallback &cbGravity, double gravStartTime)
Update velocities.
Definition ParallelGravity.cpp:2128
void cbIOReady(Ck::IO::SessionReadyMsg *msg)
Session is ready; write my data.
Definition InOutput.cpp:2143
void rungStats()
Count and print out the number of particles in each timestep bin.
Definition ParallelGravity.cpp:4131
void initCooling()
Initialize cooling constants and integration data structures.
Definition Sph.cpp:74
void cbOpen(Ck::IO::FileReadyMsg *msg)
Definition InOutput.cpp:2071
Class for new maxOrder broadcast.
Definition ParallelGravity.h:127
char * dim
Dimension of splits.
Definition ParallelGravity.h:298
int length
Number of splits.
Definition ParallelGravity.h:294
double * pos
Positions of splits.
Definition ParallelGravity.h:296
CkCallback cb
Callback for reduction of particle counts.
Definition ParallelGravity.h:300
Base class for optimizing walk actions.
Definition Opt.h:12
Base class for output parameters.
Definition InOutput.h:17
Message for shuffling particles during domain decomposition.
Definition ParallelGravity.h:307
basic random number generator This is implemented as an object so that it can easily be used in threa...
Definition rand.h:9
Super class for Smooth and Resmooth computation.
Definition smooth.h:79
A base class from which parameters for all smooth operations can be derived.
Definition smoothparams.h:9
Base class for maintaining the state of a tree walk.
Definition State.h:6
Fundamental structure that holds particle and tree data.
Definition ParallelGravity.h:755
void outputBinary(Ck::IO::Session, OutputParams &params)
Output a Tipsy XDR binary float array file.
Definition InOutput.cpp:2298
void pup(PUP::er &p)
@TODO Fix pup routine to handle correctly the tree
Definition TreePiece.cpp:5782
void newParticle(GravityParticle *p)
add new particle
Definition TreePiece.cpp:2167
void flushStarLog(const CkCallback &cb)
flush starlog table to disk.
Definition starform.cpp:586
void Feedback(const Fdbk &fb, double dTime, double dDelta, const CkCallback &cb)
Definition feedback.cpp:382
void setNParts(int64_t _nTotalSPH, int64_t _nTotalDark, int64_t _nTotalStar, const CkCallback &cb)
Update total particle numbers.
Definition TreePiece.cpp:2347
const GravityParticle * lookupParticles(int begin)
Find the particles starting at "begin", and return a pointer to it.
Definition TreePiece.cpp:5558
void evaluateParticleCounts(ORBSplittersMsg *splittersMsg)
Evaluate particle counts for ORB decomposition.
Definition TreePiece.cpp:469
void EwaldGPU()
Transfer Ewald data to GPU memory and launch EwaldHost kernel.
Definition Ewald.cpp:387
void calculateRemoteMoments(GenericTreeNode *node)
void startRemoteChunk()
Start a new remote computation upon prefetch finished.
Definition TreePiece.cpp:5397
void adjustTreePointers(GenericTreeNode *node, GravityParticle *newParts)
Adjust particlePointer attribute of all the nodes in the tree.
Definition TreePiece.cpp:2151
void startOctTreeBuild(CkReductionMsg *m)
Real tree build, independent of other TreePieces.
Definition TreePiece.cpp:3022
int64_t nTotalStar
Total Star Particles.
Definition ParallelGravity.h:1119
void requestRemoteMoments(const Tree::NodeKey key, int sender)
Request the moments for this node.
Definition TreePiece.cpp:3358
void calculateGravityRemote(ComputeChunkMsg *msg)
Definition TreePiece.cpp:4310
void setupWrite(int iStage, u_int64_t iPrevOffset, const std::string &filename, const double dTime, const double dvFac, const double duTFac, const bool bDoublePos, const bool bDoubleVel, const int bCool, const CkCallback &cb)
Find starting offsets and begin parallel write.
Definition InOutput.cpp:1051
void getMaxIOrds(const CkCallback &cb)
return maximum iOrders. Like the above, but the file has already been read
Definition InOutput.cpp:338
void report()
Write a file containing a graphviz dot graph of my tree.
Definition TreePiece.cpp:6116
void initBuckets()
Definition TreePiece.cpp:3659
void outputBinaryStart(OutputParams &params, int64_t nStart, const CkCallback &cb)
Determine start offsets for this piece based on previous pieces.
Definition InOutput.cpp:2115
void finalizeBoundaries(ORBSplittersMsg *splittersMsg)
Determine my boundaries at the end of ORB decomposition.
Definition TreePiece.cpp:405
void finishSmoothWalk()
Called when smooth walk on all TreePieces is done.
Definition smooth.cpp:702
void startNextBucket()
Start the treewalk for the next bucket among those belonging to me. The buckets are simply ordered in...
Definition TreePiece.cpp:3702
void readTipsyArray(OutputParams &params, const CkCallback &cb)
read a tipsy array file (binary or ascii)
Definition InOutput.cpp:355
void startSmooth(SmoothParams *p, int iLowhFix, int nSmooth, double dfBall2OverSoft2, const CkCallback &cb)
Definition smooth.cpp:339
void SetSink(double dSinkMassMin, const CkCallback &cb)
set sink type based on formation time.
Definition sinks.cpp:313
void addToNodeInterRemote(int chunk, int howmany)
accumulate node interaction count for statistics
Definition ParallelGravity.h:860
void initBeforeORBSend(unsigned int myCount, unsigned int myCountGas, unsigned int myCountStar, const CkCallback &cb, const CkCallback &cback)
Definition TreePiece.cpp:244
GenericTreeNode * requestNode(int remoteIndex, Tree::NodeKey lookupKey, int chunk, int reqID, int awi, void *source)
Retrieve the remote node, goes through the cache if present.
Definition TreePiece.cpp:5562
GenericTreeNode * getStartAncestor(int current, int previous, GenericTreeNode *dflt)
return the largest node which contains current bucket, but which does not contain previous bucket....
Definition TreePiece.cpp:4757
void startGravity(int am, int bUseCpu_, double myTheta, const CkCallback &cb)
Start a tree based gravity computation.
Definition TreePiece.cpp:5023
void checkTree(GenericTreeNode *node)
Definition TreePiece.cpp:5930
void initRand(int iRand, const CkCallback &cb)
initialize random seed for star formation
Definition starform.cpp:165
void startlb(const CkCallback &cb, int activeRung, bool bDoLB)
Save piece loads and call AtSync() if we should load balance.
Definition TreePiece.cpp:5490
void assignKeys(CkReductionMsg *m)
After the bounding box has been found, we can assign keys to the particles.
Definition TreePiece.cpp:126
void printTreeViz(GenericTreeNode *node, std::ostream &os)
Print a graphviz version of A tree.
Definition TreePiece.cpp:6061
int64_t nTotalDark
Total Dark Particles.
Definition ParallelGravity.h:1117
void initORBPieces(const CkCallback &cb)
Initialize stuff before doing ORB decomposition.
Definition TreePiece.cpp:205
void formSinks(int bJeans, double dJConst2, int bDensity, double dDensityCut, double dTime, int iKickRung, int bSimple, const CkCallback &cb)
Form sink particles: per processor routine.
Definition sinks.cpp:420
void getBucketsBeneathBounds(GenericTreeNode *&node, int &start, int &end)
get range of bucket numbers beneath a given TreeNode.
Definition TreePiece.cpp:6463
void commenceCalculateGravityLocal()
Entry method wrapper for calculateGravityLocal If using the GPU, this TreePiece is assigned a cudaStr...
Definition TreePiece.cpp:5387
void addToNodeInterLocal(int howmany)
accumulate node interaction count for statistics
Definition ParallelGravity.h:870
void readFloatBinary(OutputParams &params, int bParaRead, const CkCallback &cb)
Definition InOutput.cpp:960
void physicalSoft(const double dSoftMax, const double dFac, const int bSoftMaxMul, const CkCallback &cb)
Adjust comoving softening to maintain constant physical softening.
Definition TreePiece.cpp:2373
void flushHMStarLog(const CkCallback &cb)
flush hmstarlog table to disk
Definition starform.cpp:606
void receiveRemoteMoments(const Tree::NodeKey key, Tree::NodeType type, int firstParticle, int numParticles, int remIdx, const MultipoleMoments &moments, const OrientedBox< double > &box, const OrientedBox< double > &boxBall, const unsigned int iParticleTypes, const int64_t nSPH)
response from requestRemoteMoments
Definition TreePiece.cpp:3428
void loadTipsy(const std::string &filename, const double dTuFac, const bool bDoublePos, const bool bDoubleVel, const CkCallback &cb)
Load I.C. from Tipsy file.
Definition InOutput.cpp:183
void addToParticleInterRemote(int chunk, int howmany)
accumulate particle interaction count for statistics
Definition ParallelGravity.h:865
void setTreePieceLoad(int activeRung)
Sets the load of the TreePiece object based on the rung.
Definition TreePiece.cpp:5466
void calculateSmoothLocal()
As above but for the Smooth operation.
Definition smooth.cpp:413
void countType(int iType, const CkCallback &cb)
count total number of particles of given type
Definition TreePiece.cpp:1956
void continueStartRemoteChunk(int chunk)
Main work of StartRemoteChunk() Schedule a TreePiece::calculateGravityRemote() then start prefetching...
Definition TreePiece.cpp:5428
void fillRequestNode(CkCacheRequestMsg< KeyType > *msg)
Receive a request for Nodes from a remote processor, copy the data into it, and send back a message.
Definition CacheInterface.cpp:440
void markSmoothWalkDone()
Called when smooth walk on the current TreePiece is done.
Definition smooth.cpp:694
GravityParticle * getParticles()
Return the pointer to the particles on this TreePiece.
Definition ParallelGravity.h:891
void parallelWrite(int iPass, const CkCallback &cb, const std::string &filename, const double dTime, const double dvFac, const double duTFac, const bool bDoublePos, const bool bDoubleVel, const int bCool)
Control the parallelism in the tipsy output by breaking it up into nIOProcessor pieces.
Definition InOutput.cpp:1115
void nextBucket(dummyMsg *m)
Entry method used to split the processing of all the buckets in small pieces. It calls startNextBucke...
Definition TreePiece.cpp:3983
void finishWalk()
Called when walk on all TreePieces is done.
Definition TreePiece.cpp:6431
void ioAcceptSortedParticles(ParticleShuffleMsg *)
Accept particles from other TreePieces once the sorting has finished.
Definition InOutput.cpp:1629
void colNParts(const CkCallback &cb)
Count add/deleted particles, and compact main particle storage.
Definition TreePiece.cpp:2245
bool nodeOwnership(const Tree::NodeKey nkey, int &firstOwner, int &lastOwner)
Definition TreePiece.cpp:3236
void deleteTree()
delete treenodes if allocated
Definition ParallelGravity.h:1380
bool(* compFuncPtr[3])(GravityParticle, GravityParticle)
Array of comparison function pointers.
Definition ParallelGravity.h:1349
void updateuDot(int activeRung, double duDelta[MAXRUNG+1], double dStartTime[MAXRUNG+1], int bCool, int bAll, int bUpdateState, double gammam1, double dResolveJeans, const CkCallback &cb)
Update the cooling rate (uDot)
Definition Sph.cpp:860
void resetMetals(const CkCallback &cb)
Set total metals based on Ox and Fe mass fractions.
Definition Sph.cpp:322
double dStartTime
Time read in from input file.
Definition ParallelGravity.h:1066
void newOrder(const NewMaxOrder *nStarts, const int n, int bUseStoch, const CkCallback &cb)
Assign iOrders to recently added particles.
Definition TreePiece.cpp:2299
void FormStars(Stfm param, double dTime, double dDelta, double dCosmoFac, const CkCallback &cb)
Definition starform.cpp:219
void serialWrite(u_int64_t iPrevOffset, const std::string &filename, const double dTime, const double dvFac, const double duTFac, const bool bDoublePos, const bool bDoubleVel, const int bCool, const CkCallback &cb)
Serial output of tipsy file.
Definition InOutput.cpp:1160
int64_t nTotalSPH
Total Gas Particles.
Definition ParallelGravity.h:1115
void collectStatistics(const CkCallback &cb)
Collect the total statistics from the various chares.
Definition TreePiece.cpp:6197
void evaluateBoundaries(SFC::Key *keys, const int n, int isRefine, const CkCallback &cb)
Definition TreePiece.cpp:592
void loadNChilada(const std::string &filename, const double dTuFac, const CkCallback &cb)
Load I.C. from NChilada file.
Definition InOutput.cpp:843
void emergencyAdjust(int iRung, double dDelta, double dDeltaThresh, const CkCallback &cb)
Look for gas particles reporting small new timesteps and move their timesteps down,...
Definition TreePiece.cpp:1976
void doAllBuckets()
Start a full step of bucket computation, it sends a message to trigger nextBucket() which will loop o...
Definition TreePiece.cpp:3939
void printTree(GenericTreeNode *node, std::ostream &os)
Print a text version of a tree.
Definition TreePiece.cpp:6005
void EwaldGPUComplete()
Callback for EwaldGPU. Clean up device memory + host buffer and call finishBucket.
Definition Ewald.cpp:533
void truncateRung(int iCurrMaxRung, const CkCallback &cb)
Truncate the highest rung.
Definition TreePiece.cpp:1911
GenericTreeNode * keyToNode(const Tree::NodeKey k)
convert a key to a node using the nodeLookupTable
Definition ParallelGravity.h:1055
bool sendFillReqNodeWhenNull(CkCacheRequestMsg< KeyType > *msg)
When the node is found to be NULL, forward the request.
Definition TreePiece.cpp:3300
void unshuffleParticles(CkReductionMsg *m)
Definition TreePiece.cpp:1006
void externalForce(int activeRung, const ExternalForce &exForce, int bKepStep, const CkCallback &cb)
Apply an external force.
Definition externalForce.cpp:111
void acceptSortedParticles(ParticleShuffleMsg *)
Accept particles from other TreePieces once the sorting has finished.
Definition TreePiece.cpp:1183
void outputBlackHoles(const std::string &pszFileName, double dvFac, long lFPos, const CkCallback &cb)
processor specific routine to output black hole orbits.
Definition sinks.cpp:263
void ioShuffle(CkReductionMsg *msg)
Perform the shuffle for reOrder.
Definition InOutput.cpp:1525
void addToParticleInterLocal(int howmany)
accumulate particle interaction count for statistics
Definition ParallelGravity.h:875
int getNumParticles()
Return the number of particles on this TreePiece.
Definition ParallelGravity.h:886
void SinkStep(int iCurrSinkRung, int iKickRung, const CkCallback &cb)
set sink timesteps.
Definition sinks.cpp:333
void cachedWalkBucketTree(GenericTreeNode *node, int chunk, int reqID)
Routine which does the tree walk on non-local nodes. It is called back for every incoming node (which...
void massMetalsEnergyCheck(int bPreDist, const CkCallback &cb)
total feedback quantities for conservation check
Definition feedback.cpp:1125
void buildTree(int bucketSize, const CkCallback &cb)
Charm entry point to build the tree (called by Main).
Definition TreePiece.cpp:2621
void calculateGravityLocal()
This function could be replaced by the doAllBuckets() call.
Definition TreePiece.cpp:4185
void initiatePrefetch(int chunk)
Definition TreePiece.cpp:5335
void reOrder(int64_t nMaxOrder, const CkCallback &cb)
Reorder particles for output.
Definition InOutput.cpp:1478
void oneNodeWrite(int iIndex, int iOutParticles, int iOutSPH, int iOutStar, GravityParticle *particles, extraSPHData *pGas, extraStarData *pStar, int *piSPH, int *piStar, const u_int64_t iPrevOffset, const std::string &filename, const double dTime, const double dvFac, const double duTFac, const bool bDoublePos, const bool bDoubleVel, const int bCool, const CkCallback &cb)
write out the particles I have been sent
Definition InOutput.cpp:1214
void markWalkDone()
Called when walk on the current TreePiece is done.
Definition TreePiece.cpp:6412
void setupSmooth()
Setup utility function for all the smooths. Initializes caches.
Definition smooth.cpp:316
void SetTypeFromFileSweep(int iSetMask, char *file, struct SortStruct *ss, int nss, int *pniOrder, int *pnSet)
Read file of iOrders to set particle type.
Definition TreePiece.cpp:2481
void initCoolingData(const CkCallback &cb)
Definition Sph.cpp:153
void resetObjectLoad(const CkCallback &cb)
Set the load balancing data after a restart from checkpoint.
Definition TreePiece.cpp:697
void calculateEwald(EwaldMsg *m)
Start the ewald calculation on this TreePiece.
Definition TreePiece.cpp:4223
const GenericTreeNode * lookupNode(Tree::NodeKey key)
Receive the node from the cache as following a previous request which returned NULL,...
Definition TreePiece.cpp:5554
void finishNodeCache(const CkCallback &cb)
We are done with the node Cache.
Definition TreePiece.cpp:4780
void flushSmoothParticles(CkCacheFillMsg< KeyType > *msg)
Definition CacheInterface.cpp:310
void finishBucket(int iBucket)
Check if we have done with the treewalk on a specific bucket, and if we have, check also if we are do...
Definition TreePiece.cpp:3793
void assignDomain(const CkCallback &cb)
assign domain number to each particle for diagnostic
Definition TreePiece.cpp:2016
void setSoft(const double dSoft, const CkCallback &cb)
Set the gravitational softening on all particles.
Definition TreePiece.cpp:2359
int64_t nTotalParticles
Total Particles in the simulation.
Definition ParallelGravity.h:1113
void adjust(int iKickRung, int bEpsAccStep, int bGravStep, int bSphStep, int bViscosityLimitdt, double dEta, double dEtaCourant, double dEtauDot, double dDiffCoeff, double dEtaDiffusion, double dDelta, double dAccFac, double dCosmoFac, double dhMinOverSoft, double dResolveJeans, int bDoGas, const CkCallback &cb)
Definition TreePiece.cpp:1736
Base class for walking trees.
Definition TreeWalk.h:11
Base class for tree nodes.
Definition GenericTreeNode.h:59
int rungs
Definition GenericTreeNode.h:122
int lastParticle
An index to the last particle contained by this node, myNumParticles+1 means outside the node.
Definition GenericTreeNode.h:108
GravityParticle * particlePointer
Pointer to the first particle in this node.
Definition GenericTreeNode.h:117
int firstParticle
An index for the first particle contained by this node, 0 means outside the node.
Definition GenericTreeNode.h:106
Utility to pool allocations of tree nodes.
Definition GenericTreeNode.h:332
Message to efficiently start entry methods with no arguments.
Definition ParallelGravity.h:213
Extra data needed for SPH.
Definition GravityParticle.h:51
Extra data needed for Stars.
Definition GravityParticle.h:250
struct CompactPartData CompactPartData
Particle data needed on the GPU to calculate gravity.
Particle data needed on the GPU to calculate gravity.
Definition cuda_typedef.h:240
Version of MultipoleMoments using cudatype.
Definition cuda_typedef.h:104
Global simulation parameters for dumpframe.
Definition dumpframe.h:209
structure to hold information specific to GPU Ewald
Definition EwaldCUDA.h:51
Definition ParallelGravity.h:336
Data needed for the CkLoop intranode parallelization.
Definition ParallelGravity.h:693
CkVec< CkVec< RemotePartInfo > > rpilists
Remote particle interactions.
Definition ParallelGravity.h:699
CkVec< CkVec< OffsetNode > > clists
Cell interactions.
Definition ParallelGravity.h:698
CkVec< int > chunkids
remote walk chunk number
Definition ParallelGravity.h:697
CkVec< CkVec< LocalPartInfo > > lpilists
Local particle interactions.
Definition ParallelGravity.h:700
CkVec< int > bucketids
startBucket number
Definition ParallelGravity.h:696
TreePiece * tp
Treepiece that owns this data.
Definition ParallelGravity.h:701
CkVec< GenericTreeNode * > lowNodes
Definition ParallelGravity.h:694
client that has requested a moment.
Definition ParallelGravity.h:721
Remote Cell interaction lists for all tree levels.
Definition ParallelGravity.h:647
Particle data that gets calculated by the GPU.
Definition cuda_typedef.h:268
Coefficients for the Fourier space part of the Ewald sum.
Definition ParallelGravity.h:636
Local particles in an interaction list.
Definition ParallelGravity.h:675
Remote particles in an interaction list.
Definition ParallelGravity.h:662