Difference between revisions of "Job Arrays"

From Carl R. Woese Institute for Genomic Biology - University of Illinois Urbana-Champaign
Jump to navigation Jump to search
(Created page with "= Job Array Example = Making a new copy of the script and then submitting each one for every input data file is time consuming. An alternative is to make a job array using th...")
 
(EXAMPLE QSUB SCRIPT)
Line 10: Line 10:
  
 
== EXAMPLE QSUB SCRIPT ==
 
== EXAMPLE QSUB SCRIPT ==
<pre><span style="color: rgb(51, 51, 51); font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; line-height: 26px; background-color: rgb(248, 248, 248);">#!/bin/bash</span>
+
#!/bin/bash
<span style="color: rgb(51, 51, 51); font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; line-height: 26px; background-color: rgb(248, 248, 248);"># ----------------QSUB Parameters----------------- #</span>
+
# ----------------QSUB Parameters----------------- #
<span id="qsub_params_span" style="box-sizing: border-box; color: rgb(51, 51, 51); font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; line-height: 26px;"><span id="bash_content" style="box-sizing: border-box;">#PBS -S /bin/bash</span>
+
#PBS -S /bin/bash
<span id="q_param_input" style="box-sizing: border-box;">#PBS -q default</span>
+
#PBS -q default
<span id="l_param_input" style="box-sizing: border-box;">#PBS -l nodes=1:ppn=2,mem=1000mb</span>
+
#PBS -l nodes=1:ppn=2,mem=1000mb
<span id="M_param_input" style="box-sizing: border-box;">#PBS -M youremail@illinois.edu</span>
+
#PBS -M youremail@illinois.edu
<span id="m_param_input" style="box-sizing: border-box;">#PBS -m abe</span>
+
#PBS -m abe
<span id="N_param_input" style="box-sizing: border-box;">#PBS -N array_of_blast_jobs</span></span>
+
#PBS -N array_of_blast_jobs
<span style="color: rgb(51, 51, 51); font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; line-height: 26px; background-color: rgb(248, 248, 248);"># ----------------Load Modules-------------------- #</span>
+
# ----------------Load Modules-------------------- #
<span id="modules_span" style="box-sizing: border-box; color: rgb(51, 51, 51); font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; line-height: 26px;">module load blast/2.2.26</span>
+
module load blast/2.2.26
<span style="color: rgb(51, 51, 51); font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; line-height: 26px; background-color: rgb(248, 248, 248);"># ----------------Your Commands------------------- #</span>
+
# ----------------Your Commands------------------- #
<span id="software_span" style="box-sizing: border-box; color: rgb(51, 51, 51); font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; line-height: 26px;">perl run_blast_job.pl $PBS_ARRAYID</span></pre>
+
perl run_blast_job.pl $PBS_ARRAYID

Revision as of 10:12, 13 March 2014

Job Array Example[edit]

Making a new copy of the script and then submitting each one for every input data file is time consuming. An alternative is to make a job array using the -t option in your submission script. The -t option allows many copies of the same script to be queued all at once. You can use the PBS_ARRAYID to differentiate between the different jobs in the array.

Lets say you want to run 16 blast jobs. Instead of submitting 16 different jobs, you can submit one job, but use the -T parameter and the PBS_ARRAYID variable.

The -T parameter sets the range of the PBS_ARRAYID variable. So setting it to 0-15 will cause the qsub script to call the script 16 times, with an input of 0, 1 , 2 ,3


EXAMPLE QSUB SCRIPT[edit]

  1. !/bin/bash
  2. ----------------QSUB Parameters----------------- #
  3. PBS -S /bin/bash
  4. PBS -q default
  5. PBS -l nodes=1:ppn=2,mem=1000mb
  6. PBS -M youremail@illinois.edu
  7. PBS -m abe
  8. PBS -N array_of_blast_jobs
  9. ----------------Load Modules-------------------- #

module load blast/2.2.26

  1. ----------------Your Commands------------------- #

perl run_blast_job.pl $PBS_ARRAYID