mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
add timer restart for C API
This commit is contained in:
parent
944afb1d20
commit
e645acdfa1
5 changed files with 34 additions and 0 deletions
|
|
@ -87,6 +87,7 @@ 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();
|
||||
|
|
|
|||
|
|
@ -69,6 +69,8 @@ private:
|
|||
|
||||
void reset_timers();
|
||||
|
||||
void restart_timers();
|
||||
|
||||
} // namespace openmc
|
||||
|
||||
#endif // OPENMC_TIMER_H
|
||||
|
|
|
|||
|
|
@ -65,6 +65,8 @@ _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
|
||||
|
|
@ -308,6 +310,7 @@ def reset():
|
|||
"""Reset tallies and timers."""
|
||||
_dll.openmc_reset()
|
||||
_dll.openmc_reset_timers()
|
||||
_dll.openmc_restart_timers()
|
||||
|
||||
|
||||
def run():
|
||||
|
|
|
|||
|
|
@ -171,6 +171,12 @@ int openmc_reset_timers()
|
|||
return 0;
|
||||
}
|
||||
|
||||
int openmc_restart_timers()
|
||||
{
|
||||
restart_timers();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int openmc_hard_reset()
|
||||
{
|
||||
// Reset all tallies and timers
|
||||
|
|
|
|||
|
|
@ -87,4 +87,26 @@ void reset_timers()
|
|||
simulation::time_event_death.reset();
|
||||
}
|
||||
|
||||
void restart_timers()
|
||||
{
|
||||
simulation::time_active.restart();
|
||||
simulation::time_bank.restart();
|
||||
simulation::time_bank_sample.restart();
|
||||
simulation::time_bank_sendrecv.restart();
|
||||
simulation::time_finalize.restart();
|
||||
simulation::time_inactive.restart();
|
||||
simulation::time_initialize.restart();
|
||||
simulation::time_read_xs.restart();
|
||||
simulation::time_sample_source.restart();
|
||||
simulation::time_tallies.restart();
|
||||
simulation::time_total.restart();
|
||||
simulation::time_transport.restart();
|
||||
simulation::time_event_init.restart();
|
||||
simulation::time_event_calculate_xs.restart();
|
||||
simulation::time_event_advance_particle.restart();
|
||||
simulation::time_event_surface_crossing.restart();
|
||||
simulation::time_event_collision.restart();
|
||||
simulation::time_event_death.restart();
|
||||
}
|
||||
|
||||
} // namespace openmc
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue