User Tools

Site Tools


tutorial:torque

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
tutorial:torque [2016/10/07 09:33]
afo214
tutorial:torque [2016/10/18 15:15]
sertalpbilal
Line 11: Line 11:
  
 ===== Submitting Jobs ===== ===== Submitting Jobs =====
 +
 +<note tip>Check [[#prerequisite|prerequisite]] before using Torque.</note>
  
 Jobs can be submitted either using a submission file or directly from command line. First we explain how it is done and then we will discuss the options. Jobs can be submitted either using a submission file or directly from command line. First we explain how it is done and then we will discuss the options.
Line 154: Line 156:
 </code> </code>
  
-Allocating more than one CPU under PBS can be done in a number of ways, using the -l flag and the following resource descriptions:+Allocating more than one CPU under PBS can be done in a number of ways, using the ''-l'' flag and the following resource descriptions:
  
   * nodes - specifies the number of separate nodes that should be allocated   * nodes - specifies the number of separate nodes that should be allocated
Line 160: Line 162:
   * ppn - how many processes to allocate for each node   * ppn - how many processes to allocate for each node
  
-The allocation made by pbs will be reflected in the contents of the nodefile, which can be accessed via the $PBS_NODEFILE environment variable.+The allocation made by pbs will be reflected in the contents of the nodefile, which can be accessed via the ''$PBS_NODEFILE'' environment variable.
  
 The difference between ncpus and ppn is a bit subtle. ppn is used when you actually want to allocate multiple processes per node. ncpus is used to qualify the sort of nodes you want, and only secondarily to allocate multiple slots on a cpus. Some examples should help. The difference between ncpus and ppn is a bit subtle. ppn is used when you actually want to allocate multiple processes per node. ncpus is used to qualify the sort of nodes you want, and only secondarily to allocate multiple slots on a cpus. Some examples should help.
Line 219: Line 221:
   * **PBS_WALLTIME** (the walltime requested by the user or default walltime allotted by the scheduler)   * **PBS_WALLTIME** (the walltime requested by the user or default walltime allotted by the scheduler)
  
 +===== Mass Operations =====
 +
 +==== Submitting multiple jobs ====
 +An easy way to submit multiple jobs via PBS is using a batch script. Suppose we would like to give all file names inside a folder with MPS extension into our solver. We can write a PBS Script such as
 +<code bash submit.pbs>
 +cd /home/sec312/
 +/usr/local/cplex/bin/x86-64_linux/cplex ${FILENAME}
 +</code>
 +and a BASH script:
 +<code bash bashloop.sh>
 +for f in dataset/*.mps
 +do
 +    qsub -q batch -v FILENAME=$f submit.pbs
 +done
 +</code>
 +Here, option ''-v'' passes all arguments (''FILENAME'' in our example'') that we define into PBS file. You can submit several arguments by separating them with commas. DON'T use space between arguments.
 +
 +After having these two files, simply calling
 +<code>
 +./bashloop.sh
 +</code>
 +will submit all jobs into Torque.
 +
 +==== Cancelling all jobs ====
 +You can call
 +<code bash>
 +qselect -u <username> -s R | xargs qdel
 +</code>
 +to cancel all of your running jobs.
  
 ===== Prerequisite ===== ===== Prerequisite =====
Line 224: Line 255:
 After connecting to polyps enter: After connecting to polyps enter:
  
-<code>+<code bash>
 ssh-keygen -N "" ssh-keygen -N ""
 </code> </code>
Line 230: Line 261:
 Then just press ENTER for any question. After that type the following commands: Then just press ENTER for any question. After that type the following commands:
  
-<code>+<code bash>
 touch ~/.ssh/authorized_keys2 touch ~/.ssh/authorized_keys2
 chmod 600 ~/.ssh/authorized_keys2 chmod 600 ~/.ssh/authorized_keys2
 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys2 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys2
 </code> </code>
-Now, you will get the error and output files for your jobs.+Now, you will get the error log and output log files for your jobs.
  
  
tutorial/torque.txt ยท Last modified: 2024/02/28 13:12 by mjm519