editing input files directly and submitting to a queue

looking inside your water.com file

  • Using gaussview can be a pain, more often we directly edit input files, these drive the calcualtion by a set of keywords. You have already used the keyword opt and defined the method (b3lyp) and the basis set (6-311g(d,p)) in this way using the graphical interface
  • open your input water.com file (I've use the cat (for catenate) -n (number) command below to number each line)
  • 
    [phunt@login-0]/work/phunt/liquids $ cat -n water.com
         1	%chk=water.chk
         2	# opt b3lyp/6-311g(d,p) geom=connectivity
         3	
         4	single molecule water optimisation
         5	
         6	0 1
         7	 O                 -0.33512066   -0.22788203    0.00000000
         8	 H                  0.62487934   -0.22788203    0.00000000
         9	 H                 -0.65557524    0.67705380    0.00000000
        10	
        11	 1 2 1.0 3 1.0
        12	 2
        13	 3
        14
        
    
  1. defines the name for a checkpoint file
  2. is a list of keywords telling gaussian what to do
  3. blank line
  4. title (entered by you)
  5. blank line
  6. charge and multiplicity
  7. atomic symbol for oxygen then x,y,z coordinates
  8. atomic symbol for hydrogen then x,y,z coordinates
  9. atomic symbol for hydrogen then x,y,z coordinates
  10. blank line
  11. connectivity matrix atom 1 is connected to atoms 2 bond order of 1 and 3 bond order of 1
  12. connectivity matrix atom 2 (information already given)
  13. connectivity matrix atom 3 (information already given)
  14. blank line
  • strictly speaking the connectivity information is not required but it can be used to accelerate the optimisation
  • input is sensitive to the blank lines especially the last one ... don't forget them!
  • typically we use gaussview to generate the input geometry (xyz and connectivity information) and then we manually edit the input files using our favourite text editor on the hpc

submitting a file to the queue

  • to submit a file to the queue we cannot use it as it is generated by gaussview, we need to add some more information on the amount of memory and number of nodes to use
  • copy your water.com file to a new name, I've called mine water_queue.com
  • open the new file in your text editor
  • the way our run scripts are set up, your checkpoint file name must be exactly the same as your input file name, so change the checkpoint file name to reflect the new name of your file
  • now add two extra lines directly below the %chk option, these must go before the keywords line, these tell gaussian to use 2 processors and 3.6GB memory (these nodes actually have 4GB memory, but gaussian is a bit slopy with memory so we set the amount to less than we actually have).
    %mem=3600MB
    %nprocshared=2
  • 
    %chk=water_queue.chk
    %mem=3600MB
    %nproc=2
    # opt b3lyp/6-311g(d,p) geom=connectivity
    
    single molecule water optimisation
    
    0 1
     O                 -0.33512066   -0.22788203    0.00000000
     H                  0.62487934   -0.22788203    0.00000000
     H                 -0.65557524    0.67705380    0.00000000
    
     1 2 1.0 3 1.0
     2
     3
     
    
  • before you can submit a job you will need a run-script, copy and paste the following into a file called rng2_4 (2 processors, 4GB memory allocated)
  • #!/bin/sh
    
    # submit jobs to the que with this script using the following command:
    # rng2_4 is this script
    # jobname is a name you will see in the qstat command
    # name is the actual file minus .com etc it is passed into this 
    # script as ${in}
    #
    # qsub -N jobname -v in=name rng2_4
    
    # batch processing commands
    #PBS -l walltime=119:59:00
    #PBS -lselect=1:ncpus=2:mem=3800MB
    #PBS -j oe
    #PBS -q pqph
    
    # load modules
    #
    module load gaussian/g09
    
    # check for a checkpoint file
    #
    # variable PBS_O_WORKDIR=directoiry from which the job was sumbited.
       test -r $PBS_O_WORKDIR/${in}.chk
       if [ $? -eq 0 ]
       then
         echo "located $PBS_O_WORKDIR/${in}.chk"
         cp $PBS_O_WORKDIR/${in}.chk $TMPDIR/.
       else
         echo "no checkpoint file $PBS_O_WORKDIR/${in}.chk"
       fi
    #
    # run gaussian
    #
      g09 $PBS_O_WORKDIR/${in}.com
      cp $TMPDIR/${in}.chk /$PBS_O_WORKDIR/.
    # exit
    
    
  • now submit your job to the queue with the command
    qsub -N water_test -v in=water_queue rng2_4
    where water_test is the name that will appear int he queue list and water_queue is the name of the input file without the .com extension:
    
    /work/phunt/liquids $ qsub -N water_test -v in=water_queue rng2_4
    5031202.cx1
    [phunt@login-0]/work/phunt/liquids $ qstat
    Job id            Name             User              Time Use S Queue
    ----------------  ---------------- ----------------  -------- - -----
    5031202.cx1       water_test       phunt             00:00:00 R pqph            
    [phunt@login-0]/work/phunt/liquids $ 
    
    
  • if your job starts properly wyou will get an ID number back immediately
  • type qstat to get a list of your runing jobs
  • your job should finish almost immediately and you will see a *.o(number) file apear in your directory, this just records information about the start and finish time and reports error messages. If the job has been successful you should clear these files regularly from your direcotory, if your job has failed it may give you some important information as to why (from the perspective of executing the job). If the job failed inside gaussian those error messages will be in your gaussian *.log file.
    					
    [phunt@login-0]/work/phunt/liquids $ ls
    rng2_4     water.com  water_queue.com  water_test.o5031202
    water.chk  water.log  water_queue.log
    [phunt@login-0]/work/phunt/liquids $ cat water_test.o5031202
     
    Imperial College London HPC Service
    -----------------------------------
    Job water_test, jobid 5031202.cx1, username phunt - started execution
    at 13:12:17 Sun 23/01/11 on system cx1-50-1-2.cx1.hpc.ic.ac.uk
     
    no checkpoint file /work/phunt/liquids/water_queue.chk
    cp: cannot stat `/tmp/pbs.5031202.cx1/water_queue.chk': No such
    file or directory
     
    Imperial College London HPC Service
    -----------------------------------
    Job water_test, jobid 5031202.cx1, username phunt - end of execution
    at 13:12:27 Sun 23/01/11 on system cx1-50-1-2.cx1.hpc.ic.ac.uk
    
    
  • now you have run the same job in two different ways, from now on submit all jobs to the queuing system using the rng2_4 script with the %mem and %nprocshared information added to the *.com files generated by gaussivew, or yourself!
    
    [phunt@login-0]/work/phunt/liquids $ force water_queue.log
     Maximum Force            0.014864     0.000450     NO 
     Maximum Force            0.002692     0.000450     NO 
     Maximum Force            0.000206     0.000450     YES
    [phunt@login-0]/work/phunt/liquids $ force water.log
     Maximum Force            0.014864     0.000450     NO 
     Maximum Force            0.002692     0.000450     NO 
     Maximum Force            0.000206     0.000450     YES
    [phunt@login-0]/work/phunt/liquids $