-
Notifications
You must be signed in to change notification settings - Fork 28
/
ParallelGravity.cpp
4661 lines (4229 loc) · 164 KB
/
ParallelGravity.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* @mainpage ChaNGa: Charm++ N-body Gravity
*
* For internal documentation of the operation of this code please see the
* following classes:
*
* Main: Overall control flow of the program.
*
* TreePiece: Structure that holds the particle data and tree
* structure in each object.
*
* Sorter: Organize domain decomposition.
*
* DataManager: Organize data across processors.
*
* Tree::GenericTreeNode: Interface for the tree data structure.
*
* GravityParticle: Per particle data structure.
*/
#include <stdint.h>
#include <iostream>
#include <unistd.h>
#include <sys/param.h>
#include <sys/stat.h>
// Debug floating point problems
// #include <fenv.h>
#include "BaseLB.h"
#include "CkLoopAPI.h"
#include "Sorter.h"
#include "ParallelGravity.h"
#include "DataManager.h"
#include "IntraNodeLBManager.h"
#include "TipsyFile.h"
#include "param.h"
#include "smooth.h"
#include "Sph.h"
#include "starform.h"
#include "feedback.h"
#include "SIDM.h"
#include "externalForce.h"
#include "formatted_string.h"
#include "PETreeMerger.h"
#ifdef COLLISION
#include "collision.h"
#endif
#ifdef CUDA
// for default per-list parameters
#include "cuda_typedef.h"
#endif
extern char *optarg;
extern int optind, opterr, optopt;
extern const char * const Cha_CommitID;
using namespace std;
/// @brief Proxy for Charm Main Chare
CProxy_Main mainChare;
/// @brief verbosity level. Higher is more verbose.
int verbosity;
int bVDetails;
CProxy_TreePiece treeProxy; ///< Proxy for the TreePiece chare array
#ifdef REDUCTION_HELPER
CProxy_ReductionHelper reductionHelperProxy;
#endif
CProxy_LvArray lvProxy; ///< Proxy for the liveViz array
CProxy_LvArray smoothProxy; ///< Proxy for smooth reductions
CProxy_LvArray gravityProxy; ///< Proxy for gravity reductions
/// @brief Proxy for the gravity particle cache group.
CProxy_CkCacheManager<KeyType> cacheGravPart;
/// @brief Proxy for the smooth particle cache group.
CProxy_CkCacheManager<KeyType> cacheSmoothPart;
/// @brief Proxy for the tree node cache group.
CProxy_CkCacheManager<KeyType> cacheNode;
/// @brief Proxy for the DataManager
CProxy_DataManager dMProxy;
/// @brief Proxy for Managing IntraNode load balancing with ckloop.
CProxy_IntraNodeLBManager nodeLBMgrProxy;
/// @brief Proxy for the dumpframe image data (DumpFrameData).
CProxy_DumpFrameData dfDataProxy;
/// @brief Proxy for the PETreeMerger group.
CProxy_PETreeMerger peTreeMergerProxy;
/// @brief Use the cache (always on)
bool _cache;
/// @brief Disable the cache (always off)
int _nocache;
/// @brief Size of a Node Cache line, specified by how deep in the
/// tree it goes.
int _cacheLineDepth;
/// @brief The number of buckets to process in the local gravity walk
/// before yielding the processor.
unsigned int _yieldPeriod;
/// @brief The type of domain decomposition to use.
DomainsDec domainDecomposition;
double dExtraStore; ///< fraction of extra particle storage
double dMaxBalance; ///< Max piece imbalance for load balancing
double dFracLoadBalance; ///< Min fraction of particles active
/// for doing load balancing.
double dGlassDamper; // Damping inverse timescale for making glasses
int iGasModel; ///< For backward compatibility
int peanoKey;
/// @brief type of tree to use.
GenericTrees useTree;
/// @brief A potentially optimized proxy for the tree pieces. Its use
/// is deprecated.
CProxy_TreePiece streamingProxy;
/// @brief Number of pieces into which to divide the tree.
unsigned int numTreePieces;
#ifdef CUDA
/// @brief Number of CUDA streams to use
unsigned int numStreams;
#endif
/// @brief Number of particles per TreePiece. Used to determine the
/// number of TreePieces.
unsigned int particlesPerChare;
int nIOProcessor; ///< Number of pieces to be doing I/O at once
int _prefetch; ///< Prefetch nodes for the remote walk
int _numChunks; ///< number of chunks into which to
/// split the remote walk.
int _randChunks; ///< Randomize the chunks for the
/// remote walk.
unsigned int bucketSize; ///< Maximum number of particles in a bucket.
/// @brief Use Ckloop for node parallelization.
int bUseCkLoopPar;
//jetley
/// GPU related settings.
int localNodesPerReq;
int remoteNodesPerReq;
int remoteResumeNodesPerReq;
int localPartsPerReq;
int remotePartsPerReq;
int remoteResumePartsPerReq;
// multi-stepping particle transfer strategy
// switch threshold
double largePhaseThreshold;
cosmoType theta; ///< BH-like opening criterion
cosmoType thetaMono; ///< Criterion of excepting monopole
/// only cells.
/// @brief Boundary evaluation user event (for Projections tracing).
int boundaryEvaluationUE;
int START_REG;
int START_IB;
int START_PW;
/// @brief Weight balancing during Oct decomposition user event (for Projections tracing).
int weightBalanceUE;
int networkProgressUE;
int nodeForceUE;
int partForceUE;
int tbFlushRequestsUE;
int prefetchDoneUE;
CkGroupID dataManagerID;
CkArrayID treePieceID;
#ifdef PUSH_GRAVITY
#include "ckmulticast.h"
CkGroupID ckMulticastGrpId;
#endif
CProxy_ProjectionsControl prjgrp;
/* The following is for backward compatibility and deprecated */
#define GASMODEL_UNSET -1
enum GasModel {
GASMODEL_ADIABATIC,
GASMODEL_ISOTHERMAL,
GASMODEL_COOLING,
GASMODEL_GLASS
};
int doDumpLB;
int lbDumpIteration;
int doSimulateLB;
/// Number of bins to use for the first iteration
/// of every Oct decomposition step
int numInitDecompBins;
/// Specifies the number of sub-bins a bin is split into
/// for Oct decomposition
int octRefineLevel;
void _Leader(void) {
puts("USAGE: ChaNGa [SETTINGS | FLAGS] [PARAM_FILE]");
puts("PARAM_FILE: Configuration file of a particular simulation, which");
puts(" includes desired settings and relevant input and");
puts(" output files. Settings specified in this file override");
puts(" the default settings.");
puts("SETTINGS");
puts("or FLAGS: Command line settings or flags for a simulation which");
puts(" will override any defaults and any settings or flags");
puts(" specified in the PARAM_FILE.");
}
void _Trailer(void) {
puts("(see the web page at\nhttps://github.com/N-BodyShop/changa/wiki\nfor more information)");
}
int killAt;
int cacheSize;
///
/// @brief Main routine to start simulation.
///
/// This routine parses the command line and file specified parameters,
/// and allocates the charm structures. The charm "readonly" variables
/// are writable in this method, and are broadcast globally once this
/// method exits. Note that the method finishes with an asynchronous
/// call to setupICs().
///
Main::Main(CkArgMsg* m) {
args = m;
_cache = true;
mainChare = thishandle;
bIsRestarting = 0;
bHaveAlpha = 0;
bChkFirst = 1;
dSimStartTime = CkWallTimer();
int threadNum = CkMyNodeSize();
// Floating point exceptions.
// feenableexcept(FE_OVERFLOW | FE_DIVBYZERO | FE_INVALID);
START_REG = traceRegisterUserEvent("Register");
START_IB = traceRegisterUserEvent("Init Buckets");
START_PW = traceRegisterUserEvent("Prefetch Walk");
boundaryEvaluationUE = traceRegisterUserEvent("Evaluating Boudaries");
weightBalanceUE = traceRegisterUserEvent("Weight Balancer");
networkProgressUE = traceRegisterUserEvent("CmiNetworkProgress");
nodeForceUE = traceRegisterUserEvent("Node interaction");
partForceUE = traceRegisterUserEvent("Particle interaction");
#ifdef HAPI_TRACE
traceRegisterUserEvent("Tree Serialization", CUDA_SER_TREE);
traceRegisterUserEvent("List Serialization", CUDA_SER_LIST);
traceRegisterUserEvent("Ser Local Walk", SER_LOCAL_WALK);
traceRegisterUserEvent("Ser Local Gather", SER_LOCAL_GATHER);
traceRegisterUserEvent("Ser Local Trans", SER_LOCAL_TRANSFORM);
traceRegisterUserEvent("Ser Local Memcpy", SER_LOCAL_MEMCPY);
traceRegisterUserEvent("Xfer Local", CUDA_XFER_LOCAL);
traceRegisterUserEvent("Xfer Remote", CUDA_XFER_REMOTE);
traceRegisterUserEvent("Grav Local", CUDA_GRAV_LOCAL);
traceRegisterUserEvent("Grav Remote", CUDA_GRAV_REMOTE);
traceRegisterUserEvent("Remote Resume", CUDA_REMOTE_RESUME);
traceRegisterUserEvent("Part Gravity Local", CUDA_PART_GRAV_LOCAL);
traceRegisterUserEvent("Part Gravity Local Small", CUDA_PART_GRAV_LOCAL_SMALL);
traceRegisterUserEvent("Part Gravity Remote", CUDA_PART_GRAV_REMOTE);
traceRegisterUserEvent("Xfer Back", CUDA_XFER_BACK);
traceRegisterUserEvent("Ewald", CUDA_EWALD);
#endif
tbFlushRequestsUE = traceRegisterUserEvent("TreeBuild::buildOctTree::flushRequests");
prefetchDoneUE = traceRegisterUserEvent("PrefetchDone");
prmInitialize(&prm,_Leader,_Trailer);
csmInitialize(¶m.csm);
param.dDelta = 0.0;
prmAddParam(prm, "dDelta", paramDouble, ¶m.dDelta,
sizeof(double),"dt", "Base Timestep for integration");
param.iMaxRung = MAXRUNG;
prmAddParam(prm, "iMaxRung", paramInt, ¶m.iMaxRung,
sizeof(int),"mrung", "Maximum timestep rung (IGNORED)");
param.nSteps = 1;
prmAddParam(prm, "nSteps", paramInt, ¶m.nSteps,
sizeof(int),"n", "Number of Timesteps");
param.iStartStep = 0;
prmAddParam(prm, "iStartStep", paramInt, ¶m.iStartStep,
sizeof(int),"nstart", "Initial step numbering");
param.iWallRunTime = 0;
prmAddParam(prm,"iWallRunTime",paramInt,¶m.iWallRunTime,
sizeof(int),"wall",
"<Maximum Wallclock time (in minutes) to run> = 0 = infinite");
killAt = 0;
prmAddParam(prm, "killAt", paramInt, &killAt,
sizeof(int),"killat", "Stop the simulation after this step");
param.bEpsAccStep = 1;
prmAddParam(prm, "bEpsAccStep", paramBool, ¶m.bEpsAccStep,
sizeof(int),"epsacc", "Use sqrt(eps/a) timestepping");
param.bKepStep = 0;
prmAddParam(prm, "bKepStep", paramBool, ¶m.bKepStep,
sizeof(int),"kepstep",
"Use pericenter distance timestepping");
param.bGravStep = 0;
prmAddParam(prm, "bGravStep", paramBool, ¶m.bGravStep,
sizeof(int),"gravstep",
"Use gravity interaction timestepping");
param.dEta = 0.03;
prmAddParam(prm, "dEta", paramDouble, ¶m.dEta,
sizeof(double),"eta", "Time integration accuracy");
param.bCannonical = 1;
prmAddParam(prm, "bCannonical", paramBool, ¶m.bCannonical,
sizeof(int),"can", "Cannonical Comoving eqns (IGNORED)");
param.bKDK = 1;
prmAddParam(prm, "bKDK", paramBool, ¶m.bKDK,
sizeof(int),"kdk", "KDK timestepping (IGNORED)");
#ifdef DTADJUST
param.bDtAdjust = 1;
#else
param.bDtAdjust = 0;
#endif
prmAddParam(prm, "bDtAdjust", paramBool, ¶m.bDtAdjust,
sizeof(int),"dtadj", "Emergency adjust of timesteps");
param.bBenchmark = 0;
prmAddParam(prm, "bBenchmark", paramBool, ¶m.bBenchmark,
sizeof(int),"bench", "Benchmark only; no output or checkpoints");
param.dGlassDamper = 0.0;
prmAddParam(prm,"dGlassDamper",paramDouble,¶m.dGlassDamper,
sizeof(double), "dGlassDamper",
"<Damping force inverse timescale> = 0.0");
//
// Output flags
//
param.iOutInterval = 10;
prmAddParam(prm, "iOutInterval", paramInt, ¶m.iOutInterval,
sizeof(int),"oi", "Output Interval");
param.iLogInterval = 1;
prmAddParam(prm, "iLogInterval", paramInt, ¶m.iLogInterval,
sizeof(int),"ol", "Log Interval");
param.iCheckInterval = 10;
prmAddParam(prm, "iCheckInterval", paramInt, ¶m.iCheckInterval,
sizeof(int),"oc", "Checkpoint Interval");
param.iOrbitOutInterval = 1;
prmAddParam(prm,"iOrbitOutInterval", paramInt,
¶m.iOrbitOutInterval,sizeof(int), "ooi",
"<number of timsteps between orbit outputs> = 1");
param.iBinaryOut = 0;
prmAddParam(prm, "iBinaryOutput", paramInt, ¶m.iBinaryOut,
sizeof(int), "binout",
"<array outputs 0 ascii, 1 float, 2 double, 3 FLOAT(internal)> = 0");
param.bDoDensity = 1;
prmAddParam(prm, "bDoDensity", paramBool, ¶m.bDoDensity,
sizeof(int),"den", "Enable Density outputs");
param.bDoIOrderOutput = 0;
prmAddParam(prm,"bDoIOrderOutput",paramBool,¶m.bDoIOrderOutput,
sizeof(int), "iordout","enable/disable iOrder outputs = -iordout");
#ifdef SPLITGAS
param.bDoIOrderOutput = 1; //This becomes very important if particles can split.
#endif
param.bDoSoftOutput = 0;
prmAddParam(prm,"bDoSoftOutput",paramBool,¶m.bDoSoftOutput,
sizeof(int),
"softout","enable/disable soft outputs = -softout");
param.bDohOutput = 0;
prmAddParam(prm,"bDohOutput",paramBool,¶m.bDohOutput,sizeof(int),
"hout","enable/disable h outputs = -hout");
param.bDoCSound = 0;
prmAddParam(prm,"bDoCSound",paramBool,¶m.bDoCSound,sizeof(int),
"csound","enable/disable sound speed outputs = -csound");
param.bDoStellarLW = 1; /*CC */
prmAddParam(prm,"bDoStellarLW",paramBool,¶m.bDoStellarLW,sizeof(int),
"LWout","enable/disable Lyman Werner outputs = -LWout");
param.nSmooth = 32;
prmAddParam(prm, "nSmooth", paramInt, ¶m.nSmooth,
sizeof(int),"s", "Number of neighbors for smooth");
param.bDoGravity = 1;
prmAddParam(prm, "bDoGravity", paramBool, ¶m.bDoGravity,
sizeof(int),"g", "Enable Gravity");
param.dSoft = 0.0;
prmAddParam(prm, "dSoft", paramDouble, ¶m.dSoft,
sizeof(double),"e", "Gravitational softening");
param.dSoftMax = 0.0;
prmAddParam(prm,"dSoftMax",paramDouble, ¶m.dSoftMax,
sizeof(double),"eMax", "maximum comoving gravitational softening length (abs or multiplier)");
param.bPhysicalSoft = 0;
prmAddParam(prm,"bPhysicalSoft", paramBool, ¶m.bPhysicalSoft,
sizeof(int),"PhysSoft", "Physical gravitational softening length");
param.bSoftMaxMul = 1;
prmAddParam(prm,"bSoftMaxMul", paramBool, ¶m.bSoftMaxMul,
sizeof(int),"SMM", "Use maximum comoving gravitational softening length as a multiplier +SMM");
param.dTheta = 0.7;
prmAddParam(prm, "dTheta", paramDouble, ¶m.dTheta,
sizeof(double), "theta", "Opening angle");
param.dTheta2 = 0.7;
prmAddParam(prm, "dTheta2", paramDouble, ¶m.dTheta2,
sizeof(double),"theta2",
"Opening angle after switchTheta");
param.daSwitchTheta = 1./3.;
prmAddParam(prm,"daSwitchTheta",paramDouble,¶m.daSwitchTheta,
sizeof(double),"aSwitchTheta",
"<a to switch theta at> = 1./3.");
#ifdef HEXADECAPOLE
param.iOrder = 4;
#else
param.iOrder = 2;
#endif
prmAddParam(prm, "iOrder", paramInt, ¶m.iOrder,
sizeof(int), "or", "Multipole expansion order(IGNORED)");
//
// Cosmology parameters
//
param.bPeriodic = 0;
prmAddParam(prm, "bPeriodic", paramBool, ¶m.bPeriodic,
sizeof(int),"per", "Periodic Boundaries");
param.nReplicas = 0;
prmAddParam(prm, "nReplicas", paramInt, ¶m.nReplicas,
sizeof(int),"nrep", "Number of periodic replicas");
param.fPeriod = 1.0;
prmAddParam(prm, "dPeriod", paramDouble, ¶m.fPeriod,
sizeof(double),"L", "Periodic size");
param.vPeriod.x = 1.0;
prmAddParam(prm,"dxPeriod",paramDouble,¶m.vPeriod.x,
sizeof(double),"Lx",
"<periodic box length in x-dimension> = 1.0");
param.vPeriod.y = 1.0;
prmAddParam(prm, "dyPeriod",paramDouble,¶m.vPeriod.y,
sizeof(double),"Ly",
"<periodic box length in y-dimension> = 1.0");
param.vPeriod.z = 1.0;
prmAddParam(prm,"dzPeriod",paramDouble,¶m.vPeriod.z,
sizeof(double),"Lz",
"<periodic box length in z-dimension> = 1.0");
param.bEwald = 1;
prmAddParam(prm,"bEwald",paramBool, ¶m.bEwald, sizeof(int),
"ewald", "enable/disable Ewald correction = +ewald");
param.dEwCut = 2.6;
prmAddParam(prm,"dEwCut", paramDouble, ¶m.dEwCut, sizeof(double),
"ewc", "<dEwCut> = 2.6");
param.dEwhCut = 2.8;
prmAddParam(prm,"dEwhCut", paramDouble, ¶m.dEwhCut, sizeof(double),
"ewh", "<dEwhCut> = 2.8");
param.csm->bComove = 0;
prmAddParam(prm, "bComove", paramBool, ¶m.csm->bComove,
sizeof(int),"cm", "Comoving coordinates");
param.csm->dHubble0 = 0.0;
prmAddParam(prm,"dHubble0",paramDouble,¶m.csm->dHubble0,
sizeof(double),"Hub", "<dHubble0> = 0.0");
param.csm->dOmega0 = 1.0;
prmAddParam(prm,"dOmega0",paramDouble,¶m.csm->dOmega0,
sizeof(double),"Om", "<dOmega0> = 1.0");
param.csm->dLambda = 0.0;
prmAddParam(prm,"dLambda",paramDouble,¶m.csm->dLambda,
sizeof(double),"Lambda", "<dLambda> = 0.0");
param.csm->dOmegaRad = 0.0;
prmAddParam(prm,"dOmegaRad",paramDouble,¶m.csm->dOmegaRad,
sizeof(double),"Omrad", "<dOmegaRad> = 0.0");
param.csm->dOmegab = 0.0;
prmAddParam(prm,"dOmegab",paramDouble,¶m.csm->dOmegab,
sizeof(double),"Omb", "<dOmegab> = 0.0");
param.csm->dQuintess = 0.0;
prmAddParam(prm,"dQuintess",paramDouble,¶m.csm->dQuintess,
sizeof(double),"Quint",
"<dQuintessence (constant w = -1/2) > = 0.0");
param.dRedTo = 0.0;
prmAddParam(prm,"dRedTo",paramDouble,¶m.dRedTo,sizeof(double),
"zto", "specifies final redshift for the simulation");
//
// Parameters for GrowMass: slowly growing mass of particles.
//
param.bDynGrowMass = 1;
prmAddParam(prm,"bDynGrowMass",paramBool,¶m.bDynGrowMass,
sizeof(int),"gmd","<dynamic growmass particles>");
param.nGrowMass = 0;
prmAddParam(prm,"nGrowMass",paramInt,¶m.nGrowMass,sizeof(int),
"gmn","<number of particles to increase mass> = 0");
param.dGrowDeltaM = 0.0;
prmAddParam(prm,"dGrowDeltaM",paramDouble,¶m.dGrowDeltaM,
sizeof(double),"gmdm",
"<Total growth in mass/particle> = 0.0");
param.dGrowStartT = 0.0;
prmAddParam(prm,"dGrowStartT",paramDouble,¶m.dGrowStartT,
sizeof(double),"gmst",
"<Start time for growing mass> = 0.0");
param.dGrowEndT = 1.0;
prmAddParam(prm,"dGrowEndT",paramDouble,¶m.dGrowEndT,
sizeof(double),"gmet","<End time for growing mass> = 1.0");
//
// Gas parameters
//
param.bDoGas = 0;
prmAddParam(prm, "bDoGas", paramBool, ¶m.bDoGas,
sizeof(int),"gas", "Enable Gas Calculation");
param.bFastGas = 1;
prmAddParam(prm, "bFastGas", paramBool, ¶m.bFastGas,
sizeof(int),"Fgas", "Fast Gas Method");
param.dFracFastGas = 0.1;
prmAddParam(prm,"dFracFastGas",paramDouble,¶m.dFracFastGas,
sizeof(double),"ffg",
"<Fraction of Active Particles for Fast Gas>");
param.dhMinOverSoft = 0.0;
prmAddParam(prm,"dhMinOverSoft",paramDouble,¶m.dhMinOverSoft,
sizeof(double),"hmin",
"<Minimum h as a fraction of Softening> = 0.0");
param.dResolveJeans = 0.0;
prmAddParam(prm,"dResolveJeans",paramDouble,¶m.dResolveJeans,
sizeof(double),"resjeans",
"<Fraction of pressure to resolve minimum Jeans mass> = 0.0");
param.bViscosityLimiter = 1;
prmAddParam(prm,"bViscosityLimiter",paramBool,¶m.bViscosityLimiter,
sizeof(int), "vlim","<Viscosity Limiter> = 1");
param.iViscosityLimiter = 1;
prmAddParam(prm,"iViscosityLimiter",paramInt,¶m.iViscosityLimiter,
sizeof(int), "ivlim","<Viscosity Limiter Type> = 1");
param.bGeometric = 0;
prmAddParam(prm,"bGeometric",paramBool,¶m.bGeometric,sizeof(int),
"geo","geometric/arithmetic mean to calc Grad(P/rho) = +geo");
param.bGasAdiabatic = 0;
prmAddParam(prm,"bGasAdiabatic",paramBool,¶m.bGasAdiabatic,
sizeof(int),"GasAdiabatic",
"<Gas is Adiabatic> = +GasAdiabatic");
param.bGasIsothermal = 0;
prmAddParam(prm,"bGasIsothermal",paramBool,¶m.bGasIsothermal,
sizeof(int),"GasIsothermal",
"<Gas is Isothermal> = -GasIsothermal");
param.bGasCooling = 0;
prmAddParam(prm,"bGasCooling",paramBool,¶m.bGasCooling,
sizeof(int),"GasCooling",
"<Gas is Cooling> = +GasCooling");
iGasModel = GASMODEL_UNSET; /* Deprecated in for backwards
compatibility */
prmAddParam(prm,"iGasModel", paramInt, &iGasModel, sizeof(int),
"GasModel", "<Gas model employed> = 0 (Adiabatic)");
CoolAddParams(¶m.CoolParam, prm);
param.dMaxEnergy = 1e300;
prmAddParam(prm,"dMaxTemperature",paramDouble,¶m.dMaxEnergy,
sizeof(double),"maxTemp", "<Maximum allowed gas temperature = 1e300>");
param.dMsolUnit = 1.0;
prmAddParam(prm,"dMsolUnit",paramDouble,¶m.dMsolUnit,
sizeof(double),"msu", "<Solar mass/system mass unit>");
param.dKpcUnit = 1000.0;
prmAddParam(prm,"dKpcUnit",paramDouble,¶m.dKpcUnit,
sizeof(double),"kpcu", "<Kiloparsec/system length unit>");
param.ddHonHLimit = 0.1;
prmAddParam(prm,"ddHonHLimit",paramDouble,¶m.ddHonHLimit,
sizeof(double),"dhonh", "<|dH|/H Limiter> = 0.1");
param.dConstAlpha = 1.0;
prmAddParam(prm,"dConstAlpha",paramDouble,¶m.dConstAlpha,
sizeof(double),"alpha",
"<Alpha constant in viscosity> = 1.0");
param.dConstBeta = 2.0;
prmAddParam(prm,"dConstBeta",paramDouble,¶m.dConstBeta,
sizeof(double),"beta",
"<Beta constant in viscosity> = 2.0");
#ifdef CULLENALPHA
param.dConstAlphaMax = 4.0;
prmAddParam(prm, "dConstAlphaMax", paramDouble, ¶m.dConstAlphaMax,
sizeof(double), "AlphaMax",
"< Cullen and Dehnen Alpha Max constant in viscosity> = 1.0");
#endif
param.dConstGamma = 5.0/3.0;
prmAddParam(prm,"dConstGamma",paramDouble,¶m.dConstGamma,
sizeof(double),"gamma", "<Ratio of specific heats> = 5/3");
param.dMeanMolWeight = 1.0;
prmAddParam(prm,"dMeanMolWeight",paramDouble,¶m.dMeanMolWeight,
sizeof(double),"mmw",
"<Mean molecular weight in amu> = 1.0");
param.dGasConst = 1.0;
prmAddParam(prm,"dGasConst",paramDouble,¶m.dGasConst,
sizeof(double),"gcnst", "<Gas Constant>");
param.bBulkViscosity = 0;
prmAddParam(prm,"bBulkViscosity",paramBool,¶m.bBulkViscosity,
sizeof(int), "bulk","<Bulk Viscosity> = 0");
param.dMetalDiffusionCoeff = 0;
prmAddParam(prm,"dMetalDiffusionCoeff",paramDouble,
¶m.dMetalDiffusionCoeff, sizeof(double),"metaldiff",
"<Coefficient in Metal Diffusion> = 0.0");
#ifdef DIFFUSIONPRICE
param.dThermalDiffusionCoeff = 1;
#else
param.dThermalDiffusionCoeff = 0;
#endif
prmAddParam(prm,"dThermalDiffusionCoeff",paramDouble,
¶m.dThermalDiffusionCoeff, sizeof(double),"thermaldiff",
"<Coefficient in Thermal Diffusion> = 0.0");
param.bConstantDiffusion = 0;
prmAddParam(prm,"bConstantDiffusion",paramBool,¶m.bConstantDiffusion,
sizeof(int),"constdiff", "<Constant Diffusion BC> = +constdiff");
param.dEtaDiffusion = 0.1;
prmAddParam(prm,"dEtaDiffusion",paramDouble,¶m.dEtaDiffusion,sizeof(double),
"etadiff", "<Diffusion dt criterion> = 0.1");
// SPH timestepping
param.bSphStep = 1;
prmAddParam(prm,"bSphStep",paramBool,¶m.bSphStep,sizeof(int),
"ss","<SPH timestepping>");
param.bViscosityLimitdt = 0;
prmAddParam(prm,"bViscosityLimitdt",paramBool,
¶m.bViscosityLimitdt,sizeof(int),
"vlim","<Balsara Viscosity Limit dt> = 0");
param.dEtaCourant = 0.4;
prmAddParam(prm,"dEtaCourant",paramDouble,¶m.dEtaCourant,
sizeof(double),"etaC", "<Courant criterion> = 0.4");
param.dEtauDot = 0.25;
prmAddParam(prm,"dEtauDot",paramDouble,¶m.dEtauDot,
sizeof(double),"etau", "<uDot criterion> = 0.25");
param.nTruncateRung = 0;
prmAddParam(prm,"nTruncateRung",paramInt,¶m.nTruncateRung,
sizeof(int),"nTR",
"<number of MaxRung particles to delete MaxRung> = 0");
param.bStarForm = 0;
prmAddParam(prm,"bStarForm",paramBool,¶m.bStarForm,sizeof(int),
"stfm","<Star Forming> = 0");
param.stfm = new Stfm();
param.stfm->AddParams(prm);
param.bFeedback = 0;
prmAddParam(prm,"bFeedBack",paramBool,¶m.bFeedback,sizeof(int),
"fdbk","<Stars provide feedback> = 0");
param.feedback = new Fdbk();
param.feedback->AddParams(prm);
param.dEvapMinTemp = 1e5;
prmAddParam(prm,"dEvapMinTemp",paramDouble,¶m.dEvapMinTemp,
sizeof(double),"evaptmin",
"<Minimumum temperature for evaporation > = 1e5");
param.dEvapCoeff = 1.2e-7;
prmAddParam(prm,"dEvapCoeff",paramDouble,¶m.dEvapCoeff,
sizeof(double),"evap",
"<Evap Coefficient due to thermal Conductivity (electrons), e.g. 1.2e-7 > = 0");
param.dThermalCondCoeff = 1.2e-7;
prmAddParam(prm,"dThermalCondCoeff",paramDouble,¶m.dThermalCondCoeff,
sizeof(double),"thermalcond",
"<Coefficient in Thermal Conductivity (electrons), e.g. 1.2e-7 > = 0");
param.dThermalCondSatCoeff = 17;
prmAddParam(prm,"dThermalCondSatCoeff",paramDouble,¶m.dThermalCondSatCoeff,
sizeof(double),"thermalcondsat",
"<Coefficient in Saturated Thermal Conductivity, e.g. 17 > = 17");
param.dThermalCond2Coeff = 5.0e2;
prmAddParam(prm,"dThermalCond2Coeff",paramDouble,¶m.dThermalCond2Coeff,
sizeof(double),"thermalcond2",
"<Coefficient in Thermal Conductivity 2 (atoms), e.g. 5.0e2 > = 0");
param.dThermalCond2SatCoeff = 0.5;
prmAddParam(prm,"dThermalCond2SatCoeff",paramDouble,¶m.dThermalCond2SatCoeff,
sizeof(double),"thermalcond2sat",
"<Coefficient in Saturated Thermal Conductivity 2, e.g. 0.5 > = 0.5");
param.bDoExternalForce = 0;
prmAddParam(prm, "bDoExternalForce", paramBool, ¶m.bDoExternalForce,
sizeof(int), "bDoExternalForce", "<Apply external force field to particles> = 0");
// bDoExternalGravity was renamed to bDoExternalForce
// Include the old parameter name to ensure backwards compatibility
param.bDoExternalGravity = 0;
prmAddParam(prm, "bDoExternalGravity", paramBool, ¶m.bDoExternalGravity,
sizeof(int), "bDoExternalGravity", "<Apply external gravity field to particles> = 0");
param.externalForce.AddParams(prm);
#ifdef COLLISION
param.bCollision = 0;
prmAddParam(prm, "bCollision", paramBool, ¶m.bCollision,
sizeof(int), "bCollision", "<Do collision detection and response on particles> = 0");
param.collision.AddParams(prm);
#endif
param.iRandomSeed = 1;
prmAddParam(prm,"iRandomSeed", paramInt, ¶m.iRandomSeed,
sizeof(int), "iRand", "<Random Seed> = 1");
param.sinks.AddParams(prm, param);
param.dSIDMSigma=0;
prmAddParam(prm,"dSIDMSigma",paramDouble,¶m.dSIDMSigma,sizeof(double),
"dSIDMSigma","DM cross section in cm^2/g (NA,constant,knee value, or norm)");
param.dSIDMVariable=0;
prmAddParam(prm,"dSIDMVariable",paramDouble,¶m.dSIDMVariable,sizeof(double),
"dSIDMVariable","(NA,NA, break value in km/s, exponent value)");
param.iSIDMSelect=0;
prmAddParam(prm,"iSIDMSelect",paramInt, ¶m.iSIDMSelect, sizeof(int),
"iSIDMSelect","SIDM version (0 off, 1 constant, 2 classical, 3 resonant)");
//
// Output parameters
//
param.bStandard = 1;
prmAddParam(prm, "bStandard", paramBool, ¶m.bStandard,sizeof(int),
"std", "output in standard TIPSY binary format (IGNORED)");
param.bDoublePos = 0;
prmAddParam(prm, "bDoublePos", paramBool, ¶m.bDoublePos,
sizeof(int), "dp",
"input/output double precision positions = -dp");
param.bDoubleVel = 0;
prmAddParam(prm,"bDoubleVel", paramBool, ¶m.bDoubleVel,sizeof(int),
"dv", "input/output double precision velocities = -dv");
param.bOverwrite = 1;
prmAddParam(prm, "bOverwrite", paramBool, ¶m.bOverwrite,sizeof(int),
"overwrite", "overwrite outputs (IGNORED)");
param.bParaRead = 1;
prmAddParam(prm, "bParaRead", paramBool, ¶m.bParaRead,sizeof(int),
"par", "enable/disable parallel reading of files (IGNORED)");
param.bParaWrite = 1;
prmAddParam(prm, "bParaWrite", paramBool, ¶m.bParaWrite,sizeof(int),
"paw", "enable/disable parallel writing of files");
param.nIOProcessor = 0;
prmAddParam(prm,"nIOProcessor",paramInt,¶m.nIOProcessor,
sizeof(int), "npio",
"number of simultaneous I/O processors = 0 (all)");
param.achInFile[0] = '\0';
prmAddParam(prm,"achInFile",paramString,param.achInFile,
256, "I", "input file name (or base file name)");
strcpy(param.achOutName,"pargrav");
prmAddParam(prm,"achOutName",paramString,param.achOutName,256,"o",
"output name for snapshots and logfile");
param.dExtraStore = 0.01;
prmAddParam(prm,"dExtraStore",paramDouble,¶m.dExtraStore,
sizeof(double), "estore",
"Extra memory for new particles");
param.dMaxBalance = 1e10;
prmAddParam(prm,"dMaxBalance",paramDouble,¶m.dMaxBalance,
sizeof(double), "maxbal",
"Maximum piece ratio for load balancing");
param.dFracLoadBalance = 0.0001;
prmAddParam(prm,"dFracLoadBalance",paramDouble,¶m.dFracLoadBalance,
sizeof(double), "fraclb",
"Minimum active particles for load balancing");
bDumpFrame = 0;
df = NULL;
param.dDumpFrameStep = -1.0;
prmAddParam(prm,"dDumpFrameStep",paramDouble, ¶m.dDumpFrameStep,
sizeof(double), "dfi",
"<number of steps between dumped frames> = -1 (disabled)");
param.dDumpFrameTime = -1.0;
prmAddParam(prm,"dDumpFrameTime",paramDouble,¶m.dDumpFrameTime,
sizeof(double), "dft",
"<time interval between dumped frames> = -1 (disabled)");
param.iDirector = 1;
prmAddParam(prm,"iDirector",paramInt,¶m.iDirector,sizeof(int),
"idr","<number of director files: 1, 2, 3> = 1");
param.bLiveViz = 0;
prmAddParam(prm, "bLiveViz", paramInt,¶m.bLiveViz, sizeof(int),
"liveviz", "enable real-time simulation render support (disabled)");
param.bUseCkLoopPar = 0;
prmAddParam(prm, "bUseCkLoopPar", paramBool,¶m.bUseCkLoopPar, sizeof(int),
"useckloop", "enable CkLoop to parallelize within node");
param.bStaticTest = 0;
prmAddParam(prm, "bStaticTest", paramBool, ¶m.bStaticTest,
sizeof(int),"st", "Static test of performance");
_randChunks = 1;
prmAddParam(prm, "bRandChunks", paramBool, &_randChunks,
sizeof(int),"rand", "Randomize the order of remote chunk computation (default: ON)");
_nocache = 0;
// prmAddParam(prm, "bNoCache", paramBool, &_nocache,
// sizeof(int),"nc", "Disable the CacheManager caching behaviour");
param.iVerbosity = 0;
prmAddParam(prm, "iVerbosity", paramInt, ¶m.iVerbosity,
sizeof(int),"v", "Verbosity");
bVDetails = 0;
prmAddParam(prm, "bVDetails", paramBool, &bVDetails,
sizeof(int),"vdetails", "Verbosity");
numTreePieces = 8 * CkNumPes();
prmAddParam(prm, "nTreePieces", paramInt, &numTreePieces,
sizeof(int),"p", "Number of TreePieces (default: 8*procs)");
#ifdef CUDA
numStreams = 100;
prmAddParam(prm, "nStreams", paramInt, &numStreams,
sizeof(int),"str", "Number of CUDA streams (default: 100)");
param.nGpuMinParts = 1000;
prmAddParam(prm, "nGpuMinParts", paramInt, ¶m.nGpuMinParts,
sizeof(int),"gpup", "Min particles on rung to trigger GPU (default: 1000)");
#endif
particlesPerChare = 0;
prmAddParam(prm, "nPartPerChare", paramInt, &particlesPerChare,
sizeof(int),"ppc", "Average number of particles per TreePiece");
bucketSize = 12;
prmAddParam(prm, "nBucket", paramInt, &bucketSize,
sizeof(int),"b", "Particles per Bucket (default: 12)");
_numChunks = 1;
prmAddParam(prm, "nChunks", paramInt, &_numChunks,
sizeof(int),"c", "Chunks per TreePiece (default: 1)");
_yieldPeriod=5;
prmAddParam(prm, "nYield", paramInt, &_yieldPeriod,
sizeof(int),"y", "Yield Period (default: 5)");
param.cacheLineDepth=4;
prmAddParam(prm, "nCacheDepth", paramInt, ¶m.cacheLineDepth,
sizeof(int),"d", "Cache Line Depth (default: 4)");
_prefetch=true;
prmAddParam(prm, "bPrefetch", paramBool, &_prefetch,
sizeof(int),"f", "Enable prefetching in the cache (default: ON)");
cacheSize = 100000000;
prmAddParam(prm, "nCacheSize", paramInt, &cacheSize,
sizeof(int),"cs", "Size of cache (IGNORED)");
domainDecomposition=SFC_peano_dec;
peanoKey=0;
prmAddParam(prm, "nDomainDecompose", paramInt, &domainDecomposition,
sizeof(int),"D", "Kind of domain decomposition of particles");
param.dFracNoDomainDecomp = 0.0;
prmAddParam(prm, "dFracNoDomainDecomp", paramDouble,
¶m.dFracNoDomainDecomp, sizeof(double),"fndd",
"Fraction of active particles for no new DD = 0.0");
param.bConcurrentSph = 1;
prmAddParam(prm, "bConcurrentSph", paramBool, ¶m.bConcurrentSph,
sizeof(int),"consph", "Enable SPH running concurrently with Gravity");
// Recognize (and ignore) gasoline compatibility parameters.
static int iDummy = 0;
prmAddParam(prm, "bRestart", paramBool, &iDummy,
sizeof(int),"restartg", "(IGNORED) gasoline compatible restart");
prmAddParam(prm, "bDoSelfGravity", paramBool, &iDummy,
sizeof(int),"sg", "(IGNORED) Use bDoGravity");
prmAddParam(prm, "bVStart", paramBool, &iDummy,
sizeof(int), "vstart","(IGNORED)");
prmAddParam(prm, "bVStep", paramBool, &iDummy,
sizeof(int), "vstep", "(IGNORED)");
prmAddParam(prm, "bVRungStat", paramBool, &iDummy,
sizeof(int), "vrungstat", "(IGNORED)");
#ifdef PUSH_GRAVITY
param.dFracPushParticles = 0.0;
prmAddParam(prm, "dFracPush", paramDouble,
¶m.dFracPushParticles, sizeof(double),"fPush",
"Maximum proportion of active to total particles for push-based force evaluation = 0.0");
#endif
#ifdef SELECTIVE_TRACING
/* tracing control */
monitorRung = 12;
prmAddParam(prm, "iTraceRung", paramInt, &monitorRung,
sizeof(int),"traceRung", "Gravity starting rung to trace selectively");
monitorStart = 0;
prmAddParam(prm, "iTraceStart", paramInt, &monitorStart,
sizeof(int),"traceStart", "When to start selective tracing");
numTraceIterations = 3;
prmAddParam(prm, "iTraceFor", paramInt, &numTraceIterations,
sizeof(int),"traceFor", "Trace this many instances of the selected rungs");
numSkipIterations = 400;
prmAddParam(prm, "iTraceSkip", paramInt, &numSkipIterations,
sizeof(int),"traceSkip", "Skip tracing for these many iterations");
numMaxTrace = 5;
prmAddParam(prm, "iTraceMax", paramInt, &numMaxTrace,
sizeof(int),"traceMax", "Max. num. iterations traced");
traceIteration = 0;
traceState = TraceNormal;
projectionsOn = false;
#endif
numInitDecompBins = (1<<11);
prmAddParam(prm, "iInitDecompBins", paramInt, &numInitDecompBins,
sizeof(int),"initDecompBins", "Number of bins to use for the first iteration of every Oct decomposition step");
octRefineLevel = 1;
prmAddParam(prm, "iOctRefineLevel", paramInt, &octRefineLevel,
sizeof(int),"octRefineLevel", "Binary logarithm of the number of sub-bins a bin is split into for Oct decomposition (e.g. octRefineLevel 3 splits into 8 sub-bins) (default: 1)");
doDumpLB = false;
prmAddParam(prm, "bdoDumpLB", paramBool, &doDumpLB,
sizeof(int),"doDumpLB", "Should Orb3dLB dump LB database to text file and stop?");
lbDumpIteration = 0;
prmAddParam(prm, "ilbDumpIteration", paramInt, &lbDumpIteration,
sizeof(int),"lbDumpIteration", "Load balancing iteration for which to dump database");
doSimulateLB = false;
prmAddParam(prm, "bDoSimulateLB", paramBool, &doSimulateLB,
sizeof(int),"doSimulateLB", "Should Orb3dLB simulate LB decisions from dumped text file and stop?");
CkAssert(!(doDumpLB && doSimulateLB));
// jetley - cuda parameters
#ifdef CUDA
localNodesPerReqDouble = NODE_INTERACTIONS_PER_REQUEST_L;
prmAddParam(prm, "localNodesPerReq", paramDouble, &localNodesPerReqDouble,
sizeof(double),"localnodes", "Num. local node interactions allowed per CUDA request (in millions)");
remoteNodesPerReqDouble = NODE_INTERACTIONS_PER_REQUEST_RNR;
prmAddParam(prm, "remoteNodesPerReq", paramDouble, &remoteNodesPerReqDouble,
sizeof(double),"remotenodes", "Num. remote node interactions allowed per CUDA request (in millions)");
remoteResumeNodesPerReqDouble = NODE_INTERACTIONS_PER_REQUEST_RR;
prmAddParam(prm, "remoteResumeNodesPerReq", paramDouble, &remoteResumeNodesPerReqDouble,
sizeof(double),"remoteresumenodes", "Num. remote resume node interactions allowed per CUDA request (in millions)");
localPartsPerReqDouble = PART_INTERACTIONS_PER_REQUEST_L;
prmAddParam(prm, "localPartsPerReq", paramDouble, &localPartsPerReqDouble,
sizeof(double),"localparts", "Num. local particle interactions allowed per CUDA request (in millions)");
remotePartsPerReqDouble = PART_INTERACTIONS_PER_REQUEST_RNR;
prmAddParam(prm, "remotePartsPerReq", paramDouble, &remotePartsPerReqDouble,
sizeof(double),"remoteparts", "Num. remote particle interactions allowed per CUDA request (in millions)");
remoteResumePartsPerReqDouble = PART_INTERACTIONS_PER_REQUEST_RR;
prmAddParam(prm, "remoteResumePartsPerReq", paramDouble, &remoteResumePartsPerReqDouble,
sizeof(double),"remoteresumeparts", "Num. remote resume particle interactions allowed per CUDA request (in millions)");
largePhaseThreshold = TP_LARGE_PHASE_THRESHOLD_DEFAULT;
// prmAddParam(prm, "largePhaseThreshold", paramDouble, &largePhaseThreshold,
// sizeof(double),"largephasethresh", "Ratio of active to total particles at which all particles (not just active ones) are sent to gpu in the target buffer (No source particles are sent.)");
#endif
int processSimfile = 1;
if(!prmArgProc(prm,m->argc,m->argv, processSimfile)) {
CkExit();
}
// ensure that number of bins is a power of 2
if (numInitDecompBins > numTreePieces) {
unsigned int numBins = 1;
while (numBins < numTreePieces) {
numBins <<= 1;
}
numInitDecompBins = numBins;
}
if(bVDetails && !param.iVerbosity)
param.iVerbosity = 1;
if(prmSpecified(prm, "iMaxRung")) {
ckerr << "WARNING: ";
ckerr << "iMaxRung parameter ignored. MaxRung is " << MAXRUNG
<< endl;
}
if(prmSpecified(prm, "bKDK")) {
ckerr << "WARNING: ";
ckerr << "bKDK parameter ignored; KDK is always used." << endl;
}
if(prmSpecified(prm, "bStandard")) {
ckerr << "WARNING: ";
ckerr << "bStandard parameter ignored; Output is always standard."
<< endl;
}
if(prmSpecified(prm, "iOrder")) {
ckerr << "WARNING: ";
#ifdef HEXADECAPOLE
ckerr << "iOrder parameter ignored; expansion order is 4."
#else
ckerr << "iOrder parameter ignored; expansion order is 2."
#endif
<< endl;
}
if(prmSpecified(prm, "bRestart")) {
ckerr << "WARNING: ";
ckerr << "bRestart parameter ignored; "
<< "restart from checkpoint is done with ++restart."
<< endl;
}
if(prmSpecified(prm, "bDoSelfGravity")) {
ckerr << "WARNING: ";
ckerr << "bDoSelfGravity parameter ignored; "
<< "Use bDoGravity to turn gravity on or off."
<< endl;
}
if(prmSpecified(prm, "bVStart")) {
ckerr << "WARNING: ";
ckerr << "bVStart parameter ignored"
<< "use -v # to increase verbosity"
<< endl;
}
if(prmSpecified(prm, "bVStep")) {
ckerr << "WARNING: ";
ckerr << "bVStep parameter ignored"
<< "use -v # to increase verbosity"
<< endl;
}
if(prmSpecified(prm, "bVRungStat")) {
ckerr << "WARNING: ";
ckerr << "bVRungStat parameter ignored"
<< "use -v # to increase verbosity"
<< endl;
}
if(!prmSpecified(prm, "dTheta2")) {
param.dTheta2 = param.dTheta;
}
/* set readonly/global variables */
theta = param.dTheta;
thetaMono = theta*theta*theta*theta;
dExtraStore = param.dExtraStore;
dMaxBalance = param.dMaxBalance;
dFracLoadBalance = param.dFracLoadBalance;
dGlassDamper = param.dGlassDamper;
_cacheLineDepth = param.cacheLineDepth;