From ec3370e557c4f0d6f233b101626c91556079834f Mon Sep 17 00:00:00 2001 From: Siu Wun Cheung Date: Tue, 5 Mar 2024 13:33:45 -0800 Subject: [PATCH] Change default filenames --- src/Control.cc | 7 ------- src/Control.h | 1 - src/MGmol.cc | 18 +++++++++--------- src/main.cc | 16 ++-------------- src/md.cc | 2 +- src/rom.cc | 1 - 6 files changed, 12 insertions(+), 33 deletions(-) diff --git a/src/Control.cc b/src/Control.cc index af8be55f..0e0b2365 100644 --- a/src/Control.cc +++ b/src/Control.cc @@ -149,7 +149,6 @@ Control::Control() rom_offline = true; // TODO rom_online = false; rom_restore = false; - snapshot_basename = "coords.in_H2O_64_000000"; // TODO } void Control::setup(const MPI_Comm comm_global, const bool with_spin, @@ -1911,12 +1910,6 @@ void Control::setOptions(const boost::program_options::variables_map& vm) maxDistanceAtomicInfo_ = vm["Parallel.atomic_info_radius"].as(); - // ROM flags - //rom_offline = vm["ROM.offline"].as() ? 1 : 0; - //rom_online = vm["ROM.online"].as() ? 1 : 0; - //rom_restore = vm["ROM.restore"].as() ? 1 : 0; - //snapshot_basename = vm["atomicCoordinates"].as>()[0]; - // options not available in configure file lr_updates_type = 0; precond_factor_computed = false; diff --git a/src/Control.h b/src/Control.h index ac375802..de6fcaf5 100644 --- a/src/Control.h +++ b/src/Control.h @@ -712,7 +712,6 @@ class Control bool rom_offline; bool rom_online; bool rom_restore; - std::string snapshot_basename; }; #endif diff --git a/src/MGmol.cc b/src/MGmol.cc index 99b6d3d3..619867c2 100644 --- a/src/MGmol.cc +++ b/src/MGmol.cc @@ -1143,17 +1143,17 @@ void MGmol::cleanup() if (ierr < 0) os_ << "WARNING: writing restart data failed!!!" << std::endl; - } - // Save orbital snapshots - if (ct.rom_offline > 0 && ct.AtomsDynamic() == AtomsDynamicType::Quench) - { - ct.snapshot_basename = "coords.in_H2O_64_000000"; - int ierr = save_orbital_snapshot( - ct.snapshot_basename + "_quench", *current_orbitals_); + // Save orbital snapshots + if (ct.rom_offline > 0 && ct.AtomsDynamic() == AtomsDynamicType::Quench) + { + ierr = save_orbital_snapshot( + filename, *current_orbitals_); + + if (ierr < 0) + os_ << "WARNING: writing ROM snapshot data failed!!!" << std::endl; + } - if (ierr < 0) - os_ << "WARNING: writing ROM snapshot data failed!!!" << std::endl; } MPI_Barrier(comm_); diff --git a/src/main.cc b/src/main.cc index 29070256..6f933ffe 100644 --- a/src/main.cc +++ b/src/main.cc @@ -305,16 +305,7 @@ int main(int argc, char** argv) "Modulos or parameter to control how often clusters are " "recomputed during md")("LoadBalancing.output_file", po::value()->default_value(""), - "Output file for dumping cluster information in vtk format")( - "ROM.offline", - po::value()->default_value(false), - "online phase in ROM")( - "ROM.online", - po::value()->default_value(false), - "online phase in ROM")( - "ROM.restore", - po::value()->default_value(false), - "restore phase in ROM"); + "Output file for dumping cluster information in vtk format"); // Hidden options, will be allowed in config file, but will not be // shown to the user. @@ -443,10 +434,7 @@ int main(int argc, char** argv) "approximation of density matrix. ")("DensityMatrix.tol", po::value()->default_value(1.e-7), "tolerance, used in iterative DM computation convergence " - "criteria")( - "ROM.snapshot_basename", - po::value()->default_value(""), - "ROM snapshot basename"); + "criteria"); po::options_description cmdline_options; cmdline_options.add(generic); diff --git a/src/md.cc b/src/md.cc index 1d0947ba..14144cc3 100644 --- a/src/md.cc +++ b/src/md.cc @@ -491,7 +491,7 @@ void MGmol::md(OrbitalsType** orbitals, Ions& ions) if (ct.rom_offline > 0) { int ierr = save_orbital_snapshot( - ct.snapshot_basename + "_MD" + std::to_string(mdstep), **orbitals); + ct.md_print_filename + "_mdstep" + std::to_string(mdstep), **orbitals); if (ierr < 0) os_ << "WARNING md(): writing ROM snapshot data failed!!!" << std::endl; diff --git a/src/rom.cc b/src/rom.cc index 4f4d4055..fb45ffbf 100644 --- a/src/rom.cc +++ b/src/rom.cc @@ -22,7 +22,6 @@ template int MGmol::save_orbital_snapshot(std::string file_path, OrbitalsType& orbitals) { - std::cout << "rom.cc: save_orbital_snapshot: " << file_path << std::endl; std::string snapshot_filename = file_path; struct stat s; if (stat(file_path.c_str(), &s) == 0)