Unit test for Optimizer restart functionality
The restart test only checks that the restart will fail if given a bad restart file. While this is good, it is not enough to ensure that the restart functionality is doing what one would expect it to do.
Given the importance of a restart, one should be more careful in regard to how something is restarted.
This adds a test for optimizers by checking that (1) a single run to optimize a structure and, (2) a restarted optimization run, that is stopped after N steps:
- are IDENTICAL each other
- that the trajectory file is also identical and contains appropriate information
- the restart and trajectory file contain the appropriate information
There were unsurprisingly bugs found when these tests were added. The bug fixes are provided in a separate MR !3135 (merged), which should be merged first. BFGSLineSearch is marked as xfail, it does not restart the same. A lot of time was spent fixing CellAwareBFGS and BFGS.
This test is still not comprehensive enough. One should have a test for each optimizer option to ensure these calculations are doing what the doc string claims.
Checklist
-
I have read the contribution guidelines. -
Unit tests have been added for any new or changed code, and the test suite passes. Note: Your request will likely not be merged without the appropriate tests. -
New features and API Changes are described in doc/releasenotes.rst
. -
"closes #XXXX" is in the body of the MR description to link the related issue, if applicable.