[Q-e-developers] QE random number generator (randy) error: j out of range

LIDing dingmaotu at 126.com
Sat Nov 10 15:57:59 CET 2012


Dear QE developers,


I am using QE 4.3.2 with PLUMED 1.3 (PWscf with metadynamics), and encountered a problem. I think it may be a bug.
The problem occurs most of the time, and only occasionally the error did not occur.
The message was always the same:


     Molecular Dynamics Calculation
 
      Starting temperature  =  9000.00 K
 
      temperature is set once at start
 
      mass Mg               =    24.30
      mass Si               =    28.09
      mass O                =    16.00
      Time step             =    20.00 a.u.,  0.9676 femto-seconds
 
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
      from randy : error #      1038
      j out of range
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
      stopping ...


I checked the relevant sources, and found that it occurred right in the md_init call.
The error was reported by randy function in the ramdom_numbers.f90 file when it was first called by set_random_seed.
In the random_numbers.f90:


     50       IF ( first ) THEN
     51          !
     52          first = .false.
     53          idum = MOD( ic - idum, m )
     54          !


ic = 150889, if you pass a random seed that is larger than ic, then idum will be a negative number after line 53.
I wrote a little program to call set_random_seed, most of the time idum will be a negative number and the test in
randy
   63       IF( j > ntab .OR. j <  1 ) call errore('randy','j out of range',j)
fails. j will be a negative number when I test this.


But in actual run, j is always 1038 whenever the error occurs, which does not match what I see in my little test program. It is very strange.


If I remove the line 53, everything seems OK in my test program but I am not sure if this line should be corrected in QE.
So is it a bug in QE, or I just made some mistakes (the random seed can be negative, and the error is caused by other problems)?


I work on a Linux PC cluster with intel compilers and openmpi, and QE is linked with the mkl library.


I am not a subscriber of this mail list. Contact me by email to dingmaotu at 126.com. Thank you!


Regards,
Li Ding
Institute of Geology and Geophysics, Chinese Academy of Science
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quantum-espresso.org/pipermail/developers/attachments/20121110/db124141/attachment.html>


More information about the developers mailing list