OpenAtom  Version1.5a
orthostartup.C
1 #ifndef _ORTHOSTARTUP_H
2 #define _ORTHOSTARTUP_H
3 
4 #include "paircalcstartup.h"
5  // Blame Ram for ugly crime against readability. More
6  // redundant config objects and builders doesn't help
7  // global clarity at all.
8  // EJB: Sequestered in this file to sweep it under the rug
9 
10  cp::ortho::orthoConfig orthoCfg;
11  orthoCfg.isDynamics = (sim->cp_min_opt==1)? false: true;
12  orthoCfg.isGenWave = (sim->gen_wave==1)? true: false;
13  orthoCfg.numStates = config.nstates;
14  orthoCfg.grainSize = config.orthoGrainSize;
15  orthoCfg.instanceIndex = thisInstance.getPO();
16  orthoCfg.maxTolerance = sim->tol_norb;
17  orthoCfg.uponToleranceFailure = CkCallback(CkIndex_GSpaceDriver::needUpdatedPsiV(), UgSpaceDriverProxy[thisInstance.getPO()]);
18 
19  // Fill in the paircalc configs that are instance dependent
20  cfgSymmPC.gSpaceAID = UgSpacePlaneProxy[thisInstance.getPO()].ckGetArrayID();
21  cfgAsymmPC.gSpaceAID = UgSpacePlaneProxy[thisInstance.getPO()].ckGetArrayID();
22  cfgSymmPC.instanceIndex = thisInstance.getPO();
23  cfgAsymmPC.instanceIndex = thisInstance.getPO();
24  // Init the post-init callbacks that the paircalcs will trigger (after ortho<-->PC comm setup)
25  cfgSymmPC.uponSetupCompletion = CkCallback(CkIndex_InstanceController::doneInit(NULL),CkArrayIndex1D(thisInstance.getPO()),instControllerProxy.ckGetArrayID());
26  cfgAsymmPC.uponSetupCompletion = CkCallback(CkIndex_InstanceController::doneInit(NULL),CkArrayIndex1D(thisInstance.getPO()),instControllerProxy.ckGetArrayID());
27 
28  // Identify who is the owner for this bubble
29  CkCallback pcHandleCB(CkIndex_CP_State_GSpacePlane::acceptPairCalcAIDs(0), UgSpacePlaneProxy[thisInstance.getPO()]);
30 
31  // Fill out a structure with all configs needed for PC mapping
32  cp::startup::PCMapConfig pcMapCfg(boxSize,
33  *peList4PCmapping,
34  &GSImaptable[thisInstance.getPO()],
35  (config.torusMap == 1),
36  (config.fakeTorus == 1),
37  mapOffsets[numInst]);
38 
39  // Delegate the actual construction/initialization to a creation manager
40  cp::startup::PCCreationManager pcCreator(cfgSymmPC, cfgAsymmPC, orthoCfg);
41  pcCreator.build(pcHandleCB, pcMapCfg);
42 #endif
int grainSize
The block size for parallelization.
Definition: orthoConfig.h:31
int numStates
The number of states in the simulation (the dimension of the input square matrix) ...
Definition: orthoConfig.h:29
double maxTolerance
The tolerance threshold for the S->T iterations in Ortho at which to trigger a PsiV update...
Definition: orthoConfig.h:36
A container for assorted mapping inputs to pass around easily.
Definition: pcMapConfig.h:15
Configuration settings for the ortho world.
Definition: orthoConfig.h:17
bool isDynamics
Is this a minimization or dynamics run.
Definition: orthoConfig.h:21
void build(CkCallback cb, const PCMapConfig &mapCfg)
CkCallback uponToleranceFailure
Callback to notify bubble owner (GSpace) that a tolerance update is needed.
Definition: orthoConfig.h:38
Manages the creation of a complete paircalc bubble that includes two paircalc instances (symmetric an...
bool isGenWave
If, this is a minimization run, is it for generating the system wave functions?
Definition: orthoConfig.h:23