Remove restart_timers and have openmc_init/run start/stop total timer

This commit is contained in:
Paul Romano 2020-04-07 13:49:10 -05:00
parent 6d55a720f7
commit dd283875a8
7 changed files with 8 additions and 22 deletions

View file

@ -87,7 +87,6 @@ extern "C" {
int openmc_property_map(const void* slice, double* data_out);
int openmc_reset();
int openmc_reset_timers();
int openmc_restart_timers();
int openmc_run();
void openmc_set_seed(int64_t new_seed);
int openmc_simulation_finalize();

View file

@ -69,8 +69,6 @@ private:
void reset_timers();
void restart_timers();
} // namespace openmc
#endif // OPENMC_TIMER_H

View file

@ -65,8 +65,6 @@ _dll.openmc_reset.restype = c_int
_dll.openmc_reset.errcheck = _error_handler
_dll.openmc_reset_timers.restype = c_int
_dll.openmc_reset_timers.errcheck = _error_handler
_dll.openmc_restart_timers.restype = c_int
_dll.openmc_restart_timers.errcheck = _error_handler
_run_linsolver_argtypes = [_array_1d_dble, _array_1d_dble, _array_1d_dble,
c_double]
_dll.openmc_run_linsolver.argtypes = _run_linsolver_argtypes
@ -312,9 +310,8 @@ def reset():
def reset_timers():
"""Reset timers and restart for next batch."""
"""Reset timers."""
_dll.openmc_reset_timers()
_dll.openmc_restart_timers()
def run():

View file

@ -171,12 +171,6 @@ int openmc_reset_timers()
return 0;
}
int openmc_restart_timers()
{
restart_timers();
return 0;
}
int openmc_hard_reset()
{
// Reset all tallies and timers

View file

@ -78,6 +78,7 @@ int openmc_init(int argc, char* argv[], const void* intracomm)
// Stop initialization timer
simulation::time_initialize.stop();
simulation::time_total.stop();
return 0;
}

View file

@ -47,6 +47,7 @@
int openmc_run()
{
openmc::simulation::time_total.start();
openmc_simulation_init();
int err = 0;
@ -56,6 +57,7 @@ int openmc_run()
}
openmc_simulation_finalize();
openmc::simulation::time_total.stop();
return err;
}
@ -422,8 +424,8 @@ void finalize_generation()
}
global_tally_leakage = 0.0;
if (settings::run_mode == RunMode::EIGENVALUE) {
// If using shared memory, stable sort the fission bank (by parent IDs)
if (settings::run_mode == RunMode::EIGENVALUE) {
// If using shared memory, stable sort the fission bank (by parent IDs)
// so as to allow for reproducibility regardless of which order particles
// are run in.
sort_fission_bank();
@ -525,7 +527,7 @@ void initialize_history_partial(Particle* p)
p->flux_derivs_.resize(model::tally_derivs.size(), 0.0);
std::fill(p->flux_derivs_.begin(), p->flux_derivs_.end(), 0.0);
}
// Allocate space for tally filter matches
p->filter_matches_.resize(model::tally_filters.size());
}
@ -669,7 +671,7 @@ void transport_event_based()
process_collision_events();
}
}
// Execute death event for all particles
process_death_events(n_particles);

View file

@ -87,9 +87,4 @@ void reset_timers()
simulation::time_event_death.reset();
}
void restart_timers()
{
simulation::time_total.start();
}
} // namespace openmc