Loading...
Searching...
No Matches
ParallelFileMerger.hpp
/*
Copyright 2016 Dr. Blatt - HPC-Simulation-Software & Services
Copyright 2016 STATOIL AS.
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_PARALLELFILEMERGER_HEADER_INCLUDED
#define OPM_PARALLELFILEMERGER_HEADER_INCLUDED
#include <filesystem>
#include <iosfwd>
#include <memory>
#include <regex>
#include <string>
namespace Opm {
namespace detail {
namespace fs = ::std::filesystem;
class ParallelFileMerger
{
public:
ParallelFileMerger(const fs::path& output_dir,
const std::string& deckname,
bool show_fallout = false);
void operator()(const fs::path& file);
private:
void appendFile(std::ofstream& of, const fs::path& file, const std::string& rank);
std::regex debugFileRegex_;
std::regex logFileRegex_;
std::regex fileWarningRegex_;
std::unique_ptr<std::ofstream> debugStream_;
std::unique_ptr<std::ofstream> logStream_;
bool show_fallout_;
};
} // end namespace detail
} // end namespace Opm
#endif // end header guard
Opm::detail::ParallelFileMerger::ParallelFileMerger
ParallelFileMerger(const fs::path &output_dir, const std::string &deckname, bool show_fallout=false)
Constructor.
Definition ParallelFileMerger.cpp:32
Opm
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilbioeffectsmodules.hh:43