cpu_time#

SimulationProfile.cpu_time(num_passes: int = None, max_time: float = None) timedelta#

Total CPU time for adaptive refinement or transient simulations.

The total CPU time is the sum of execution time for all solution process steps and cores. By default, all adaptive passes (for adaptive refinement) or all time steps (for transient simulation) are included in the return value. “CPU time” represents the time required for a process if it were run on a single core. The benefit of multicore processing can be estimated by the ratio between the real_time and the cpu_time.

Parameters:
num_passesint, optional

Only valid when adaptive refinement is used. Number of passes to include in the time calculation. If nothing is passed, then all passes will be used.

max_timefloat, optional

Maximum time step value in seconds to be considered for the calculation of the compute time. For example, if the total simulated transient time is 100 ms, then passing max_time=0.05 will include only time steps up to 500 ms. If nothing is passed, then all time steps will be considered.

Returns:
datetime.timedelta

Total simulation time for adaptive refinement or transient simulation.