[CP2K:2210] determinism of CP2K runs

Teodoro Laino teodor... at gmail.com
Fri Aug 7 20:57:45 CEST 2009

Hi Noam,

If you talk with a programmer he will tell you that computer codes are 
If you talk with a mathematician he will tell you that computer code are 
not deterministic (roundoff errors, accuracy, order in which you do 
operations, etc..).

The reality is that there is nothing random in the way CP2K performs 
calculations, but the errors you see (in your output files) are just 
numerical approximations.
I can see that in the two runs you were using different machines.
Although IT companies should guarantee the same numerical accuracy for 
the same electronic components (CPU, etc), it may be (rare case but it 
could be) that one of the machines in the two sets has slightly 
different numerics : due to slightly different electronics or even 
installations, or because a cosmic ray was just passing through one of 
them while running CP2K ;-).
also the way MPI is handling the collective operations may create 
different numerics: to the best of my knowledge (if somebody is willing 
to correct me please do so) the MPI standard does not enforce 
determinism. It is encouraged in the implementations but is 
not-mandatory in order to allow the deferred synchronization (a way to 
improve performance).

This is normally not an important problem since the errors are extremely 
small ( in the range of 10^-10 -10^-13 H) compared to the quantities 
normally involved in chemical processes (10^-1 - 10^-4 H).
However, due to the chaotic nature of  the MD equations, it may happen 
(especially with unstable systems) that two trajectory run on different 
machines may diverge due to the small roundoff differences (there are 
nice things to read about the Lyapunov instabilities in MD).

Anyway.. coming back to serious things: I wouldn't worry too much for 
the number you sent.
If you are really in a paranoiac-state I would suggest you to try to run 
the same input file exactly on the same set of machines (with exactly 
the same distribution of processes). Hopefully you should get the same 


Noam Bernstein wrote:
> Hi all - should I expect CP2K Quickstep to be deterministic? I.e. if I  
> run twice (in parallel) with exactly the same input file, should the  
> results be _exactly_ the same (to all decimals)? Or should I expect  
> some random component to the results? Because that's what I'm seeing  
> (in a 0 step MD run, i.e. just a single force/energy evaluation),  
> despite setting SEED in the GLOBAL section, and I'm trying to figure  
> out if that's normal, or indicates a problem in my compiler or machine.
>   I've attached a test case that runs in 3 minutes on 16 cores, and  
> two outputs (start differing at 39 OT CG, around 1e-10). A much  
> smaller system I tried doesn't show the same problem. Is this test  
> case still too big? If so, I'll look for a medium size case that shows  
> the problem.
> 											 thanks, Noam
> Noam Bernstein
> noam.be... at nrl.navy.mil
> >   

More information about the CP2K-user mailing list