Unexpected behavior molecular dynamics using timelimit flag

Hello forum,

Summary :
I’ve written a script that relaunches itself to do a molecular dynamics (input file linked). I’m using the time limit flag as I want Abinit to close and then relaunch a new simulation before the time allocation on my cluster runs out. The simulation saves unconverged steps. From 23 to 24 hours (23h being the time limit flag and 24h being the real time limit for my allocation), the SCF loop ends early and saves unconverged results to the MD.

Analysis of the problem:
Here’s the command I have been using to launch the simulation on my 24h allocation :
mpirun -n 40 abinit run.abi --timelimit 23:00:00 > run.log

This is the SCF convergence of step 652 :

 iter   Etot(hartree)      deltaE(h)  residm     vres2

ETOT 1 282946.63680096 2.829E+05 2.133E+00 8.972E+10
ETOT 2 272740.40374222 -1.021E+04 6.669E-01 8.615E+10
Approaching time limit 23:00:00 [hours]. Will exit istep loop in scfcv_core.

Cartesian components of stress tensor (hartree/bohr^3)
sigma(1 1)= -2.00689575E+01 sigma(3 2)= -4.88637865E-04
sigma(2 2)= -2.00912571E+01 sigma(3 1)= -5.72941599E-04
sigma(3 3)= 1.98335281E+01 sigma(2 1)= -3.99236184E-04

scprqt: WARNING -
nstep= 200 was not enough SCF cycles to converge;
maximum energy difference= 1.021E+04 exceeds toldfe= 1.000E-07

Instead of ending the calculation and discarding the timestep 652, it was saved and then timestep 653 was also computed. It also stopped after 2 SCF cycle. And it continued doing 2 cycles SCF loops until timestep 667, the point at which the real time allocation (24 hours) ended.

Expectation :
Better case expectation : Abinit assumes it doesn’t have time to start timestep 652 and ends the simulation early.
Worst case expectation : Abinit crashes at the 23h mark without saving timestep 652.

Attached files :
run.abi (9.0 KB)
Due to size limit, I have cut the part before timestep 650 in the abo file :
part.abo (2.0 MB)

Best regards,

Olivier