Final outputs possibly not done when dumping restart file on final step
In order to test restarting with lightcone outputs I've set up a run which dumps restart files and exits very frequently. It dumped restart files on the final step:
2629 1.402864e-02 0.9995202 0.0004801 3.412800e-06 42 43 322 322 0 0 0 19.769 0
[0000] [00060.0] engine_dump_restarts: Writing restart files
[0001] [00095.9] main: Runtime limit reached, dumping restart files...
[0000] [00095.9] main: Runtime limit reached, dumping restart files...
[0000] [00095.9] engine_dump_restarts: Writing restart files
[0003] [00095.9] main: Runtime limit reached, dumping restart files...
[0002] [00095.9] main: Runtime limit reached, dumping restart files...
2630 1.403547e-02 1.0000000 0.0000000 6.826610e-06 43 56 262144 524288 0 0 0 36388.352 288
[0000] [00096.3] main: Running the resubmission command:
Submitted batch job 3679656
[0000] [00096.5] main: resubmission command completed.
[0000] [00096.5] main: done. Bye.
But some of the output I was expecting has not been produced. I think the problem might be that the block of code in main.c that writes the final outputs didn't execute because force_stop was set. Then the if (!force_stop && nsteps == -2)
condition in main.c would be false and the final outputs would be skipped even though we've reached the end of the simulation.