Restarting Calculations from rwf Files – Gaussian

Having a long calculation terminated just because it ran out of time in the queue is very frustrating; even more so if restarting it from the last accesible point is hard to do.

I have recently performed some particularly demanding calculation: Basis Set Superposition Error (BSSE) with the Counterpoise method and second order Moller-Plesset perturbation theory calculation (MP2). The calculation ran out of time but I was able to restart it because I had the rwf file! My input looked a bit like this:

#p mp2/GEN counterpoise=2 maxdisk=200GB

So here is how it works.

The very first line of your calculation gives you the process ID number which is not necessarily the same as the PID given by the queue system (in fact, is not the same because the latter corresponds to the submitted script, not the instructions in it i.e. your calculation)

 Entering Gaussian System, Link 0=g09
 Initial command:
 /opt/SC/aplicaciones/g09-C.01/l1.exe /tmpu/joaqbf_g/joaqbf/Gau-38954.inp 
-scrdir=/tmpu/joaqbf_g/joaqbf/
 Entering Link 1 = /opt/SC/aplicaciones/g09-C.01/l1.exe PID=     38955.

(emphasis in red is mine)

This is the number you want to write down. You will need to find the corresponding rwf file (usually in your SCRATCH directory) as Gau-PID.rwf (in the aforementioned case, Gau-38955.rwf). If you are a bit paranoid like myself you want to copy and keep this file safe but be aware that these are very long files, in my case it was 175 GB long. Now you need to launch your calculation again with the following input:

%rwf=myfile.rwf
%nosave
%chk=myfile.chk

Title Card

# restart

rest of input

You can add all other controls to the Link0 section such as %nprocshared or %mem according to your needs.

I’m pretty sure it should work for other kinds of calculations in which taking from the checkpoint file is not as easy, so if you run into this kind of problems, its worth the try.

Advertisements

About joaquinbarroso

Theoretical chemist in his early thirties, in love with life and deeply in love with his woman. I love science, baseball, literature, movies (perhaps even in that order). I'm passionate about food and lately wines have become a major hobby. In a nutshell I'm filled with regrets but also with hope, and that is called "living".

Posted on October 13, 2015, in Computational Chemistry, Tricks, White papers and tagged , , , . Bookmark the permalink. 6 Comments.

  1. Is it possible to restart with additional parameters, for example
    # restart CPHF(MaxInv=15000)
    ?
    I haven’t had any luck with this.

    • I don’t think so. The restart option recovers the calculation from the read write file as it was. Depending on the calculation you’re doing you may want to first load the wavefunction with guess=read and then add more parameters, but don’t use the restart option.
      If you provide more details I may be able to make a better suggestion.
      Have a nice day!

  2. Thanks a lot for a great overview of calculations gaussian, your post helped me a lot.

  3. Marcel Louzada

    Does leaving the input file the same but including the %oldchk=$$$.chk. The copying over the chk file from the last job work? Does this work and if so is it limited to certain jobs.

    • I’m not sure I understand your question. Do you want to write over an old chk file or not? you can use these options:
      %chk=oldfilename.chk
      %NoSave

      this will use the previous chk file in your new calculation but leave it unchanged after the new calculation is done. You will not have access to all the data for the new calculation except for that in the log file.

      I hope this helps

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: