Page 1 of 1

Final MD NSW steps are not completed

Posted: Wed Jan 04, 2023 6:05 am
by jeremiah
Hello,

I am running VASP MD/MLFF with a preemptible job, so my NSW gets updated frequently. I noticed that if the last run does not have NSW ending in 0, a few NSW steps are not completed. For example, if I start with 1000 NSW steps, my job might look like this:

run 1: NSW = 1000
-> 245 steps completed this run
run 2: NSW = 755
-> 740 steps completed this run
run 3: NSW = 15
-> 10 steps completed this run
done
-> total: 995 steps

The only thing that I can think of that is related to the number 10 is the NBLOCK, which I have set to 10 as the wiki suggests for MLFF.

I have attached an example, where I have 15 NSW steps in the INCAR but only 10 are completed.

Thank you,
Jeremiah

Re: Final MD NSW steps are not completed

Posted: Wed Jan 04, 2023 9:22 am
by ferenc_karsai
The behavior you observe is because NSW is reset in main.F before the loop starts:
DYN%NSW=INT(DYN%NSW/DYN%NBLOCK/DYN%KBLOCK)*DYN%NBLOCK*DYN%KBLOCK

So NSW is integer divided by NBLOCK and then integer multiplied by NBLOCK.
In integer divisions the residuals are simply cut. So if there are any residuals after division it will always result in less steps than specified in the INCAR.
So in your example this would look like:
15/10=1; 1*10=10

We will add this information to the description of NBLOCK in the wiki.

Re: Final MD NSW steps are not completed

Posted: Wed Jan 04, 2023 5:08 pm
by jeremiah
Thank you. What is the relationship to KBLOCK? Based on your formula, I get

INT(15/10/1000) * 10 * 1000 = 0 * 10 * 1000 = 0

Re: Final MD NSW steps are not completed

Posted: Thu Jan 05, 2023 12:20 am
by jeremiah
jeremiah wrote: Wed Jan 04, 2023 5:08 pm Thank you. What is the relationship to KBLOCK? Based on your formula, I get

INT(15/10/1000) * 10 * 1000 = 0 * 10 * 1000 = 0
I found that my run with 10000 < NSW < 20000 steps stopped after 10000 had completed. For NSW < 10000, it stops at factors of 10.

Re: Final MD NSW steps are not completed

Posted: Thu Jan 05, 2023 10:11 am
by ferenc_karsai
At the beginning of the calculation KBLOCK=NSW is set.
But just right befor the call which recalculates NSW the following is called:
IF (DYN%NSW<DYN%KBLOCK*DYN%NBLOCK) DYN%KBLOCK=1

In your case DYN%KBLOCK*DYN%NBLOCK=10*10=100 which is larger than DYN%NSW=10. So KBLOCK is 1 in the calculation.