Submitting a generic serial job

If your job is neither parallel, nor multithreaded (as is, for example, all of CCP4 programs including refmac), then your program will just 'stick' to one and only one core and nothing much is to be gained from the point of view of performance. In reality it is worse than that: your single-threaded job (if submitted to the fast queue), may be resposible for practically stopping the execution of a full scale parallel job. So, be a good citizen and do not submit a single-threaded job when the cluster is loaded with parallel jobs (on the other hand, if there are nodes filtering the machine room dust, feel free to submit even your date command).

The only way to make the whole exercise worthwhile is to have enough independent calculations to perform to justify submitting four (or eight, or twelve, …) incarnations of your program to the cluster (ie. by actually having a so-called embarrassingly parallel problem to solve).

Assuming that you do have a multiple of four jobs to run, proceed as follows:

  • Organise the files for your four (eight, twelve, …) jobs in suitable directories.
  • Each directory should contain a script file (made executable with chmod) containing the commands needed to run your job.
  • Enter each directory and submit your jobs with sbatch -n1 ./script


A worked example for launching four refmac jobs :

# cd 1/
# ls -lF
# total 1808
-rw-r--r-- 1 glykos glykos  289594 Mar 26 14:46 ini.pdb
-rw-r--r-- 1 glykos glykos 1246492 Mar 26 14:46 lmbe-free.mtz
-rw-r--r-- 1 glykos glykos  300433 Mar 26 14:55 start0.pdb
-rwxr-xr-x 1 glykos glykos    2684 Mar 26 14:47 tls.csh*
-rw-r--r-- 1 glykos glykos     372 Mar 26 14:46 tls.in

# more tls.csh
#!/bin/csh -f
#
#   Example of refinement by refmac
#

pdbset xyzin ini.pdb xyzout start0.pdb << eof
NOISE 0.20
END
eof

set inmtz=lmbe-free.mtz
start:

set name = start
set last = 0
set cycles = 2
set count = 0
while ($count != $cycles)
echo '*******************************************************************'
echo  $count 
echo '*******************************************************************'
@ curr = $last + 1

#
# Refmac 
#
refmac:
refmac5 \
HKLIN   $inmtz \
HKLOUT   ${name}${last}.mtz \
XYZIN   ${name}${last}.pdb \
XYZOUT  ${name}${curr}.pdb \
TLSIN tls.in \
 > refmac_${curr}.log << eor
#
#####Do not add hydrogens
#
MAKE_restraints HYDRogens No

...

#
#
# sbatch -n1 ./tls.csh
# cd ../2/
# sbatch -n1 ./tls.csh
# cd ../3/
# sbatch -n1 ./tls.csh
...
research/howto/submitting_a_generic_serial_job_eg._ccp4.txt · Last modified: 2009/03/26 15:04 (external edit)