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/18 15:13]
sertalpbilal
tutorial:torque [2017/03/22 14:09]
sey212 [Running Gurobi]
Line 2: Line 2:
  
 TORQUE provides control over batch jobs and distributed computing resources. It is an advanced open-source product based on the original PBS project and incorporates the best of both community and professional development. It incorporates significant advances in the areas of scalability, reliability, and functionality and is currently in use at tens of thousands of leading government, academic, and commercial sites throughout the world. TORQUE may be freely used, modified, and distributed under the constraints of the included license. TORQUE provides control over batch jobs and distributed computing resources. It is an advanced open-source product based on the original PBS project and incorporates the best of both community and professional development. It incorporates significant advances in the areas of scalability, reliability, and functionality and is currently in use at tens of thousands of leading government, academic, and commercial sites throughout the world. TORQUE may be freely used, modified, and distributed under the constraints of the included license.
 +
 +
 +
 +===== Prerequisite =====
 +In order to extract your output and error results in Torque, you need to have password-less connection between nodes. If you have not set it once, execute the following commands. These commands create a public and private key so that when a node want to transfer a file to your home folder, it does not require the password.
 +After connecting to polyps enter:
 +
 +<code bash>
 +ssh-keygen -N ""
 +</code>
 +
 +Then just press ENTER for any question. After that type the following commands:
 +
 +<code bash>
 +touch ~/.ssh/authorized_keys2
 +chmod 600 ~/.ssh/authorized_keys2
 +cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys2
 +</code>
 +Now, you will get the error log and output log files for your jobs.
 +
 +
 +
  
 ===== Hardware ===== ===== Hardware =====
Line 11: Line 33:
  
 ===== Submitting Jobs ===== ===== Submitting Jobs =====
