SeqQuest: Job Manual

Overview

A Quest calculation requires an input file called "lcao.in", needs to locate atom files specified in the input file, generates an output file to standard output (which can be redirected), and generates a number of local files in the course of execution that can possible be very sizeable. Only one Quest calculation can run simultaneously in the one directory. Multiple runs in the same directory will attempt to use the same files for their work, with disastrous results. Typically, you will want to keep your important input and output files on a home disk, but perform calculations on separate scratch disks that have more space and are faster. This makes for easier cleanup afterwards and allows multiple jobs to be run remotely from a single home directory. While it is possible to run the code interactively, it is usually most convenient to let scripts handle the task of putting the right input files in the right places, running the job, and retrieving the desired output files and putting them in the right place. In the following is outlined one particular example of such a script, within csh, to illustrate how a job script might be assembled.

A job script needs to do the following:

  1. Create a Quest input file for the system of interest
  2. If it doesn’t already exist, identify and create the directory where the calculation is to be done.
  3. Copy the Quest input file to that directory.
  4. Put the atom files in that directory (or make sure that they are in the correct directory as specified in the Quest input file).
  5. Move to that directory.
  6. Find and run the Quest executable.
  7. Put the output listing file in the right place.
  8. If desired, save other output files to long-term storage.
  9. Clean up all the temporary files (big files accumulate otherwise)

Sample job script

The following sample script, call it "quest.job", runs a SeqQuest job. This particular script is specific to systems with Al,O, and H atoms in the calculation (the script transfers those files to a remote directory), but it should be transparent to see how to adapt it for other systems. The script is invoked with one argument "input_file":

  quest.job input_file 

where "input_file.in" is an input file to the calculation. The script sets up a remote directory on a scratch disk, coordinates all the files, runs the calculation, puts the output listing file in "input_file.out", returns to the home directory, and cleans up all the scratch files when it is done. This file is meant as an illustration only of a possible job script. Different users (and different OS shells) will need to modify this for their own requirements.

################# Sample csh job script: "quest.job"  ####################### # provide location of the executable: alias xlcao ~/bin/seqquest.x # provide location of the scratch disk root: set rdisk = '/scratch/${USER}/' #### # "jobnm" is name of quest input (and output) file for this calculation #    and it is passed into this script as an argument set jobnm = ${1} #### # map names of atoms as stored in home directory (atm#) to names # of atoms as specified in the the input file (lbl#). # Here, I have the atom files stored in my home directory as "al_lda.atm" # while the input file refers to the atoms as "al.atm", etc. set atm_fcnal = 'lda' set atm1 = 'al_'${atm_fcnal} ; set lbl1 = 'al' set atm2 = 'o_'${atm_fcnal}  ; set lbl2 = 'o' set atm3 = 'h_'${atm_fcnal}  ; set lbl3 = 'h' #### # set up a name for (temporary) subdirectory to do calculations in set tmpnm = 'tmp_'${jobnm} # assemble total pathname for the remote scratch directory, and create it ... set rdir = ${rdisk}/${tmpnm}; mkdir -p ${rdir} #  ... and "remember" the local home directory in "ldir" set ldir = $cwd #### # Record a time stamp in the log file for the job start ... date ; echo STARTING JOB #### set inputnm = ${jobnm}  ; set outnm = ${inputnm} ; echo starting ${jobnm} # clean out remote directory, and go there ... rm  ${rdir}/* ; cd  ${rdir} # copy over the atom files ... cp ${ldir}/${atm1}.atm ${lbl1}.atm ; cp ${ldir}/${atm2}.atm ${lbl2}.atm cp ${ldir}/${atm3}.atm ${lbl3}.atm # copy over the input file into "lcao.in" ... cp      ${ldir}/${inputnm}.in   lcao.in # run the executable, redirecting the output listing to the home directory xlcao >  ${ldir}/${outnm}.out #### # return to the local directory, and time stamp the log file ... cd ${ldir} ; echo ${jobnm} done ; date # ... and clean up remote directory, and remove it rm ${rdir}/* ; rmdir ${rdir} ###################### end sample job script ####################