# Restart breaking as current time not a multiple of dt

**URL:** <https://pyfr.discourse.group/t/restart-breaking-as-current-time-not-a-multiple-of-dt/1303>\
**Category:** Cases\
**Tags:** config\
**Created:** [2 October 2025 12:53 UTC](https://pyfr.discourse.group/t/restart-breaking-as-current-time-not-a-multiple-of-dt/1303 "2025-10-02T12:53:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlmostSurelyRob](https://yyz2.discourse-cdn.com/free1/user_avatar/pyfr.discourse.group/almostsurelyrob/32/446_2.png) [@AlmostSurelyRob](https://pyfr.discourse.group/u/AlmostSurelyRob)\
**Post date:** [2 October 2025 12:53 UTC](https://pyfr.discourse.group/t/restart-breaking-as-current-time-not-a-multiple-of-dt/1303/1 "2025-10-02T12:53:31Z")

</div>

I am running a workflow with PyFR. I run a simulation to blow away an initial transient and then I want to run an ensemble of simulations with slightly different settings on that developed solution.

Unfortunately, my restart fails with

```plaintext
ValueError: Plugin start times must be multiples of dt

```

Upon closer inspection, this is probably because my current time, `tcurr`, is indeed not a multiple of dt. When manually looking through the pyfrs file I see:

```ini
[solver-time-integrator]
tcurr = 200.00000000001123

```

Is there a clean way to set it to an arbitrary value? I tried just editing this to be 200 or 0, but then I end up with a hdf5 error. For my purposes, I would be happy to change this to 0 and pretend it’s a new run - do I need to write my own h5py processor for this?

---

<div class="post-metadata">

**Author:** ![fdw](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@fdw](https://pyfr.discourse.group/u/fdw)\
**Post date:** [2 October 2025 16:18 UTC](https://pyfr.discourse.group/t/restart-breaking-as-current-time-not-a-multiple-of-dt/1303/2 "2025-10-02T16:18:32Z")

</div>

This error should not usually occur. Specifically,

> <https://github.com/PyFR/PyFR/blob/d32107e192faf0c9f87a1b7af7e08f15b2bbf395/pyfr/integrators/dual/phys/base.py#L64>

Attempts to account for this by comparing with a tolerance that is defined in terms of the minimum time step:

> <https://github.com/PyFR/PyFR/blob/d32107e192faf0c9f87a1b7af7e08f15b2bbf395/pyfr/integrators/dual/phys/base.py#L59>

which should be sufficient to avoid this eventuality.

Regards, Freddie.

---

<div class="post-metadata">

**Author:** ![AlmostSurelyRob](https://yyz2.discourse-cdn.com/free1/user_avatar/pyfr.discourse.group/almostsurelyrob/32/446_2.png) [@AlmostSurelyRob](https://pyfr.discourse.group/u/AlmostSurelyRob)\
**Post date:** [3 October 2025 12:46 UTC](https://pyfr.discourse.group/t/restart-breaking-as-current-time-not-a-multiple-of-dt/1303/3 "2025-10-03T12:46:09Z")

</div>

Right, so my problem was clearly caused by the default value of `self.dtmin`. I built my use case from the 2D cylinder tutorial and `dt-min` was not defined in INI file. After adding `dt-min` to INI it now seems to restart properly.

But it would actually be more practical for me to reset the time back to 0 on restart? Is there an easy way to do it in PyFR/pyfrs files? I suspect I need to create aa batch HDF5 editor, which overwrites this value.

---

<div class="post-metadata">

**Author:** ![fdw](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@fdw](https://pyfr.discourse.group/u/fdw)\
**Post date:** [3 October 2025 13:51 UTC](https://pyfr.discourse.group/t/restart-breaking-as-current-time-not-a-multiple-of-dt/1303/4 "2025-10-03T13:51:38Z")

</div>

You would want to use h5py to modify the `stats` record. Only thing you need to be careful about is ensuring that it is written back as the correct type of string (h5py has several different ways of handling strings).

Regards, Freddie.
