Merge pull request #3792 from blattms/no-multiple-dbg-prt-files

Prevent multiple *.?.dbg/prt files in production parallel runs.
This commit is contained in:
Bård Skaflestad
2022-01-30 23:10:14 +01:00
committed by GitHub
4 changed files with 13 additions and 4 deletions

View File

@@ -440,11 +440,14 @@ private:
const bool init_from_restart_file = !EWOMS_GET_PARAM(PreTypeTag, bool, SchedRestart);
if (outputDir.empty())
outputDir = EWOMS_GET_PARAM(PreTypeTag, std::string, OutputDir);
const bool allRanksDbgPrtLog = EWOMS_GET_PARAM(PreTypeTag, bool,
EnableLoggingFalloutWarning);
outputMode = setupLogging(mpiRank,
deckFilename,
outputDir,
EWOMS_GET_PARAM(PreTypeTag, std::string, OutputMode),
outputCout_, "STDOUT_LOGGER");
outputCout_, "STDOUT_LOGGER", allRanksDbgPrtLog);
auto parseContext =
std::make_unique<ParseContext>(std::vector<std::pair<std::string , InputError::Action>>
{{ParseContext::PARSE_RANDOM_SLASH, InputError::IGNORE},

View File

@@ -54,7 +54,7 @@ void ParallelFileMerger::operator()(const fs::path& file)
if ( std::regex_match(filename, matches, fileWarningRegex_) )
{
std::string rank = std::regex_replace(filename, fileWarningRegex_, "\\1");
std::string rank = std::regex_replace(filename, fileWarningRegex_, "$1");
if( std::regex_match(filename, logFileRegex_) )
{

View File

@@ -343,7 +343,8 @@ Opm::setupLogging(const int mpi_rank_,
const std::string& cmdline_output_dir,
const std::string& cmdline_output,
const bool output_cout_,
const std::string& stdout_log_id)
const std::string& stdout_log_id,
const bool allRanksDbgLog)
{
if (!cmdline_output_dir.empty()) {
ensureOutputDirExists_(cmdline_output_dir);
@@ -402,6 +403,10 @@ Opm::setupLogging(const int mpi_rank_,
std::cerr << "Value " << cmdline_output
<< " is not a recognized output mode. Using \"all\" instead.\n";
}
if (!allRanksDbgLog && mpi_rank_ != 0)
{
output = FileOutputMode::OUTPUT_NONE;
}
}
if (output > FileOutputMode::OUTPUT_NONE) {

View File

@@ -64,7 +64,8 @@ setupLogging(int mpi_rank_,
const std::string& cmdline_output_dir,
const std::string& cmdline_output,
bool output_cout_,
const std::string& stdout_log_id);
const std::string& stdout_log_id,
const bool allRanksDbgLog);
/// \brief Reads the deck and creates all necessary objects if needed
///