mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Only create step_timing.txt file if it gets written to.
If output=false is requested we created an empty file. Now that file will only be created if output was requested and it will only be opened on one rank in a parallel run.
This commit is contained in:
parent
56cef57c8d
commit
e0a7ced256
@ -103,7 +103,12 @@ namespace Opm
|
||||
Opm::time::StopWatch total_timer;
|
||||
total_timer.start();
|
||||
std::string tstep_filename = output_writer_.outputDirectory() + "/step_timing.txt";
|
||||
std::ofstream tstep_os(tstep_filename.c_str());
|
||||
std::ofstream tstep_os;
|
||||
|
||||
if ( output_writer_.output() ) {
|
||||
if ( output_writer_.isIORank() )
|
||||
tstep_os.open(tstep_filename.c_str());
|
||||
}
|
||||
|
||||
const auto& schedule = eclipse_state_->getSchedule();
|
||||
|
||||
@ -307,12 +312,9 @@ namespace Opm
|
||||
OpmLog::note(msg);
|
||||
}
|
||||
|
||||
if ( output_writer_.output() ) {
|
||||
if ( output_writer_.isIORank() )
|
||||
{
|
||||
if ( tstep_os.is_open() ) {
|
||||
stepReport.reportParam(tstep_os);
|
||||
}
|
||||
}
|
||||
|
||||
// Increment timer, remember well state.
|
||||
++timer;
|
||||
|
@ -163,7 +163,14 @@ public:
|
||||
Opm::time::StopWatch total_timer;
|
||||
total_timer.start();
|
||||
std::string tstep_filename = output_writer_.outputDirectory() + "/step_timing.txt";
|
||||
std::ofstream tstep_os(tstep_filename.c_str());
|
||||
std::ofstream tstep_os;
|
||||
|
||||
if ( output_writer_.output() ) {
|
||||
if ( output_writer_.isIORank() )
|
||||
{
|
||||
tstep_os.open(tstep_filename.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
const auto& schedule = eclState().getSchedule();
|
||||
|
||||
@ -351,12 +358,9 @@ public:
|
||||
// update timing.
|
||||
report.solver_time += solver_timer.secsSinceStart();
|
||||
|
||||
if ( output_writer_.output() ) {
|
||||
if ( output_writer_.isIORank() )
|
||||
{
|
||||
if ( tstep_os.is_open() ) {
|
||||
stepReport.reportParam(tstep_os);
|
||||
}
|
||||
}
|
||||
|
||||
// Increment timer, remember well state.
|
||||
++timer;
|
||||
|
Loading…
Reference in New Issue
Block a user