mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #1224 from blattms/only-created-step_timings.txt-if-output
Only create step_timing.txt file if it gets written to.
This commit is contained in:
commit
757320c57d
@ -103,7 +103,12 @@ namespace Opm
|
|||||||
Opm::time::StopWatch total_timer;
|
Opm::time::StopWatch total_timer;
|
||||||
total_timer.start();
|
total_timer.start();
|
||||||
std::string tstep_filename = output_writer_.outputDirectory() + "/step_timing.txt";
|
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();
|
const auto& schedule = eclipse_state_->getSchedule();
|
||||||
|
|
||||||
@ -307,12 +312,9 @@ namespace Opm
|
|||||||
OpmLog::note(msg);
|
OpmLog::note(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( output_writer_.output() ) {
|
if ( tstep_os.is_open() ) {
|
||||||
if ( output_writer_.isIORank() )
|
|
||||||
{
|
|
||||||
stepReport.reportParam(tstep_os);
|
stepReport.reportParam(tstep_os);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Increment timer, remember well state.
|
// Increment timer, remember well state.
|
||||||
++timer;
|
++timer;
|
||||||
|
@ -160,7 +160,12 @@ public:
|
|||||||
Opm::time::StopWatch total_timer;
|
Opm::time::StopWatch total_timer;
|
||||||
total_timer.start();
|
total_timer.start();
|
||||||
std::string tstep_filename = output_writer_.outputDirectory() + "/step_timing.txt";
|
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() && output_writer_.isIORank() )
|
||||||
|
{
|
||||||
|
tstep_os.open(tstep_filename.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
const auto& schedule = eclState().getSchedule();
|
const auto& schedule = eclState().getSchedule();
|
||||||
|
|
||||||
@ -348,12 +353,10 @@ public:
|
|||||||
// update timing.
|
// update timing.
|
||||||
report.solver_time += solver_timer.secsSinceStart();
|
report.solver_time += solver_timer.secsSinceStart();
|
||||||
|
|
||||||
if ( output_writer_.output() ) {
|
if ( output_writer_.output() && output_writer_.isIORank() )
|
||||||
if ( output_writer_.isIORank() )
|
|
||||||
{
|
{
|
||||||
stepReport.reportParam(tstep_os);
|
stepReport.reportParam(tstep_os);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Increment timer, remember well state.
|
// Increment timer, remember well state.
|
||||||
++timer;
|
++timer;
|
||||||
|
Loading…
Reference in New Issue
Block a user