Merge branch 'develop' into guard-orb-rot

This commit is contained in:
Ye Luo 2022-08-23 14:50:51 -05:00 committed by GitHub
commit f9966af47c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 53 additions and 11 deletions

View File

@ -24,6 +24,8 @@
namespace qmcplusplus namespace qmcplusplus
{ {
// PUBLIC
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// ProjectData // ProjectData
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
@ -35,7 +37,12 @@ ProjectData::ProjectData(const std::string& atitle, ProjectData::DriverVersion d
series_(0), series_(0),
cur_(NULL), cur_(NULL),
max_cpu_secs_(360000), max_cpu_secs_(360000),
driver_version_(driver_version) driver_version_(driver_version),
#ifdef QMC_COMPLEX
is_complex_(true)
#else
is_complex_(false)
#endif
{ {
my_comm_ = OHMMS::Controller; my_comm_ = OHMMS::Controller;
if (title_.empty()) if (title_.empty())
@ -234,6 +241,21 @@ bool ProjectData::put(xmlNodePtr cur)
return true; return true;
} }
const std::string& ProjectData::getTitle() const noexcept { return title_; }
const std::string& ProjectData::currentMainRoot() const noexcept { return project_main_; }
const std::string& ProjectData::nextRoot() const noexcept { return next_root_; }
int ProjectData::getSeriesIndex() const noexcept { return series_; }
int ProjectData::getMaxCPUSeconds() const noexcept { return max_cpu_secs_; }
ProjectData::DriverVersion ProjectData::getDriverVersion() const noexcept { return driver_version_; }
bool ProjectData::isComplex() const noexcept { return is_complex_; }
// PRIVATE
ProjectData::DriverVersion ProjectData::lookupDriverVersion(const std::string& enum_value) ProjectData::DriverVersion ProjectData::lookupDriverVersion(const std::string& enum_value)
{ {
std::string enum_value_str(lowerCase(enum_value)); std::string enum_value_str(lowerCase(enum_value));

View File

@ -72,32 +72,40 @@ public:
void setCommunicator(Communicate* c); void setCommunicator(Communicate* c);
/** returns the title of the project /**
* @brief returns the title of the project
* <project id="det_qmc_short_sdbatch_vmcbatch_mwalkers" series="0"> * <project id="det_qmc_short_sdbatch_vmcbatch_mwalkers" series="0">
* translate to title_ = "det_qmc_short_sdbatch_vmcbatch_mwalkers" * translate to title_ = "det_qmc_short_sdbatch_vmcbatch_mwalkers"
*/ */
inline const std::string& getTitle() const { return title_; } const std::string& getTitle() const noexcept;
/** returns the projectmain of the project, the series id is incremented at every QMC section /**
* @brief returns the projectmain of the project, the series id is incremented at every QMC section
* <project id="det_qmc_short_sdbatch_vmcbatch_mwalkers" series="0"> * <project id="det_qmc_short_sdbatch_vmcbatch_mwalkers" series="0">
* translate to project_main_ = "det_qmc_short_sdbatch_vmcbatch_mwalkers.s000" * translate to project_main_ = "det_qmc_short_sdbatch_vmcbatch_mwalkers.s000"
*/ */
inline const std::string& currentMainRoot() const { return project_main_; } const std::string& currentMainRoot() const noexcept;
/** returns the nextroot of the project, the series id is incremented at every QMC section /**
* @brief returns the nextroot of the project, the series id is incremented at every QMC section
* <project id="det_qmc_short_sdbatch_vmcbatch_mwalkers" series="0"> * <project id="det_qmc_short_sdbatch_vmcbatch_mwalkers" series="0">
* translate to project_main_ = "det_qmc_short_sdbatch_vmcbatch_mwalkers.s001" * translate to project_main_ = "det_qmc_short_sdbatch_vmcbatch_mwalkers.s001"
*/ */
inline const std::string& nextRoot() const { return next_root_; } const std::string& nextRoot() const noexcept;
/** return the root of the previous sequence /**
* @brief return the root of the previous sequence
* @param oldroot is composed by the title_ and series_ * @param oldroot is composed by the title_ and series_
*/ */
bool previousRoot(std::string& oldroot) const; bool previousRoot(std::string& oldroot) const;
int getSeriesIndex() const { return series_; } int getSeriesIndex() const noexcept;
int getMaxCPUSeconds() const { return max_cpu_secs_; }
DriverVersion getDriverVersion() const { return driver_version_; } int getMaxCPUSeconds() const noexcept;
DriverVersion getDriverVersion() const noexcept;
bool isComplex() const noexcept;
private: private:
static DriverVersion lookupDriverVersion(const std::string& enum_value); static DriverVersion lookupDriverVersion(const std::string& enum_value);
@ -134,6 +142,9 @@ private:
// The driver version of the project // The driver version of the project
DriverVersion driver_version_; DriverVersion driver_version_;
// tracks if complex wavefunction is used, true: complex, false: real
bool is_complex_;
}; };
} // namespace qmcplusplus } // namespace qmcplusplus

View File

@ -136,5 +136,14 @@ TEST_CASE("ProjectData::TestDriverVersion", "[ohmmsapp]")
// host and date nodes get added for output to the .cont.xml file // host and date nodes get added for output to the .cont.xml file
} }
TEST_CASE("ProjectData::TestIsComplex", "[ohmmsapp]")
{
ProjectData proj;
#ifdef QMC_COMPLEX
REQUIRE(proj.isComplex());
#else
REQUIRE(!proj.isComplex());
#endif
}
} // namespace qmcplusplus } // namespace qmcplusplus