31 using namespace testing;
55 std::string root_name{
"Test"};
57 std::string prev_config_file{
""};
59 qmcdriver.
setStatus(root_name, prev_config_file,
false);
72 TEST_CASE(
"QMCDriverNew more crowds than threads",
"[drivers]")
74 using namespace testing;
76 Concurrency::OverrideMaxCapacity<>
override(8);
85 QMCDriverInput qmcdriver_input;
86 qmcdriver_input.readXML(
node);
97 if (Concurrency::maxCapacity<>() != 8)
98 throw std::runtime_error(
"Insufficient threads available to match test input");
100 QMCDriverInput qmcdriver_copy(qmcdriver_input);
101 WalkerConfigurations walker_confs;
102 QMCDriverNewTestWrapper qmc_batched(
test_project, std::move(qmcdriver_copy), walker_confs,
106 QMCDriverNewTestWrapper::TestNumCrowdsVsNumThreads<ParallelExecutor<>> testNumCrowds;
111 TEST_CASE(
"QMCDriverNew walker counts",
"[drivers]")
113 using namespace testing;
114 Concurrency::OverrideMaxCapacity<>
override(8);
123 QMCDriverInput qmcdriver_input;
124 qmcdriver_input.readXML(
node);
133 if (Concurrency::maxCapacity<>() < 8)
134 num_crowds = Concurrency::maxCapacity<>();
137 throw std::runtime_error(
"Insufficient threads available to match test input");
139 QMCDriverInput qmcdriver_copy(qmcdriver_input);
140 WalkerConfigurations walker_confs;
141 QMCDriverNewTestWrapper qmc_batched(
test_project, std::move(qmcdriver_copy), walker_confs,
146 qmc_batched.testAdjustGlobalWalkerCount();
150 TEST_CASE(
"QMCDriverNew test driver operations",
"[drivers]")
152 using namespace testing;
179 auto spin_mass = 0.5;
187 mc_coords.positions = {p1, p2, p3};
189 auto deltas = mc_coords;
192 CHECK(Approx(mc_coords.positions[0][0]) == 0.14472135955);
193 CHECK(Approx(mc_coords.positions[0][1]) == 0.28944271910);
194 CHECK(Approx(mc_coords.positions[0][2]) == 0.43416407865);
195 CHECK(Approx(mc_coords.positions[1][0]) == 0.57888543820);
196 CHECK(Approx(mc_coords.positions[1][1]) == 0.72360679775);
197 CHECK(Approx(mc_coords.positions[1][2]) == 0.86832815730);
198 CHECK(Approx(mc_coords.positions[2][0]) == 1.01304951685);
199 CHECK(Approx(mc_coords.positions[2][1]) == 1.15777087640);
200 CHECK(Approx(mc_coords.positions[2][2]) == 1.30249223595);
202 std::vector<QMCTraits::RealType> loggf(3), loggb(3);
205 CHECK(Approx(loggf[0]) == -0.07);
206 CHECK(Approx(loggf[1]) == -0.385);
207 CHECK(Approx(loggf[2]) == -0.97);
210 CHECK(Approx(loggb[0]) == -0.733049516850);
211 CHECK(Approx(loggb[1]) == -4.031772342675);
212 CHECK(Approx(loggb[2]) == -10.15797187635);
222 mc_coords.positions = {p1, p2, p3};
223 mc_coords.spins = {0.1, 0.2, 0.3};
225 auto deltas = mc_coords;
228 CHECK(Approx(mc_coords.positions[0][0]) == -0.14472135955);
229 CHECK(Approx(mc_coords.positions[0][1]) == -0.28944271910);
230 CHECK(Approx(mc_coords.positions[0][2]) == -0.43416407865);
231 CHECK(Approx(mc_coords.positions[1][0]) == -0.57888543820);
232 CHECK(Approx(mc_coords.positions[1][1]) == -0.72360679775);
233 CHECK(Approx(mc_coords.positions[1][2]) == -0.86832815730);
234 CHECK(Approx(mc_coords.positions[2][0]) == -1.01304951685);
235 CHECK(Approx(mc_coords.positions[2][1]) == -1.15777087640);
236 CHECK(Approx(mc_coords.positions[2][2]) == -1.30249223595);
238 CHECK(Approx(mc_coords.spins[0]) == 0.163245553203);
239 CHECK(Approx(mc_coords.spins[1]) == 0.326491106407);
240 CHECK(Approx(mc_coords.spins[2]) == 0.489736659610);
242 std::vector<QMCTraits::RealType> loggf(3), loggb(3);
245 CHECK(Approx(loggf[0]) == -0.075);
246 CHECK(Approx(loggf[1]) == -0.405);
247 CHECK(Approx(loggf[2]) == -1.015);
250 CHECK(Approx(loggb[0]) == -0.766360905151);
251 CHECK(Approx(loggb[1]) == -4.165017895878);
252 CHECK(Approx(loggb[2]) == -10.457774371057);
class that handles xmlDoc
void pause()
Pause the summary and log streams.
Abstraction of information on executor environments.
helper functions for EinsplineSetBuilder
int rank() const
return the rank
if(!okay) throw std xmlNodePtr node
constexpr int valid_vmc_input_vmc_tiny_index
Declaration of QMCDriverNew.
static ParticleSetPool make_diamondC_1x1x1(Communicate *c)
A set of light weight walkers that are carried between driver sections and restart.
TEST_CASE("complex_helper", "[type_traits]")
static WaveFunctionPool make_diamondC_1x1x1(const RuntimeOptions &runtime_options, Communicate *comm, ParticleSetPool &particle_pool)
static void scaleBySqrtTau(const TauParams< RT, CT > &taus, MCCoords< CT > &coords)
void testMeasureImbalance()
ProjectData test_project("test", ProjectData::DriverVersion::BATCH)
Object to encapsulate appropriate tau derived parameters for a particular CoordsType specialization...
Communicate * Controller
Global Communicator for a process.
int size() const
return the number of tasks
const RuntimeOptions & getRuntimeOptions() const noexcept
OutputManagerClass outputManager(Verbosity::HIGH)
Wrapping information on parallelism.
void resume()
Resume the summary and log streams.
REQUIRE(std::filesystem::exists(filename))
Compilation units that construct QMCDriverInput need visibility to the actual input classes types in ...
constexpr std::array< const char *, 4 > valid_vmc_input_sections
A service class to override active avaiable threads upon construction.
static void computeLogGreensFunction(const MCCoords< CT > &coords, const TauParams< RT, CT > &taus, std::vector< QMCTraits::RealType > &log_gb)
calculates Green Function from displacements stored in MCCoords [param, out] log_g ...
void process(xmlNodePtr node) override
QMCDriverNew driver second (3rd, 4th...) stage of constructing a valid driver.
void setStatus(const std::string &aname, const std::string &h5name, bool append) override
Set the status of the QMCDriver.
IndexType get_num_living_walkers() const
static HamiltonianPool make_hamWithEE(Communicate *comm, ParticleSetPool &particle_pool, WaveFunctionPool &wavefunction_pool)
virtual std::unique_ptr< BranchEngineType > getBranchEngine()
constexpr int valid_dmc_input_dmc_batch_index
void readXML(xmlNodePtr cur)
Reads qmc section xml node parameters.
bool parseFromString(const std::string_view data)
CHECK(log_values[0]==ComplexApprox(std::complex< double >{ 5.603777579195571, -6.1586603331188225 }))
constexpr std::array< const char *, 3 > valid_dmc_input_sections
void testDetermineStepsPerBlock()
utility functions for executors
avoids many repeated xml heredoc sections
Input representation for Driver base class runtime parameters.