OpenAtom  Version1.5a
configure.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * $Source$
3  * $Author$
4  * $Date$
5  * $Revision$
6  *****************************************************************************/
7 
8 /** \file configure.h
9  *
10  */
11 
12 #ifndef _Configure_
13 #define _Configure_
14 
15 #include "dictionary.h"
16 #include "pup.h"
17 
18 ///////////////////////////////////////////////////////////////////////////////////==
19 ///////////////////////////////////////////////////////////////////////////////////cc
20 ///////////////////////////////////////////////////////////////////////////////////==
21 class Config {
22 ///////////////////////////////////////////////////////////////////////////////////==
23  public:
24 
25  ///////////////////////////////////=
26  // input or derived parameters
27  //----------------------------------
28 
29  int numPes; // num of procs (driver)
30  int numPesPerInstance;// num of procs for mapping
31  // of one instance (driver)
32  int nstates; // num of states (piny)
33  int maxIter; // num of iterations (piny)
34  int fftopt; // fft type[fftw/essl] (piny)
35  int natm_nl; // num of nonlocal atoms (piny)
36  int natm_typ; // number of atm types (piny)
37  int nGplane_x; // g-grid points along x (piny)
38  int nRplane_x; // g-grid points along x (piny)
39  int numFFTPoints; // size number of r-grid (piny)
40  int numData; // size number of g-grid (piny)
41  int ees_eext_opt; // ees eext option on/off (piny)
42  int gen_wave; // generate initial states (piny)
43  int nchareG; // num state g-space chares (driver)
44  int nchareRhoG; // num rho g-space chares (driver)
45  int nchareVdW; // num VanderWalls chares (driver)
46  int scalc_per_plane; // num of scalcs g-plane (driver)
47 
48  int UberImax;
49  int UberJmax;
50  int UberKmax;
51  int UberMmax;
52  int numInstances;
53  int temperCycle;
54  ///////////////////////////////////=
55 
56  ///////////////////////////////////=
57  // density control flags and values
58  //----------------------------------
59  int nchareHartAtmT;
60  int rhoLineOrder;
61  int rhorHartpriority;
62  int rhogHartpriority;
63  int useGHartInsRhoRP;
64  int useGHartInsRHart;
65  int useRHartInsGHart;
66  int rhorpriority;
67  int rhogpriority;
68  double gExpandFactRho;
69  int lbdensity;
70  int rhoGHelpers;
71  int rhoRsubplanes;
72  int rhoSubPlaneBalance;
73  int rhoGToRhoRMsgComb;
74  int prioEextFFTMsg;
75  ///////////////////////////////////=
76  // density commlib flags
77  //----------------------------------
78  int useGIns0RhoRP;
79  int useGIns1RhoRP;
80  int useGIns2RhoRP;
81  int useGIns3RhoRP;
82  int useGByrdInsRhoRBP;
83  int useRInsRhoGP;
84  int useRInsIGXRhoGP;
85  int useRInsIGYRhoGP;
86  int useRInsIGZRhoGP;
87  ///////////////////////////////////=
88 
89  ///////////////////////////////////=
90  // state control flags and values
91  //----------------------------------
92  char dataPath[1024];
93  int gBucketSize;
94  int rBucketSize;
95  double gStreamPeriod;
96  double rStreamPeriod;
97  double gExpandFact;
98  int stateOutput;
99  int psipriority;
100  int prioFFTMsg;
101  int rsfftpriority;
102  int gsfftpriority;
103  int rsifftpriority;
104  int gsifftpriority;
105  int conserveMemory;
106  int lbgspace;
107  int doublePack;
108  int useGssInsRealP;
109  int useMssInsGP;
110  char dataPathOut[1024];
111  ///////////////////////////////////=
112 
113  ///////////////////////////////////=
114  // PC control flags and values
115  //----------------------------------
116  int usePairDirectSend;
117  int PCCollectTiles;
118  int PCdelayBWSend;
119  int PCstreamBWout;
120  int PCstreamFWblock;
121  double invsqr_tolerance;
122  int invsqr_max_iter;
123  int useOrthoDirect;
124  int useOrthoHelpers;
125  int useOrthoSection;
126  int useOrthoSectionRed;
127  int lambdaGrainSize;
128  int PCSpanFactor;
129  int OrthoRedSpanFactor;
130  int OrthoMcastSpanFactor;
131  int sGrainSize;
132  int gemmSplitFWk;
133  int gemmSplitFWm;
134  int gemmSplitBW;
135  int gemmSplitOrtho;
136  int orthoGrainSize;
137  int useBWBarrier;
138  int phantomSym;
139  int lbpaircalc;
140  int lambdapriority;
141  int toleranceInterval;
142  int gSpaceSum;
143  int numChunks;
144  int numChunksSym;
145  int numChunksAsym;
146  int prioBW;
147  int usePairEtoM;
148  ///////////////////////////////////=
149 
150  ///////////////////////////////////=
151  // NL control flags and values
152  //----------------------------------
153  int sfpriority;
154  int prioNLFFTMsg;
155  int rsNLfftpriority;
156  int gsNLfftpriority;
157  int numSfGrps;
158  int numSfDups;
159  int launchNLeesFromRho;
160  int useGssInsRealPP;
161  int useMssInsGPP;
162  ///////////////////////////////////=
163 
164  ///////////////////////////////////=
165  // General control flags and values
166  //----------------------------------
167  int useTimeKeeper;
168  int fftprogresssplit;
169  int fftprogresssplitReal;
170  int useCommlib;
171  int useGMulticast;
172  int numMulticastMsgs;
173  int useCommlibMulticast;
174  int atmOutput;
175  ///////////////////////////////////=
176 
177  ///////////////////////////////////=
178  // Mapping control flags and values
179  //----------------------------------
180  int torusMap;
181  int forceMappingAxis;
182  int useCuboidMap;
183  int useCuboidMapRS;
184  int useStrictCuboid;
185  int useCentroidMap;
186  int useCentroidMapRho;
187  int Gstates_per_pe;
188  int Rstates_per_pe;
189  int loadMapFiles;
190  int dumpMapFiles;
191  int dumpMapCoordFiles;
192  int useRhoExclusionMap;
193  int excludePE0;
194  int useReductionExclusionMap;
195  int fakeTorus;
196  int torusDimNX; // use these to do torus logic testing
197  int torusDimNY;
198  int torusDimNZ;
199  int torusDimNT;
200 
201  ///////////////////////////////////=
202 
203  ///////////////////////////////////=
204  // Network progress checking frequencies (useful only on BGL where you have to periodically let call CmiNetworkProgress)
205  //----------------------------------
206  // nfreq_classname_methodname (Class and method names may have been shortened a bit)
207  int nfreq_cpintegrate; ///< CPINTEGRATE::CP_integrate_min_STD, CPINTEGRATE::CP_integrate_min_CG
208  int nfreq_cplocal_hartext; ///< CPLOCAL::CP_hart_eext_calc
209  int nfreq_cplocal_eeshart; ///< CPLOCAL::eesHartEextGchare
210  int nfreq_cplocal_eesewald; ///< CPLOCAL::eesEwaldGchare
211  int nfreq_cpnonlocal_eke; ///< CPNONLOCAL::CP_eke_calc
212  int nfreq_cpnonlocal_eesfwd; ///< CPNONLOCAL::eesProjGchare, CPNONLOCAL::eesYlmOnD
213  int nfreq_cpnonlocal_eesbk; ///< CPNONLOCAL::eesPsiForcGspace
214  int nfreq_xcfnctl; ///< CPXCFNCTS::CP_exc_calc, CPXCFNCTS::CP_getGGAFunctional
215  ///////////////////////////////////=
216 
217  ///////////////////////////////////=
218  // Class Functions
219  //----------------------------------
220  Config(){};
221  ~Config(){};
222  void readConfig(char*, int, int, int, int, int, int, int, int, int, int, int, int,int,int,int,
223  int ,int , int , int , int );
224  void readStateInfo(int &, int &, int &, int &, int &, int &,const char *, int,int,int,int,int);
225  void simpleRangeCheck();
226  void rangeExit(int, const char *, int);
227  void Finale(int, int, int, int, int, int);
228 
229  void set_config_dict_fun (int *, DICT_WORD **);
230  void set_config_dict_gen (int *, DICT_WORD **);
231  void set_config_dict_rho (int *, DICT_WORD **);
232  void set_config_dict_state (int *, DICT_WORD **);
233  void set_config_dict_pc (int *, DICT_WORD **);
234  void set_config_dict_nl (int *, DICT_WORD **);
235  void set_config_dict_map (int *, DICT_WORD **);
236  void set_config_dict_nfreq (int *, DICT_WORD **);
237 
238  void set_config_params_gen (DICT_WORD *, char *, char *);
239  void set_config_params_rho (DICT_WORD *, char *, char *, int);
240  void set_config_params_state(DICT_WORD *, char *, char *, int);
241  void set_config_params_pc (DICT_WORD *, char *, char *);
242  void set_config_params_nl (DICT_WORD *, char *, char *, int);
243  void set_config_params_map (DICT_WORD *, char *, char *);
244  void set_config_params_nfreq(DICT_WORD *, char *, char *);
245  void guesstimateParmsConfig (int, DICT_WORD *, DICT_WORD *, DICT_WORD *,
246  DICT_WORD *, DICT_WORD *,DICT_WORD *,
247  int, int, int );
248  int approxFactor(int nstates,int &sGrainSize, int &oGrainSize,int numPes);
249  void write_cpaimd_config (FILE *, DICT_WORD *, int, char *);
250  void load_cpaimd_config (DICT_WORD *, int, PINY_NAME *, PINY_NAME *, int, int *);
251  bool isPow2(int input){
252  int y=0;
253  for(int x=0;x<32;x++){
254  y = 1<<x;
255  if(y==input){return true;}
256  }//endfor
257  return false;
258  }
259 //////////////////////////////////////////////////////////////////////////////
260  ///////////////////////////////////=
261 
262 //-----------------------------------------------------------------------------------
263  }; // end class
264 ///////////////////////////////////////////////////////////////////////////////////==
265 
266 #ifndef _COOL_CONVERSION_ON_
267 PUPbytes(Config)
268 #endif
269 
270 ///////////////////////////////////////////////////////////////////////////////////==
271 
272 #endif
int nfreq_cpnonlocal_eesbk
CPNONLOCAL::eesPsiForcGspace.
Definition: configure.h:213
int nfreq_xcfnctl
CPXCFNCTS::CP_exc_calc, CPXCFNCTS::CP_getGGAFunctional ////////////////////////////////=.
Definition: configure.h:214
int nfreq_cplocal_eesewald
CPLOCAL::eesEwaldGchare.
Definition: configure.h:210
int nfreq_cpintegrate
CPINTEGRATE::CP_integrate_min_STD, CPINTEGRATE::CP_integrate_min_CG.
Definition: configure.h:207
int nfreq_cpnonlocal_eesfwd
CPNONLOCAL::eesProjGchare, CPNONLOCAL::eesYlmOnD.
Definition: configure.h:212
int nfreq_cplocal_hartext
CPLOCAL::CP_hart_eext_calc.
Definition: configure.h:208
int nfreq_cpnonlocal_eke
CPNONLOCAL::CP_eke_calc.
Definition: configure.h:211
int nfreq_cplocal_eeshart
CPLOCAL::eesHartEextGchare.
Definition: configure.h:209