mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-14 22:33:26 -06:00
Merge pull request #1567 from blattms/tighten-regex-for-parallel-output
Let ParallelFileMerger only warn about CASENAME.[0-9]*.EXT files.
This commit is contained in:
commit
c3de357f30
@ -50,7 +50,8 @@ public:
|
||||
ParallelFileMerger(const fs::path& output_dir,
|
||||
const std::string& deckname)
|
||||
: debugFileRegex_(deckname+"\\.\\d+\\.DBG"),
|
||||
logFileRegex_(deckname+"\\.\\d+\\.PRT")
|
||||
logFileRegex_(deckname+"\\.\\d+\\.PRT"),
|
||||
fileWarningRegex_(deckname+"\\.(\\d+)\\.[^.]+")
|
||||
{
|
||||
auto debugPath = output_dir;
|
||||
debugPath /= (deckname + ".DBG");
|
||||
@ -64,13 +65,12 @@ public:
|
||||
|
||||
void operator()(const fs::path& file)
|
||||
{
|
||||
const static boost::regex regex(".+\\.(\\d+)\\..+");
|
||||
boost::smatch matches;
|
||||
std::string filename = file.filename().native();
|
||||
|
||||
if ( boost::regex_match(filename, matches, regex) )
|
||||
if ( boost::regex_match(filename, matches, fileWarningRegex_) )
|
||||
{
|
||||
std::string rank = boost::regex_replace(filename, regex, "\\1");
|
||||
std::string rank = boost::regex_replace(filename, fileWarningRegex_, "\\1");
|
||||
|
||||
if( boost::regex_match(filename, logFileRegex_) )
|
||||
{
|
||||
@ -123,6 +123,8 @@ private:
|
||||
boost::regex debugFileRegex_;
|
||||
/// \brief Regex to capture *.PRT
|
||||
boost::regex logFileRegex_;
|
||||
/// \brief Regex to capture CASENAME.[0-9]+.[A-Z]+
|
||||
boost::regex fileWarningRegex_;
|
||||
/// \brief Stream to *.DBG file
|
||||
std::unique_ptr<fs::ofstream> debugStream_;
|
||||
/// \brief Stream to *.PRT file
|
||||
|
Loading…
Reference in New Issue
Block a user