QMCPACK
EstimatorManagerBaseTest.cpp
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////////////////
2 // This file is distributed under the University of Illinois/NCSA Open Source License.
3 // See LICENSE file in top directory for details.
4 //
5 // Copyright (c) 2020 QMCPACK developers.
6 //
7 // File developed by: Peter Doak, doakpw@ornl.gov, Oak Ridge National Laboratory
8 //
9 // File created by: Peter Doak, doakpw@ornl.gov, Oak Ridge National Laboratory
10 //////////////////////////////////////////////////////////////////////////////////////
11 
15 
16 namespace qmcplusplus {
17 namespace testing {
18 
20 {
21  int num_ranks = comm_->size();
22  if (num_ranks != ranks)
23  throw std::runtime_error("Bad Rank Count, test expects different number of ranks.");
24 
25  app_log() << "running on " << num_ranks << '\n';
26 
27 }
28 
30 {
31  FakeEstimator fake_estimator;
32  fake_estimator.scalars.resize(4);
33  fake_estimator.scalars_saved.resize(4);
34  fake_estimator.scalars[0](1.0);
35  fake_estimator.scalars[1](2.0);
36  fake_estimator.scalars[2](3.0);
37  fake_estimator.scalars[3](4.0);
38 
39  //three estimators
40  estimators_.push_back(fake_estimator);
41  estimators_.push_back(fake_estimator);
42  estimators_.push_back(fake_estimator);
43 
44  estimators_[2].scalars[0](2.0);
45  estimators_[2].scalars[1](2.0);
46  estimators_[2].scalars[2](2.0);
47  estimators_[2].scalars[3](2.0);
48 
49  em.get_AverageCache().resize(4);
50  em.get_SquaredAverageCache().resize(4);
51 }
52 
53 }
54 }
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
Declaration of OutputManager class.
std::ostream & app_log()
Definition: OutputManager.h:65
int size() const
return the number of tasks
Definition: Communicate.h:118
std::vector< accumulator_type > scalars
scalars to be measured
Wrapping information on parallelism.
Definition: Communicate.h:68
std::vector< accumulator_type > scalars_saved
scalars saved
void fakeSomeScalarSamples()
Quickly add scalar samples using FakeEstimator mock estimator.