TORQUE template script example: Difference between revisions

From Relion
Jump to navigation Jump to search
(Created page with "#!/bin/bash ### Inherit all current environment variables #PBS -V ### Job name #PBS -N relion <code> ### Output and Error #PBS -e XXXerrfileXXX #PBS -o XXXoutfileXXX ### Queu...")
 
No edit summary
 
(8 intermediate revisions by one other user not shown)
Line 1: Line 1:
#!/bin/bash
== The environment setup ==
### Inherit all current environment variables
Because the TORQUE queue at the CNB-CSIC requires a maximum wall-clock-time, one needs to define the XXXextra1XXX variable. In their environment (.bashrc) one includes:
#PBS -V
 
### Job name
export RELION_QSUB_EXTRA1="Max number of hours in queue"
#PBS -N relion
export RELION_QSUB_EXTRA1_DEFAULT="72"
<code>
export RELION_QSUB_TEMPLATE="/gpfs/fs1/home/bioinfo/scheres/relion-0.9/bin/qsub.bash"
  ### Output and Error
 
  #PBS -e XXXerrfileXXX
 
#PBS -o XXXoutfileXXX
The command used for job submission (to be given in the GUI) is <code>qsub</code>.
 
== The template script ==
 
The following script is saved as /gpfs/fs1/home/bioinfo/scheres/relion-0.9/bin/qsub.bash:
 
 
#!/bin/bash
### Inherit all current environment variables
#PBS -V
### Job name
#PBS -N XXXnameXXX
  ### Keep Output and Error
  #PBS -k eo
  ### Queue name
  ### Queue name
  #PBS -q XXXqueueXXX
  #PBS -q XXXqueueXXX
Line 17: Line 30:
  ### Switch to the working directory;
  ### Switch to the working directory;
  cd $PBS_O_WORKDIR
  cd $PBS_O_WORKDIR
echo Working directory is $PBS_O_WORKDIR
  ### Run:
  # Calculate the number of processors allocated to this run.
NPROCS=`wc -l < $PBS_NODEFILE`
# Calculate the number of nodes allocated.
NNODES=`uniq $PBS_NODEFILE | wc -l`
### Display the job context
echo Running on host `hostname`
echo Time is `date`
echo Directory is `pwd`
echo Using ${NPROCS} processors across ${NNODES} nodes
#################################
  mpirun --bynode -np XXXmpinodesXXX XXXcommandXXX
  mpirun --bynode -np XXXmpinodesXXX XXXcommandXXX
  echo "done"
  echo "done"
</code>

Latest revision as of 13:25, 13 November 2017

The environment setup

Because the TORQUE queue at the CNB-CSIC requires a maximum wall-clock-time, one needs to define the XXXextra1XXX variable. In their environment (.bashrc) one includes:

export RELION_QSUB_EXTRA1="Max number of hours in queue"
export RELION_QSUB_EXTRA1_DEFAULT="72"
export RELION_QSUB_TEMPLATE="/gpfs/fs1/home/bioinfo/scheres/relion-0.9/bin/qsub.bash"


The command used for job submission (to be given in the GUI) is qsub.

The template script

The following script is saved as /gpfs/fs1/home/bioinfo/scheres/relion-0.9/bin/qsub.bash:


#!/bin/bash
### Inherit all current environment variables
#PBS -V
### Job name
#PBS -N XXXnameXXX
### Keep Output and Error
#PBS -k eo
### Queue name
#PBS -q XXXqueueXXX
### Specify the number of nodes and thread (ppn) for your job.
#PBS -l nodes=XXXmpinodesXXX:ppn=XXXthreadsXXX
### Tell PBS the anticipated run-time for your job, where walltime=HH:MM:SS
###PBS -l walltime=XXXextra1XXX:00:00
#################################
### Switch to the working directory;
cd $PBS_O_WORKDIR
### Run:
mpirun --bynode -np XXXmpinodesXXX XXXcommandXXX
echo "done"