Hi Chris,
Thanks for the clear explanation on 1) & 2). The easiest solution is to not stream moves, as I need to recreate it every time a restart is loaded anyway (the gpu device on which the move potentially changes every time the job is resubmitted).
For 3) I have done the tests you suggested, i.e
print "Simulation took %d s " % ( s2 - s1)
print "Potential energy = ", system.energy(), " Kinetic energy = ", moves[0].kineticEnergy()
if buffer_freq > 0:
system = clearBuffers(system)
system.mustNowRecalculateFromScratch()
print system.energy()
print "Saving restart"
Sire.Stream.save( [system], restart_file )
* The output does not suggest the energy of the system has changed
julien@node005:~/projects/nautilus/hydrationstudy/purewater/simulation0/run/newversion$ python siregpumd-openmm.py 1
### Starting script on unknown ###
New run. Loading input and creating restart
Applying flexibility and zmatrix templates...
Creating force fields...
Saving restart
Loading required Sire Python modules...............Done!
Loaded a restart file
Setting up moves...
Created a MD move that uses OpenMM for all molecules on GPU 1
Generated random seed number 430642
There are 3217 atoms in the group
Setup took 3 s
Potential energy = -8773.96 kcal mol-1 Kinetic energy = 2120.59 kcal mol-1
Running MD simulation
Cycle = 1
Time to write coordinates 1810 ms
Cycle = 2
Time to write coordinates 1631 ms
Simulation took 38 s
Potential energy = -8917.81 kcal mol-1 Kinetic energy = 1458.68 kcal mol-1
Clearing buffers...
-8917.81 kcal mol-1
Saving restart
* However...surprise surprise !
the restart file is now only 690KB
julien@node005:~/projects/nautilus/hydrationstudy/purewater/simulation0/run/newversion$ ll
total 4460
drwxr-xr-x 2 julien michel 145 Jan 21 22:18 ./
drwxr-xr-x 5 julien michel 69 Jan 21 22:11 ../
-rw-r--r-- 1 julien michel 1015 Jan 21 22:08 gpujob.sh
-rw-r--r-- 1 julien michel 123 Jan 21 22:18 moves.1.dat
-rw-r--r-- 1 julien michel 688526 Jan 21 22:18 sim_restart.s3
-rwxr-xr-x 1 julien michel 26338 Jan 21 22:17 siregpumd-openmm.py*
-rw-r--r-- 1 julien michel 235017 Jan 21 22:08 SYSTEM.crd
-rw-r--r-- 1 julien michel 499573 Jan 21 22:08 SYSTEM.top
-rw-r--r-- 1 julien michel 3094996 Jan 21 22:18 traj000000001.dcd
* And jobs can be restarted
julien@node005:~/projects/nautilus/hydrationstudy/purewater/simulation0/run/newversion$ python siregpumd-openmm.py 1
### Starting script on unknown ###
Loading required Sire Python modules...............Done!
Loaded a restart file
Setting up moves...
Created a MD move that uses OpenMM for all molecules on GPU 1
Generated random seed number 779581
There are 3217 atoms in the group
Setup took 0 s
Potential energy = -8917.81 kcal mol-1 Kinetic energy = 1458.68 kcal mol-1
Running MD simulation
Cycle = 1
Time to write coordinates 1653 ms
Cycle = 2
Time to write coordinates 2008 ms
Simulation took 38 s
Potential energy = -8974.5 kcal mol-1 Kinetic energy = 1470 kcal mol-1
Clearing buffers...
-8974.5 kcal mol-1
Saving restart
julien@node005:~/projects/nautilus/hydrationstudy/purewater/simulation0/run/newversion$ ll -lth
total 7.4M
-rw-r--r-- 1 julien michel 3.0M Jan 21 22:23 traj000000002.dcd
-rw-r--r-- 1 julien michel 673K Jan 21 22:23 sim_restart.s3
-rw-r--r-- 1 julien michel 123 Jan 21 22:23 moves.2.dat
drwxr-xr-x 2 julien michel 4.0K Jan 21 22:22 ./
-rw-r--r-- 1 julien michel 3.0M Jan 21 22:18 traj000000001.dcd
-rw-r--r-- 1 julien michel 123 Jan 21 22:18 moves.1.dat
-rwxr-xr-x 1 julien michel 26K Jan 21 22:17 siregpumd-openmm.py*
drwxr-xr-x 5 julien michel 69 Jan 21 22:11 ../
-rw-r--r-- 1 julien michel 1015 Jan 21 22:08 gpujob.sh
-rw-r--r-- 1 julien michel 230K Jan 21 22:08 SYSTEM.crd
-rw-r--r-- 1 julien michel 488K Jan 21 22:08 SYSTEM.top
* So it looks like there is a bug indeed, and a workaround is to call
system.mustNowRecalculateFromScratch()
before writing the restart.
Thanks again