Skip to content
Snippets Groups Projects
Commit 6b5f1566 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Add a command line option to set parallel checker database filename

parent b36a435a
No related branches found
No related tags found
1 merge request!176Add HDF5 support
...@@ -43,7 +43,7 @@ class ParallelChecker ...@@ -43,7 +43,7 @@ class ParallelChecker
Mode m_mode = Mode::automatic; Mode m_mode = Mode::automatic;
size_t m_tag = 0; size_t m_tag = 0;
std::string m_filename = "testme/parallel_checker.h5"; std::string m_filename = "parallel_checker.h5";
ParallelChecker() = default; ParallelChecker() = default;
...@@ -680,12 +680,36 @@ class ParallelChecker ...@@ -680,12 +680,36 @@ class ParallelChecker
return *m_instance; return *m_instance;
} }
Mode
mode() const
{
return m_mode;
}
void void
setMode(const Mode& mode) setMode(const Mode& mode)
{ {
if (m_tag != 0) {
throw UnexpectedError("Cannot modify parallel checker mode if it was already used");
}
m_mode = mode; m_mode = mode;
} }
const std::string&
filename() const
{
return m_filename;
}
void
setFilename(const std::string& filename)
{
if (m_tag != 0) {
throw UnexpectedError("Cannot modify parallel checker file if it was already used");
}
m_filename = filename;
}
bool bool
isWriting() const isWriting() const
{ {
......
...@@ -89,6 +89,7 @@ initialize(int& argc, char* argv[]) ...@@ -89,6 +89,7 @@ initialize(int& argc, char* argv[])
int nb_threads = -1; int nb_threads = -1;
ParallelChecker::Mode pc_mode = ParallelChecker::Mode::automatic; ParallelChecker::Mode pc_mode = ParallelChecker::Mode::automatic;
std::string pc_filename = ParallelChecker::instance().filename();
std::string filename; std::string filename;
{ {
...@@ -134,6 +135,9 @@ initialize(int& argc, char* argv[]) ...@@ -134,6 +135,9 @@ initialize(int& argc, char* argv[])
"Parallel checker mode (auto: sequential write/parallel read) [default: auto]") "Parallel checker mode (auto: sequential write/parallel read) [default: auto]")
->transform(CLI::CheckedTransformer(pc_mode_map)); ->transform(CLI::CheckedTransformer(pc_mode_map));
app.add_option("--parallel-checker-file", pc_filename,
"Parallel checker filename [default: " + pc_filename + "]");
int mpi_split_color = -1; int mpi_split_color = -1;
app.add_option("--mpi-split-color", mpi_split_color, "Sets the MPI split color value (for MPMD applications)") app.add_option("--mpi-split-color", mpi_split_color, "Sets the MPI split color value (for MPMD applications)")
->check(CLI::Range(0, std::numeric_limits<decltype(mpi_split_color)>::max())); ->check(CLI::Range(0, std::numeric_limits<decltype(mpi_split_color)>::max()));
...@@ -178,6 +182,7 @@ initialize(int& argc, char* argv[]) ...@@ -178,6 +182,7 @@ initialize(int& argc, char* argv[])
} }
ParallelChecker::instance().setMode(pc_mode); ParallelChecker::instance().setMode(pc_mode);
ParallelChecker::instance().setFilename(pc_filename);
if (ConsoleManager::showPreamble()) { if (ConsoleManager::showPreamble()) {
std::cout << "----------------- " << rang::fg::green << "pugs exec info" << rang::fg::reset std::cout << "----------------- " << rang::fg::green << "pugs exec info" << rang::fg::reset
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment