OpenAtom  Version1.5a
paircalcstartup.C
1 #ifdef _PAIRCALC_STARTUP_H
2 #define _PAIRCALC_STARTUP_H
3 
4  /* choose whether ortho should use local callback */
5  Ortho_use_local_cb = true;
6 
7 
8  // Stuff it with the actual configurations
9  cfgSymmPC.isDynamics = (sim->cp_min_opt==1)? false: true;
10  cfgSymmPC.useComplexMath = false;
11 
12  cfgSymmPC.numPlanes = config.nchareG;
13  cfgSymmPC.numStates = nstates;
14  cfgSymmPC.grainSize = config.sGrainSize;
15  cfgSymmPC.orthoGrainSize = config.orthoGrainSize;
16 
17  cfgSymmPC.conserveMemory = config.conserveMemory;
18  cfgSymmPC.isLBon = config.lbpaircalc;
19 
20  cfgSymmPC.areBWTilesCollected= config.PCCollectTiles;
21  cfgSymmPC.isBWstreaming = config.PCstreamBWout;
22  cfgSymmPC.isBWbarriered = config.useBWBarrier;
23  cfgSymmPC.shouldDelayBWsend = config.PCdelayBWSend;
24  cfgSymmPC.isInputMulticast = !config.usePairDirectSend;
25  cfgSymmPC.isOutputReduced = !config.gSpaceSum;
26  cfgSymmPC.inputSpanningTreeFactor = config.PCSpanFactor;
27 
28  cfgSymmPC.gemmSplitFWk = config.gemmSplitFWk;
29  cfgSymmPC.gemmSplitFWm = config.gemmSplitFWm;
30  cfgSymmPC.gemmSplitBW = config.gemmSplitBW;
31 
32 
33 
34  // Configurations specific to the symmetric PC instance
35  cfgSymmPC.isSymmetric = true;
36  cfgSymmPC.arePhantomsOn = config.phantomSym;
37  cfgSymmPC.numChunks = config.numChunksSym;
38  cfgSymmPC.isDoublePackOn = doublePack;
39  cfgSymmPC.inputMsgPriority = config.psipriority;
40  cfgSymmPC.resultMsgPriority = config.gsfftpriority;
41 
42  // Configurations specific to the asymmetric PC instance
43  cfgAsymmPC.isSymmetric = false;
44  cfgAsymmPC.arePhantomsOn = false;
45  cfgAsymmPC.numChunks = config.numChunksAsym;
46  cfgAsymmPC.isDoublePackOn = 0;
47  cfgAsymmPC.inputMsgPriority = config.lambdapriority;
48  cfgAsymmPC.resultMsgPriority = config.lambdapriority+2;
49 
50  // Configure the GSpace entry methods that the PCs will callback
51  if(cfgSymmPC.isOutputReduced)
52  {
53  cfgSymmPC.gSpaceEP = CkIndex_CP_State_GSpacePlane::acceptNewPsi ((CkReductionMsg*)NULL);
54  cfgSymmPC.PsiVEP = CkIndex_CP_State_GSpacePlane::acceptNewPsiV((CkReductionMsg*)NULL);
55  }
56  else
57  {
58  cfgSymmPC.gSpaceEP = CkIndex_CP_State_GSpacePlane::acceptNewPsi ((partialResultMsg*)NULL);
59  cfgSymmPC.PsiVEP = CkIndex_CP_State_GSpacePlane::acceptNewPsiV((partialResultMsg*)NULL);
60  }
61 
62  if(cfgAsymmPC.isOutputReduced)
63  {
64  cfgAsymmPC.gSpaceEP = CkIndex_CP_State_GSpacePlane::acceptLambda ((CkReductionMsg*)NULL);
65  cfgAsymmPC.PsiVEP = 0;
66  }
67  else
68  {
69  cfgAsymmPC.gSpaceEP = CkIndex_CP_State_GSpacePlane::acceptLambda ((partialResultMsg*)NULL);
70  cfgAsymmPC.PsiVEP = 0;
71  }
72 
73 #ifdef _CP_SUBSTEP_TIMING_
74  //symmetric AKA Psi
75  cfgSymmPC.forwardTimerID = keeperRegister("Sym Forward");
76  cfgSymmPC.backwardTimerID = keeperRegister("Sym Backward");
77  cfgSymmPC.beginTimerCB = CkCallback(CkIndex_TimeKeeper::collectStart(NULL),0,TimeKeeperProxy);
78  cfgSymmPC.endTimerCB = CkCallback(CkIndex_TimeKeeper::collectEnd(NULL),0,TimeKeeperProxy);
79  //asymmetric AKA Lambda AKA Gamma
80  cfgAsymmPC.forwardTimerID = keeperRegister("Asym Forward");
81  cfgAsymmPC.backwardTimerID = keeperRegister("Asym Backward");
82  cfgAsymmPC.beginTimerCB = CkCallback(CkIndex_TimeKeeper::collectStart(NULL),0,TimeKeeperProxy);
83  cfgAsymmPC.endTimerCB = CkCallback(CkIndex_TimeKeeper::collectEnd(NULL),0,TimeKeeperProxy);
84 #endif
85 
86 #endif