# | Line 6 | Line 6 | |
---|---|---|
6 | #include "parse_me.h" | |
7 | #include "LRI.hpp" | |
8 | #include "Integrator.hpp" | |
9 | + | #include "simError.h" |
10 | ||
11 | #ifdef IS_MPI | |
12 | #include "mpiBASS.h" | |
# | Line 15 | Line 16 | SimSetup::SimSetup(){ | |
16 | SimSetup::SimSetup(){ | |
17 | stamps = new MakeStamps(); | |
18 | globals = new Globals(); | |
19 | + | |
20 | + | #ifdef IS_MPI |
21 | + | strcpy( checkPointMsg, "SimSetup creation successful" ); |
22 | + | MPIcheckPoint(); |
23 | + | #endif // IS_MPI |
24 | } | |
25 | ||
26 | SimSetup::~SimSetup(){ | |
# | Line 24 | Line 30 | void SimSetup::parseFile( char* fileName ){ | |
30 | ||
31 | void SimSetup::parseFile( char* fileName ){ | |
32 | ||
27 | – | inFileName = fileName; |
28 | – | set_interface_stamps( stamps, globals ); |
33 | #ifdef IS_MPI | |
34 | < | mpiEventInit(); |
34 | > | if( worldRank == 0 ){ |
35 | > | #endif // is_mpi |
36 | > | |
37 | > | inFileName = fileName; |
38 | > | set_interface_stamps( stamps, globals ); |
39 | > | |
40 | > | #ifdef IS_MPI |
41 | > | mpiEventInit(); |
42 | #endif | |
43 | < | yacc_BASS( fileName ); |
43 | > | |
44 | > | yacc_BASS( fileName ); |
45 | > | |
46 | #ifdef IS_MPI | |
47 | < | throwMPIEvent(NULL); |
47 | > | throwMPIEvent(NULL); |
48 | > | } |
49 | > | else receiveParse(); |
50 | #endif | |
51 | ||
52 | } | |
# | Line 41 | Line 56 | void SimSetup::receiveParse(void){ | |
56 | ||
57 | set_interface_stamps( stamps, globals ); | |
58 | mpiEventInit(); | |
59 | + | MPIcheckPoint(); |
60 | mpiEventLoop(); | |
61 | ||
62 | } | |
# | Line 52 | Line 68 | void SimSetup::testMe(void){ | |
68 | delete dumpMe; | |
69 | } | |
70 | #endif | |
71 | + | |
72 | void SimSetup::createSim( void ){ | |
73 | ||
74 | MakeStamps *the_stamps; | |
# | Line 76 | Line 93 | void SimSetup::createSim( void ){ | |
93 | else if( !strcmp( force_field, "DipoleTest" ) ) the_ff = new DipoleTestFF(); | |
94 | else if( !strcmp( force_field, "TraPPE_Ex" ) ) the_ff = new TraPPE_ExFF(); | |
95 | else{ | |
96 | < | std::cerr<< "SimSetup Error. Unrecognized force field -> " |
97 | < | << force_field << "\n"; |
98 | < | exit(8); |
96 | > | sprintf( painCave.errMsg, |
97 | > | "SimSetup Error. Unrecognized force field -> %s\n", |
98 | > | force_field ); |
99 | > | painCave.isFatal = 1; |
100 | > | simError(); |
101 | } | |
102 | ||
103 | + | #ifdef IS_MPI |
104 | + | strcpy( checkPointMsg, "ForceField creation successful" ); |
105 | + | MPIcheckPoint(); |
106 | + | #endif // is_mpi |
107 | + | |
108 | // get the components and calculate the tot_nMol and indvidual n_mol | |
109 | the_components = the_globals->getComponents(); | |
110 | components_nmol = new int[n_components]; | |
# | Line 155 | Line 179 | void SimSetup::createSim( void ){ | |
179 | ||
180 | // create the atom and short range interaction arrays | |
181 | ||
158 | – | the_atoms = new Atom*[tot_atoms]; |
182 | Atom::createArrays(tot_atoms); | |
183 | + | the_atoms = new Atom*[tot_atoms]; |
184 | the_molecules = new Molecule[tot_nmol]; | |
185 | ||
186 | ||
# | Line 256 | Line 280 | void SimSetup::createSim( void ){ | |
280 | // else{ | |
281 | ||
282 | initFromBass(); | |
259 | – | |
260 | – | |
261 | – | // } |
262 | – | |
263 | – | // if( the_globals->haveFinalConfig() ){ |
264 | – | // strcpy( simnfo->finalName, the_globals->getFinalConfig() ); |
265 | – | // } |
266 | – | // else{ |
267 | – | // strcpy( simnfo->finalName, inFileName ); |
268 | – | // char* endTest; |
269 | – | // int nameLength = strlen( simnfo->finalName ); |
270 | – | // endTest = &(simnfo->finalName[nameLength - 5]); |
271 | – | // if( !strcmp( endTest, ".bass" ) ){ |
272 | – | // strcpy( endTest, ".eor" ); |
273 | – | // } |
274 | – | // else if( !strcmp( endTest, ".BASS" ) ){ |
275 | – | // strcpy( endTest, ".eor" ); |
276 | – | // } |
277 | – | // else{ |
278 | – | // endTest = &(simnfo->finalName[nameLength - 4]); |
279 | – | // if( !strcmp( endTest, ".bss" ) ){ |
280 | – | // strcpy( endTest, ".eor" ); |
281 | – | // } |
282 | – | // else if( !strcmp( endTest, ".mdl" ) ){ |
283 | – | // strcpy( endTest, ".eor" ); |
284 | – | // } |
285 | – | // else{ |
286 | – | // strcat( simnfo->finalName, ".eor" ); |
287 | – | // } |
288 | – | // } |
289 | – | // } |
283 | ||
291 | – | // // make the sample and status out names |
284 | ||
293 | – | // strcpy( simnfo->sampleName, inFileName ); |
294 | – | // char* endTest; |
295 | – | // int nameLength = strlen( simnfo->sampleName ); |
296 | – | // endTest = &(simnfo->sampleName[nameLength - 5]); |
297 | – | // if( !strcmp( endTest, ".bass" ) ){ |
298 | – | // strcpy( endTest, ".dump" ); |
285 | // } | |
300 | – | // else if( !strcmp( endTest, ".BASS" ) ){ |
301 | – | // strcpy( endTest, ".dump" ); |
302 | – | // } |
303 | – | // else{ |
304 | – | // endTest = &(simnfo->sampleName[nameLength - 4]); |
305 | – | // if( !strcmp( endTest, ".bss" ) ){ |
306 | – | // strcpy( endTest, ".dump" ); |
307 | – | // } |
308 | – | // else if( !strcmp( endTest, ".mdl" ) ){ |
309 | – | // strcpy( endTest, ".dump" ); |
310 | – | // } |
311 | – | // else{ |
312 | – | // strcat( simnfo->sampleName, ".dump" ); |
313 | – | // } |
314 | – | // } |
286 | ||
287 | < | // strcpy( simnfo->statusName, inFileName ); |
288 | < | // nameLength = strlen( simnfo->statusName ); |
289 | < | // endTest = &(simnfo->statusName[nameLength - 5]); |
290 | < | // if( !strcmp( endTest, ".bass" ) ){ |
291 | < | // strcpy( endTest, ".stat" ); |
292 | < | // } |
293 | < | // else if( !strcmp( endTest, ".BASS" ) ){ |
294 | < | // strcpy( endTest, ".stat" ); |
295 | < | // } |
296 | < | // else{ |
297 | < | // endTest = &(simnfo->statusName[nameLength - 4]); |
298 | < | // if( !strcmp( endTest, ".bss" ) ){ |
299 | < | // strcpy( endTest, ".stat" ); |
300 | < | // } |
301 | < | // else if( !strcmp( endTest, ".mdl" ) ){ |
302 | < | // strcpy( endTest, ".stat" ); |
303 | < | // } |
304 | < | // else{ |
305 | < | // strcat( simnfo->statusName, ".stat" ); |
306 | < | // } |
307 | < | // } |
308 | < | |
287 | > | #ifdef IS_MPI |
288 | > | if( worldRank == TESTWRITE ){ |
289 | > | #endif // is_mpi |
290 | > | |
291 | > | fprintf( stderr, |
292 | > | "infile name is \"%s\"\n", |
293 | > | inFileName ); |
294 | > | |
295 | > | inFileName = "./butane.bass"; |
296 | > | |
297 | > | if( the_globals->haveFinalConfig() ){ |
298 | > | strcpy( simnfo->finalName, the_globals->getFinalConfig() ); |
299 | > | } |
300 | > | else{ |
301 | > | strcpy( simnfo->finalName, inFileName ); |
302 | > | char* endTest; |
303 | > | int nameLength = strlen( simnfo->finalName ); |
304 | > | endTest = &(simnfo->finalName[nameLength - 5]); |
305 | > | if( !strcmp( endTest, ".bass" ) ){ |
306 | > | strcpy( endTest, ".eor" ); |
307 | > | } |
308 | > | else if( !strcmp( endTest, ".BASS" ) ){ |
309 | > | strcpy( endTest, ".eor" ); |
310 | > | } |
311 | > | else{ |
312 | > | endTest = &(simnfo->finalName[nameLength - 4]); |
313 | > | if( !strcmp( endTest, ".bss" ) ){ |
314 | > | strcpy( endTest, ".eor" ); |
315 | > | } |
316 | > | else if( !strcmp( endTest, ".mdl" ) ){ |
317 | > | strcpy( endTest, ".eor" ); |
318 | > | } |
319 | > | else{ |
320 | > | strcat( simnfo->finalName, ".eor" ); |
321 | > | } |
322 | > | } |
323 | > | } |
324 | > | |
325 | > | // make the sample and status out names |
326 | > | |
327 | > | strcpy( simnfo->sampleName, inFileName ); |
328 | > | char* endTest; |
329 | > | int nameLength = strlen( simnfo->sampleName ); |
330 | > | endTest = &(simnfo->sampleName[nameLength - 5]); |
331 | > | if( !strcmp( endTest, ".bass" ) ){ |
332 | > | strcpy( endTest, ".dump" ); |
333 | > | } |
334 | > | else if( !strcmp( endTest, ".BASS" ) ){ |
335 | > | strcpy( endTest, ".dump" ); |
336 | > | } |
337 | > | else{ |
338 | > | endTest = &(simnfo->sampleName[nameLength - 4]); |
339 | > | if( !strcmp( endTest, ".bss" ) ){ |
340 | > | strcpy( endTest, ".dump" ); |
341 | > | } |
342 | > | else if( !strcmp( endTest, ".mdl" ) ){ |
343 | > | strcpy( endTest, ".dump" ); |
344 | > | } |
345 | > | else{ |
346 | > | strcat( simnfo->sampleName, ".dump" ); |
347 | > | } |
348 | > | } |
349 | > | |
350 | > | strcpy( simnfo->statusName, inFileName ); |
351 | > | nameLength = strlen( simnfo->statusName ); |
352 | > | endTest = &(simnfo->statusName[nameLength - 5]); |
353 | > | if( !strcmp( endTest, ".bass" ) ){ |
354 | > | strcpy( endTest, ".stat" ); |
355 | > | } |
356 | > | else if( !strcmp( endTest, ".BASS" ) ){ |
357 | > | strcpy( endTest, ".stat" ); |
358 | > | } |
359 | > | else{ |
360 | > | endTest = &(simnfo->statusName[nameLength - 4]); |
361 | > | if( !strcmp( endTest, ".bss" ) ){ |
362 | > | strcpy( endTest, ".stat" ); |
363 | > | } |
364 | > | else if( !strcmp( endTest, ".mdl" ) ){ |
365 | > | strcpy( endTest, ".stat" ); |
366 | > | } |
367 | > | else{ |
368 | > | strcat( simnfo->statusName, ".stat" ); |
369 | > | } |
370 | > | } |
371 | > | |
372 | > | #ifdef IS_MPI |
373 | > | } |
374 | > | #endif // is_mpi |
375 | ||
376 | // set the status, sample, and themal kick times | |
377 |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |