@@ -60,7 +60,7 @@ namespace qmcplusplus
60
60
QMCMain::QMCMain (Communicate* c)
61
61
: QMCMainState(c),
62
62
QMCAppBase (),
63
- FirstQMC (true )
63
+ first_qmc_ (true )
64
64
#if !defined(REMOVE_TRACEMANAGER)
65
65
,
66
66
traces_xml (NULL )
@@ -116,13 +116,11 @@ QMCMain::QMCMain(Communicate* c)
116
116
}
117
117
app_summary () << " \n Precision used in this calculation, see definitions in the manual:"
118
118
<< " \n Base precision = " << GET_MACRO_VAL (OHMMS_PRECISION)
119
- << " \n Full precision = " << GET_MACRO_VAL (OHMMS_PRECISION_FULL)
120
- << std::endl;
119
+ << " \n Full precision = " << GET_MACRO_VAL (OHMMS_PRECISION_FULL) << std::endl;
121
120
122
121
// Record features configured in cmake or selected via command-line arguments to the printout
123
122
app_summary () << std::endl;
124
- #if !defined(ENABLE_OFFLOAD) && !defined(ENABLE_CUDA) && !defined(ENABLE_HIP) && \
125
- !defined (ENABLE_SYCL)
123
+ #if !defined(ENABLE_OFFLOAD) && !defined(ENABLE_CUDA) && !defined(ENABLE_HIP) && !defined(ENABLE_SYCL)
126
124
app_summary () << " CPU only build" << std::endl;
127
125
#else // GPU case
128
126
#if defined(ENABLE_OFFLOAD)
@@ -141,11 +139,10 @@ QMCMain::QMCMain(Communicate* c)
141
139
#endif
142
140
#endif // GPU case end
143
141
144
- #ifdef QMC_COMPLEX
145
- app_summary () << " Complex build. QMC_COMPLEX=ON" << std::endl;
146
- #else
147
- app_summary () << " Real build. QMC_COMPLEX=OFF" << std::endl;
148
- #endif
142
+ if (my_project_.isComplex ())
143
+ app_summary () << " Complex build. QMC_COMPLEX=ON" << std::endl;
144
+ else
145
+ app_summary () << " Real build. QMC_COMPLEX=OFF" << std::endl;
149
146
150
147
#ifdef ENABLE_TIMERS
151
148
app_summary () << " Timer build option is enabled. Current timer level is "
@@ -161,23 +158,23 @@ QMCMain::QMCMain(Communicate* c)
161
158
QMCMain::~QMCMain ()
162
159
{
163
160
// free last_driver before clearing P,Psi,H clones
164
- last_driver .reset ();
161
+ last_driver_ .reset ();
165
162
CloneManager::clearClones ();
166
163
}
167
164
168
165
169
166
bool QMCMain::execute ()
170
167
{
171
168
Timer t0;
172
- if (XmlDocStack .empty ())
169
+ if (xml_doc_stack_ .empty ())
173
170
{
174
171
ERRORMSG (" No valid input file exists! Aborting QMCMain::execute" )
175
172
return false ;
176
173
}
177
174
178
175
std::string simulationType = " realspaceQMC" ;
179
176
{ // mmorales: is this necessary??? Don't want to leave xmlNodes lying around unused
180
- xmlNodePtr cur = XmlDocStack .top ()->getRoot ();
177
+ xmlNodePtr cur = xml_doc_stack_ .top ()->getRoot ();
181
178
OhmmsAttributeSet simType;
182
179
simType.add (simulationType, " type" );
183
180
simType.add (simulationType, " name" );
@@ -194,11 +191,11 @@ bool QMCMain::execute()
194
191
<< " /*************************************************\n "
195
192
<< " ******** This is an AFQMC calculation ********\n "
196
193
<< " *************************************************" << std::endl;
197
- xmlNodePtr cur = XmlDocStack .top ()->getRoot ();
194
+ xmlNodePtr cur = xml_doc_stack_ .top ()->getRoot ();
198
195
199
- xmlXPathContextPtr m_context = XmlDocStack .top ()->getXPathContext ();
196
+ xmlXPathContextPtr m_context = xml_doc_stack_ .top ()->getXPathContext ();
200
197
// initialize the random number generator
201
- xmlNodePtr rptr = myRandomControl .initialize (m_context);
198
+ xmlNodePtr rptr = my_random_control_ .initialize (m_context);
202
199
203
200
auto world = boost::mpi3::environment::get_world_instance ();
204
201
afqmc::AFQMCFactory afqmc_fac (world);
@@ -207,7 +204,7 @@ bool QMCMain::execute()
207
204
app_log () << " Error in AFQMCFactory::parse() ." << std::endl;
208
205
return false ;
209
206
}
210
- cur = XmlDocStack .top ()->getRoot ();
207
+ cur = xml_doc_stack_ .top ()->getRoot ();
211
208
return afqmc_fac.execute (cur);
212
209
}
213
210
#else
@@ -250,11 +247,11 @@ bool QMCMain::execute()
250
247
Timer t1;
251
248
curMethod = std::string (" invalid" );
252
249
qmc_common.qmc_counter = 0 ;
253
- for (int qa = 0 ; qa < m_qmcaction .size (); qa++)
250
+ for (int qa = 0 ; qa < qmc_action_ .size (); qa++)
254
251
{
255
252
if (run_time_manager.isStopNeeded ())
256
253
break ;
257
- xmlNodePtr cur = m_qmcaction [qa].first ;
254
+ xmlNodePtr cur = qmc_action_ [qa].first ;
258
255
std::string cname ((const char *)cur->name );
259
256
if (cname == " qmc" || cname == " optimize" )
260
257
{
@@ -279,32 +276,32 @@ bool QMCMain::execute()
279
276
}
280
277
}
281
278
// free if m_qmcation owns the memory of xmlNodePtr before clearing
282
- for (auto & qmcactionPair : m_qmcaction )
279
+ for (auto & qmcactionPair : qmc_action_ )
283
280
if (!qmcactionPair.second )
284
281
xmlFreeNode (qmcactionPair.first );
285
282
286
- m_qmcaction .clear ();
283
+ qmc_action_ .clear ();
287
284
t2->stop ();
288
285
app_log () << " Total Execution time = " << std::setprecision (4 ) << t1.elapsed () << " secs" << std::endl;
289
286
if (is_manager ())
290
287
{
291
288
// generate multiple files
292
289
xmlNodePtr mcptr = NULL ;
293
- if (m_walkerset .size ())
294
- mcptr = m_walkerset [0 ];
290
+ if (walker_set_ .size ())
291
+ mcptr = walker_set_ [0 ];
295
292
// remove input mcwalkerset but one
296
- for (int i = 1 ; i < m_walkerset .size (); i++)
293
+ for (int i = 1 ; i < walker_set_ .size (); i++)
297
294
{
298
- xmlUnlinkNode (m_walkerset [i]);
299
- xmlFreeNode (m_walkerset [i]);
295
+ xmlUnlinkNode (walker_set_ [i]);
296
+ xmlFreeNode (walker_set_ [i]);
300
297
}
301
- m_walkerset .clear (); // empty the container
298
+ walker_set_ .clear (); // empty the container
302
299
std::ostringstream np_str, v_str;
303
300
np_str << myComm->size ();
304
301
HDFVersion cur_version;
305
302
v_str << cur_version[0 ] << " " << cur_version[1 ];
306
303
xmlNodePtr newmcptr = xmlNewNode (NULL , (const xmlChar*)" mcwalkerset" );
307
- xmlNewProp (newmcptr, (const xmlChar*)" fileroot" , (const xmlChar*)myProject .currentMainRoot ().c_str ());
304
+ xmlNewProp (newmcptr, (const xmlChar*)" fileroot" , (const xmlChar*)my_project_ .currentMainRoot ().c_str ());
308
305
xmlNewProp (newmcptr, (const xmlChar*)" node" , (const xmlChar*)" -1" );
309
306
xmlNewProp (newmcptr, (const xmlChar*)" nprocs" , (const xmlChar*)np_str.str ().c_str ());
310
307
xmlNewProp (newmcptr, (const xmlChar*)" version" , (const xmlChar*)v_str.str ().c_str ());
@@ -315,7 +312,7 @@ bool QMCMain::execute()
315
312
// #endif
316
313
if (mcptr == NULL )
317
314
{
318
- xmlAddNextSibling (lastInputNode , newmcptr);
315
+ xmlAddNextSibling (last_input_node_ , newmcptr);
319
316
}
320
317
else
321
318
{
@@ -359,7 +356,7 @@ void QMCMain::executeLoop(xmlNodePtr cur)
359
356
}
360
357
}
361
358
// Destroy the last driver at the end of a loop with no further reuse of a driver needed.
362
- last_driver .reset (nullptr );
359
+ last_driver_ .reset (nullptr );
363
360
}
364
361
365
362
bool QMCMain::executeQMCSection (xmlNodePtr cur, bool reuse)
@@ -375,7 +372,7 @@ bool QMCMain::executeQMCSection(xmlNodePtr cur, bool reuse)
375
372
if (qmcSystem == 0 )
376
373
qmcSystem = ptclPool->getWalkerSet (target);
377
374
bool success = runQMC (cur, reuse);
378
- FirstQMC = false ;
375
+ first_qmc_ = false ;
379
376
return success;
380
377
}
381
378
@@ -395,27 +392,27 @@ bool QMCMain::executeQMCSection(xmlNodePtr cur, bool reuse)
395
392
*/
396
393
bool QMCMain::validateXML ()
397
394
{
398
- xmlXPathContextPtr m_context = XmlDocStack .top ()->getXPathContext ();
395
+ xmlXPathContextPtr m_context = xml_doc_stack_ .top ()->getXPathContext ();
399
396
OhmmsXPathObject result (" //project" , m_context);
400
- myProject .setCommunicator (myComm);
397
+ my_project_ .setCommunicator (myComm);
401
398
if (result.empty ())
402
399
{
403
400
app_warning () << " Project is not defined" << std::endl;
404
- myProject .reset ();
401
+ my_project_ .reset ();
405
402
}
406
403
else
407
404
{
408
405
try
409
406
{
410
- myProject .put (result[0 ]);
407
+ my_project_ .put (result[0 ]);
411
408
}
412
409
catch (const UniformCommunicateError& ue)
413
410
{
414
411
myComm->barrier_and_abort (ue.what ());
415
412
}
416
413
}
417
414
app_summary () << std::endl;
418
- myProject .get (app_summary ());
415
+ my_project_ .get (app_summary ());
419
416
app_summary () << std::endl;
420
417
OhmmsXPathObject ham (" //hamiltonian" , m_context);
421
418
if (ham.empty ())
@@ -447,10 +444,10 @@ bool QMCMain::validateXML()
447
444
}
448
445
449
446
// initialize the random number generator
450
- xmlNodePtr rptr = myRandomControl .initialize (m_context);
447
+ xmlNodePtr rptr = my_random_control_ .initialize (m_context);
451
448
// preserve the input order
452
- xmlNodePtr cur = XmlDocStack .top ()->getRoot ()->children ;
453
- lastInputNode = NULL ;
449
+ xmlNodePtr cur = xml_doc_stack_ .top ()->getRoot ()->children ;
450
+ last_input_node_ = NULL ;
454
451
while (cur != NULL )
455
452
{
456
453
std::string cname ((const char *)cur->name );
@@ -476,7 +473,7 @@ bool QMCMain::validateXML()
476
473
bool success = pushDocument (include_name);
477
474
if (success)
478
475
{
479
- inputnode = processPWH (XmlDocStack .top ()->getRoot ());
476
+ inputnode = processPWH (xml_doc_stack_ .top ()->getRoot ());
480
477
popDocument ();
481
478
}
482
479
else
@@ -503,11 +500,11 @@ bool QMCMain::validateXML()
503
500
else
504
501
{
505
502
// everything else goes to m_qmcaction
506
- m_qmcaction .push_back (std::pair<xmlNodePtr, bool >(cur, true ));
503
+ qmc_action_ .push_back (std::pair<xmlNodePtr, bool >(cur, true ));
507
504
inputnode = false ;
508
505
}
509
506
if (inputnode)
510
- lastInputNode = cur;
507
+ last_input_node_ = cur;
511
508
cur = cur->next ;
512
509
}
513
510
@@ -585,7 +582,7 @@ bool QMCMain::processPWH(xmlNodePtr cur)
585
582
else
586
583
// add to m_qmcaction
587
584
{
588
- m_qmcaction .push_back (std::pair<xmlNodePtr, bool >(xmlCopyNode (cur, 1 ), false ));
585
+ qmc_action_ .push_back (std::pair<xmlNodePtr, bool >(xmlCopyNode (cur, 1 ), false ));
589
586
}
590
587
cur = cur->next ;
591
588
}
@@ -604,11 +601,11 @@ bool QMCMain::runQMC(xmlNodePtr cur, bool reuse)
604
601
std::unique_ptr<QMCDriverInterface> qmc_driver;
605
602
bool append_run = false ;
606
603
607
- if (reuse && last_driver )
608
- qmc_driver = std::move (last_driver );
604
+ if (reuse && last_driver_ )
605
+ qmc_driver = std::move (last_driver_ );
609
606
else
610
607
{
611
- QMCDriverFactory driver_factory (myProject );
608
+ QMCDriverFactory driver_factory (my_project_ );
612
609
try
613
610
{
614
611
QMCDriverFactory::DriverAssemblyState das = driver_factory.readSection (cur);
@@ -624,24 +621,24 @@ bool QMCMain::runQMC(xmlNodePtr cur, bool reuse)
624
621
625
622
if (qmc_driver)
626
623
{
627
- if (last_branch_engine_legacy_driver )
624
+ if (last_branch_engine_legacy_driver_ )
628
625
{
629
- last_branch_engine_legacy_driver ->resetRun (cur);
630
- qmc_driver->setBranchEngine (std::move (last_branch_engine_legacy_driver ));
626
+ last_branch_engine_legacy_driver_ ->resetRun (cur);
627
+ qmc_driver->setBranchEngine (std::move (last_branch_engine_legacy_driver_ ));
631
628
}
632
629
633
630
// advance the project id
634
631
// if it is NOT the first qmc node and qmc/@append!='yes'
635
- if (!FirstQMC && !append_run)
636
- myProject .advance ();
632
+ if (!first_qmc_ && !append_run)
633
+ my_project_ .advance ();
637
634
638
- qmc_driver->setStatus (myProject .currentMainRoot (), " " , append_run);
635
+ qmc_driver->setStatus (my_project_ .currentMainRoot (), " " , append_run);
639
636
// PD:
640
- // Q: How does m_walkerset_in end up being non empty?
637
+ // Q: How does walker_set_in end up being non empty?
641
638
// A: Anytime that we aren't doing a restart.
642
639
// So put walkers is an exceptional call. This code does not tell a useful
643
640
// story of a QMCDriver's life.
644
- qmc_driver->putWalkers (m_walkerset_in );
641
+ qmc_driver->putWalkers (walker_set_in_ );
645
642
#if !defined(REMOVE_TRACEMANAGER)
646
643
qmc_driver->putTraces (traces_xml);
647
644
#endif
@@ -652,10 +649,10 @@ bool QMCMain::runQMC(xmlNodePtr cur, bool reuse)
652
649
qmc_driver->run ();
653
650
app_log () << " QMC Execution time = " << std::setprecision (4 ) << qmcTimer.elapsed () << " secs" << std::endl;
654
651
// transfer the states of a driver before its destruction
655
- last_branch_engine_legacy_driver = qmc_driver->getBranchEngine ();
652
+ last_branch_engine_legacy_driver_ = qmc_driver->getBranchEngine ();
656
653
// save the driver in a driver loop
657
654
if (reuse)
658
- last_driver = std::move (qmc_driver);
655
+ last_driver_ = std::move (qmc_driver);
659
656
return true ;
660
657
}
661
658
else
@@ -676,8 +673,8 @@ bool QMCMain::setMCWalkers(xmlXPathContextPtr context_)
676
673
for (int iconf = 0 ; iconf < result.size (); iconf++)
677
674
{
678
675
xmlNodePtr mc_ptr = result[iconf];
679
- m_walkerset .push_back (mc_ptr);
680
- m_walkerset_in .push_back (mc_ptr);
676
+ walker_set_ .push_back (mc_ptr);
677
+ walker_set_in_ .push_back (mc_ptr);
681
678
}
682
679
// use the last mcwalkerset to initialize random numbers if possible
683
680
if (result.size ())
0 commit comments