Add setup and deck read timing to end-of-run report.

This commit is contained in:
Atgeirr Flø Rasmussen 2024-02-09 14:52:34 +01:00
parent d78288a401
commit 4a60c3c6c2
3 changed files with 19 additions and 3 deletions

View File

@ -112,7 +112,10 @@ void printFlowBanner(int nprocs, int nthreads, std::string_view moduleVersionNam
std::cout << "Using "<< nprocs << " MPI processes with "<< nthreads <<" OMP threads on each \n\n";
}
void printFlowTrailer(int nprocs, int nthreads,
void printFlowTrailer(int nprocs,
int nthreads,
const double total_setup_time,
const double deck_read_time,
const SimulatorReport& report,
const SimulatorReportSingle& localsolves_report)
{
@ -120,6 +123,8 @@ void printFlowTrailer(int nprocs, int nthreads,
ss << "\n\n================ End of simulation ===============\n\n";
ss << fmt::format("Number of MPI processes: {:9}\n", nprocs);
ss << fmt::format("Threads per MPI process: {:9}\n", nthreads);
ss << fmt::format("Setup time (sec): {:9.2f}\n", total_setup_time);
ss << fmt::format(" Deck input (sec): {:9.2f}\n", deck_read_time);
report.reportFullyImplicit(ss);
if (localsolves_report.total_linearizations > 0) {

View File

@ -40,7 +40,10 @@ void printPRTHeader(const int nprocs, const int nthreads,
void printFlowBanner(int nprocs, int threads, std::string_view moduleVersionName);
// Print flow application trailer.
void printFlowTrailer(int nprocs, int nthreads,
void printFlowTrailer(int nprocs,
int nthreads,
const double total_setup_time,
const double deck_read_time,
const SimulatorReport& report,
const SimulatorReportSingle& localsolves_report);

View File

@ -354,6 +354,9 @@ void handleExtraConvergenceOutput(SimulatorReport& report,
try {
// deal with some administrative boilerplate
Dune::Timer setupTimerAfterReadingDeck;
setupTimerAfterReadingDeck.start();
int status = setupParameters_(this->argc_, this->argv_, EclGenericVanguard::comm());
if (status)
return status;
@ -362,6 +365,9 @@ void handleExtraConvergenceOutput(SimulatorReport& report,
setupModelSimulator();
createSimulator();
this->deck_read_time_ = modelSimulator_->vanguard().setupTime();
this->total_setup_time_ = setupTimerAfterReadingDeck.elapsed() + this->deck_read_time_;
// if run, do the actual work, else just initialize
int exitCode = (this->*runOrInitFunc)();
if (cleanup) {
@ -514,7 +520,7 @@ void handleExtraConvergenceOutput(SimulatorReport& report,
= omp_get_max_threads();
#endif
printFlowTrailer(mpi_size_, threads, report, simulator_->model().localAccumulatedReports());
printFlowTrailer(mpi_size_, threads, total_setup_time_, deck_read_time_, report, simulator_->model().localAccumulatedReports());
detail::handleExtraConvergenceOutput(report,
EWOMS_GET_PARAM(TypeTag, std::string, OutputExtraConvergenceInfo),
@ -590,6 +596,8 @@ void handleExtraConvergenceOutput(SimulatorReport& report,
char **argv_;
bool output_cout_;
bool output_files_;
double total_setup_time_ = 0.0;
double deck_read_time_ = 0.0;
};
} // namespace Opm