Skip to content

Commit

Permalink
Change default filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
siuwuncheung committed Mar 5, 2024
1 parent 74eaa76 commit ec3370e
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 33 deletions.
7 changes: 0 additions & 7 deletions src/Control.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -1911,12 +1910,6 @@ void Control::setOptions(const boost::program_options::variables_map& vm)

maxDistanceAtomicInfo_ = vm["Parallel.atomic_info_radius"].as<float>();

// ROM flags
//rom_offline = vm["ROM.offline"].as<bool>() ? 1 : 0;
//rom_online = vm["ROM.online"].as<bool>() ? 1 : 0;
//rom_restore = vm["ROM.restore"].as<bool>() ? 1 : 0;
//snapshot_basename = vm["atomicCoordinates"].as<std::vector<std::string>>()[0];

// options not available in configure file
lr_updates_type = 0;
precond_factor_computed = false;
Expand Down
1 change: 0 additions & 1 deletion src/Control.h
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,6 @@ class Control
bool rom_offline;
bool rom_online;
bool rom_restore;
std::string snapshot_basename;
};

#endif
18 changes: 9 additions & 9 deletions src/MGmol.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1143,17 +1143,17 @@ void MGmol<OrbitalsType>::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_);
Expand Down
16 changes: 2 additions & 14 deletions src/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>()->default_value(""),
"Output file for dumping cluster information in vtk format")(
"ROM.offline",
po::value<bool>()->default_value(false),
"online phase in ROM")(
"ROM.online",
po::value<bool>()->default_value(false),
"online phase in ROM")(
"ROM.restore",
po::value<bool>()->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.
Expand Down Expand Up @@ -443,10 +434,7 @@ int main(int argc, char** argv)
"approximation of density matrix. ")("DensityMatrix.tol",
po::value<float>()->default_value(1.e-7),
"tolerance, used in iterative DM computation convergence "
"criteria")(
"ROM.snapshot_basename",
po::value<string>()->default_value(""),
"ROM snapshot basename");
"criteria");

po::options_description cmdline_options;
cmdline_options.add(generic);
Expand Down
2 changes: 1 addition & 1 deletion src/md.cc
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ void MGmol<OrbitalsType>::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;
Expand Down
1 change: 0 additions & 1 deletion src/rom.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
template <class OrbitalsType>
int MGmol<OrbitalsType>::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)
Expand Down

0 comments on commit ec3370e

Please sign in to comment.