dolfin-adjoint / pyadjoint

The algorithmic differentation tool pyadjoint and add-ons.
GNU Lesser General Public License v3.0
90 stars 35 forks source link

Fixing restart cases that revert #146

Closed sghelichkhani closed 3 months ago

sghelichkhani commented 4 months ago

This addresses an issue where restoring from a checkpoint coincides with an iteration marked Revert by ROL2.0, triggering a ROL.UpdateType.Revert operation. Previously, this scenario would cause an error when self.rf.tape.restore_block_vars(self._tape_cache) is executed without an available _tape_cache. To resolve this, the implementation now checks for the availability of _tape_cache. If it is not available yet, the tape is recomputed using x.dat, and subsequently, self._tape_cache is updated accordingly.