Different number of steps for the same job


Just Got Here
Dear nwchem users,

I'm currently trying to get a reference time of execution for a benchmark
My problem is that the execution time show lot of variations, more than 12%. The main reason comes from the number of steps it takes to converge. The test case is :
START XXXXXX

title "XXXXXXXX"
charge 0
memory total 1800 MB
scratch_dir   XXXXXXX
permanent_dir XXXXXXXXXXX
geometry units angstroms print xyz noautoz

XXXXXXXXXXX

basis
 H XXXXXX
 C XXXXXX
end

driver
 maxiter 100
end

dft
 xc b3lyp
 iterations 500
 semidirect memsize 2900000 filesize 2400000
end

task scf optimize


that is scf optimisation with DFT in a semi-direct method.
Sometimes it takes 20 steps and other times 21,22 or 23 steps. I have already looked that it did not come from an IO bottleneck. It also seems to not come from the mathematical library used (MKL).

I have looked at the output file in this section :
 -------------------
  Energy Minimization
  -------------------
Using diagonal initial Hessian 
          --------
          Step   0
          --------
............................................
............................................

   Starting SCF solution at      26.0s

 ----------------------------------------------
         Quadratically convergent ROHF

 Convergence threshold     :          1.000E-04
 Maximum no. of iterations :           30
 Final Fock-matrix accuracy:          1.000E-07
 ----------------------------------------------
             iter       energy          gnorm     gmax       time
             ----- ------------------- --------- --------- --------
                 1    -7735.0905221208  4.19D+00  2.26D-01     29.4
.............................
............................

for different execution. The first value " 1 -7735.0905221208" changes from one execution from another even for step 0. Then since it did not begin with the same initial value, the next steps are also differents. One comment : before beginning this minimisation, file have been stored on disks (and I suppose read).
I suspect that this initial value differs because of the semi-direct method : the files stored on disk are in 32 bits precision and when the code reads again those files the initial value differs from one execution to another. So I might expect 7 to 8 significant digits, isn't it ? (it is what I see). In the documentation, it is said : with appropriate treatment for large values to retain precision.
Do I have to add a parameter in the input to activate it ?
I have test to put a threshold for SCF to 1e-10 to cause a file storing in 64 bits and I have seen that this initial value is the same between different executions which seem to confirm the assumption.

If it is the case, I did not understand the convergence criteria : between each global step of minimization, files are stored and then read in 32 bits, so I might expect only 7 to 8 significant digits between the last value of step N-1 and first value of step N. But one of the default convergence criteria is a variation of 1e-06 of the total energy. Since the initial value of a steps seems to have only "4 significant digits after the point", it might explain that the stopping criteria is attained for different values of the total number of steps.

Does this explanation looks right for you , or am I missing some things ?
It is the first time I'm running NWCHEM, so please tell me if I'm completely wrong since the beginning.

Is it possible to ask for a 64 bit file storing on disk by keeping the SCF threshold to its default value ?
Or do you see a way to get a number of steps constant for different executions ?
My goal is only to have a reference time.

Thank you in advance for your help,

Pierre-Antoine

Forum Vet
Pierre-Antoine
I had a look at the code and I think that you might have stumbled in a bug in the way the NWChem DFTmodule passes the 2-electron integral threshold.
A way to circumvent this bug is add the following line to the dft block

tolerances tight

That is

dft
 xc b3lyp
 iterations 500
 semidirect memsize 2900000 filesize 2400000
 convergence energy 1d-9
 tolerances tight
end


Please let me know if this gets the desired effect (that is to turn off file compression for the 2-el. integrals -- if I have understood you correctly).

Cheers, Edo

Just Got Here
Thanks for your answer Edo.

In fact the modifications you propose did not work : I still see dispersion in the total time needed for the execution due to different total number of steps for convergence.

I think I solve my issue by specifying to take the scf threshold to 1e-06. I still need more runs to be sure.
Furthermore the outpout file are stored in 64-bit.
I might miss some point to understand how the convergence works : by default scf threshold is at 1e-04 and I see between runs only 4 significant digits after the decimal point during the iteration of ROHF. On the other part, the energy minimization has one criterium about total energy convergence which is by default 1e-06. I know there are others criteria, but with only those two, the last steps of convergence seems to me quite erratic.

To test it, I have taken the solution of the computation as the input for the benchmark : I would have expected all simulations to end at step 1. But over 7 runs, I saw 1 run taking 2 steps to converge.

Cheers,
Pierre-Antoine

Forum Vet
turn off semdirect
Pierr-Antoine
I do think that the best solution for benchmarking is not use semi-direct, but use either a) direct or b) full disk-based conventional SCF.
My personal experience is that when you use semi-direct with a combination of disk and memory storage, the integral screening can give "variable results" (especially when running in parallel).

Cheers, Edo


Forum >> NWChem's corner >> Running NWChem