- 
-Check [[#prerequisite|prerequisite]] before using Torque. 
  
 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 44: Line 64:
 Now, we will run the code but we are setting the job parameters using ''-'' character (e.g. ''-N JobName'') Now, we will run the code but we are setting the job parameters using ''-'' character (e.g. ''-N JobName'')
  
-===== Important Options ===== +===== Options =====
  
   * ''-q <queue>'' set the queue. Often you will use the standard queue, so no need to set this up.   * ''-q <queue>'' set the queue. Often you will use the standard queue, so no need to set this up.
Line 71: Line 90:
 To show the jobs use ''qstat'' or ''qstat -a'' You can also see more details using To show the jobs use ''qstat'' or ''qstat -a'' You can also see more details using
 <code>qstat -f</code> <code>qstat -f</code>
-To show jobs of some user use ''qstat -u "mat614"'' To remove job do ''qdel JOB_ID''+To show jobs of some user use ''qstat -u "mat614"'' To remove job use 
 +<code shell> 
 +qdel JOB_ID 
 +</code>
  
 +Moreover, you can use the following command:
 +<code>qstat -r : provides the list of the running jobs</code>
 +<code>qstat -i : provides the list of the jobs which are in queue</code>
 +<code>qstat -n : provides the polyps node(s) which are executing each job</code>
 ==== Queues ==== ==== Queues ====
  
-We have few queues ''qstat -q''+We have few queues ''qstat -Q''
 <code> <code>
 Queue            Memory CPU Time Walltime Node  Run Que Lm  State Queue            Memory CPU Time Walltime Node  Run Que Lm  State
 ---------------- ------ -------- -------- ----  --- --- --  ----- ---------------- ------ -------- -------- ----  --- --- --  -----
 +gpu                --      --       --      --    0   0 --   E R
 medium             --      --       --      --    0   0 --   E R medium             --      --       --      --    0   0 --   E R
 short              --      --       --      --    0   0 --   E R short              --      --       --      --    0   0 --   E R
 long               --      --       --      --    0   0 --   E R long               --      --       --      --    0   0 --   E R
 batch              --      --       --      --    0   0 --   E R batch              --      --       --      --    0   0 --   E R
-verylong           --      --       --      --    0   --   E R +verylong           --      --       --      --    0   50   E R 
-                                               ----- ----- +AMPL               --      --       --      --      0 10   E R 
-                                                       0+MOSEK              --      --       --      --      50   E R 
 </code> </code>
 +
 +If you want to use AMPL or MOSEK, you have to use queue: AMPL or MOSEK, because we have limited licenses for them.
 +
 +
  
 You can see limits using this command ''qstat -f -Q'' You can see limits using this command ''qstat -f -Q''
Line 96: Line 128:
 | very long  | 240:00:00 | | very long  | 240:00:00 |
  
-==== Examples ====+===== Examples ====
 + 
 +==== Submitting a Small or Large Memory Job ==== 
 + 
 +You can use the option ''-l mem=size,vmem=size'' to limit memory usage of your job. 
 + 
 +<code bash limited.sh> 
 +qsub -l mem=4gb,vmem=4gb test.pbs 
 +</code>
  
-=== Submitting Large Memory Job ===+Sometimes your job needs more memory. You can choose a larger memory size with the same option:
  
-Sometimes your job needs more memory. This can be achieved by ''-l mem=size'' example +<code bash large.pbs>qsub  -l mem=20gb  test.pbs</code>
-<code>qsub  -l mem=20gb  test.pbs</code>+
  
-=== Running MATLAB -- Example ===+==== Running MATLAB ====
  
 You just have to create a submission job which looks like this You just have to create a submission job which looks like this
Line 116: Line 155:
 </code> </code>
  
-=== Interactive Jobs ===+<note tip>Use **-singleCompThread** [[https://www.mathworks.com/help/matlab/ref/maxnumcompthreads.html|option]] for Matlab to use a single thread. A similar option may be needed for the program/solver you're using.</note>
  
 +==== Running Solvers (Gurobi/CPLEX/Mosek/AMPL/...) ====
 +
 +In order to run solvers, you need to use "-V" (it is Upper case) option. i.e.:
 +
 +<code>qsub -V submitFile.pbs </code>
 +
 +This flag enables the solver to find necessary authentication information.
 +
 +==== Interactive Jobs ====
  
 If you do not care where you run your job just use ''-I'' and do not specify any script to run. If you do not care where you run your job just use ''-I'' and do not specify any script to run.
Line 126: Line 174:
 and you will be running interactive session on polyp15. and you will be running interactive session on polyp15.
  
-=== Using GPU's ===+==== Using GPU'====
  
  
Line 134: Line 182:
 However, first you have to have a permission to use GPU (given by Prof. Takac) -- this is just formality to allow to certain users to use video driver on polyp30 However, first you have to have a permission to use GPU (given by Prof. Takac) -- this is just formality to allow to certain users to use video driver on polyp30
  
-=== Running MPI and Parallel Jobs ===+==== Running MPI and Parallel Jobs ====
  
 <code bash mpi.pbs> <code bash mpi.pbs>
Line 196: Line 244:
 c2 c2
 </code> </code>
- 
-===== Advanced ===== 
- 
- 
-The qsub command will pass certain environment variables in the Variable_List attribute of the job. These variables will be available to the job. The value for the following variables will be taken from the environment of the qsub command: 
-  * **HOME** (the path to your home directory) 
-  * **LANG** (which language you are using) 
-  * **LOGNAME** (the name that you logged in with) 
-  * **PATH** (standard path to excecutables) 
-  * **MAIL** (location of the users mail file) 
-  * **SHELL** (command shell, i.e bash,sh,zsh,csh, ect.) 
-  * **TZ** (time zone) 
-These values will be assigned to a new name which is the current name prefixed with the string "PBS_O_". For example, the job will have access to an environment variable named PBS_O_HOME which have the value of the variable HOME in the qsub command environment. In addition to these standard environment variables, there are additional environment variables available to the job. 
-  * **PBS_O_HOST** (the name of the host upon which the qsub command is running) 
-  * **PBS_SERVER** (the hostname of the pbs_server which qsub submits the job to) 
-  * **PBS_O_QUEUE** (the name of the original queue to which the job was submitted) 
-  * **PBS_O_WORKDIR** (the absolute path of the current working directory of the qsub command) 
-  * **PBS_ARRAYID** (each member of a job array is assigned a unique identifier) 
-  * **PBS_ENVIRONMENT** (set to PBS_BATCH to indicate the job is a batch job, or to PBS_INTERACTIVE to indicate the job is a PBS interactive job) 
-  * **PBS_JOBID** (the job identifier assigned to the job by the batch system) 
-  * **PBS_JOBNAME** (the job name supplied by the user) 
-  * **PBS_NODEFILE** (the name of the file contain the list of nodes assigned to the job) 
-  * **PBS_QUEUE** (the name of the queue from which the job was executed from) 
-  * **PBS_WALLTIME** (the walltime requested by the user or default walltime allotted by the scheduler) 
  
 ===== Mass Operations ===== ===== Mass Operations =====
Line 251: Line 275:
 to cancel all of your running jobs. to cancel all of your running jobs.
  
-===== Prerequisite ===== +<code bash
-In order to extract your output and error results in Torque, you need to have password-less connection between nodes. If you have not set it once, execute the following commands. These commands create a public and private key so that when a node want to transfer a file to your home folder, it does not require the password. +qselect -u <username> | xargs qdel
-After connecting to polyps enter: +
- +
-<code> +
-ssh-keygen -N ""+
 </code> </code>
 +will cancel all jobs (both running jobs and queue).
  
-Then just press ENTER for any question. After that type the following commands: 
  
-<code> +===== Advanced ===== 
-touch ~/.ssh/authorized_keys2 + 
-chmod 600 ~/.ssh/authorized_keys2 + 
-cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys2 +The qsub command will pass certain environment variables in the Variable_List attribute of the jobThese variables will be available to the jobThe value for the following variables will be taken from the environment of the qsub command: 
-</code> +  * **HOME** (the path to your home directory) 
-Nowyou will get the error log and output log files for your jobs.+  * **LANG** (which language you are using) 
 +  * **LOGNAME** (the name that you logged in with) 
 +  * **PATH** (standard path to excecutables) 
 +  * **MAIL** (location of the users mail file) 
 +  * **SHELL** (command shell, i.e bash,sh,zsh,csh, ect.) 
 +  * **TZ** (time zone) 
 +These values will be assigned to a new name which is the current name prefixed with the string "PBS_O_". For examplethe job will have access to an environment variable named PBS_O_HOME which have the value of the variable HOME in the qsub command environmentIn addition to these standard environment variables, there are additional environment variables available to the job. 
 +  * **PBS_O_HOST** (the name of the host upon which the qsub command is running) 
 +  * **PBS_SERVER** (the hostname of the pbs_server which qsub submits the job to) 
 +  * **PBS_O_QUEUE** (the name of the original queue to which the job was submitted) 
 +  * **PBS_O_WORKDIR** (the absolute path of the current working directory of the qsub command) 
 +  * **PBS_ARRAYID** (each member of a job array is assigned a unique identifier) 
 +  * **PBS_ENVIRONMENT** (set to PBS_BATCH to indicate the job is a batch job, or to PBS_INTERACTIVE to indicate the job is a PBS interactive job) 
 +  * **PBS_JOBID** (the job identifier assigned to the job by the batch system) 
 +  * **PBS_JOBNAME** (the job name supplied by the user) 
 +  * **PBS_NODEFILE** (the name of the file contain the list of nodes assigned to the job) 
 +  * **PBS_QUEUE** (the name of the queue from which the job was executed from) 
 +  * **PBS_WALLTIME** (the walltime requested by the user or default walltime allotted by the scheduler) 
  
  
tutorial/torque.txt · Last modified: 2024/02/28 13:12 by mjm519