- Infos im HLRS Wiki sind nicht rechtsverbindlich und ohne Gewähr -
- Information contained in the HLRS Wiki is not legally binding and HLRS is not responsible for any damages that might result from its use -

CRAY XE6 Using the Batch System: Difference between revisions

From HLRS Platforms
Jump to navigationJump to search
Line 184: Line 184:


==== Jobs with mixed node features ====
==== Jobs with mixed node features ====
If your job needs some of the 64GB nodes and some of the 32GB nodes at the same time, then your job submission options looks totally different. You need to specify '''resource name''' ''nodes=<node count>:ppn=<process count per node>:mem64gb+<node count>:ppn=<proc count per node>:mem32gb'':
If your job needs some of the 64GB nodes and some of the 32GB nodes at the same time, then your job submission <font color=red>options</font> looks <font color=red>totally different</font>. <font color=red>Do not specify additional ''-l feature=<nodefeature>''!</font>
You need to specify '''resource name''' ''<font color=blue>nodes=<node count>:ppn=<process count per node>:mem64gb+<node count>:ppn=<proc count per node>:mem32gb</font>'':


   qsub -l nodes=1:ppn=16:mem64gb+64:ppn=32:mem32gb,walltime=3600 my_batchjob_script.pbs
   qsub -l nodes=1:ppn=16:mem64gb+64:ppn=32:mem32gb,walltime=3600 my_batchjob_script.pbs


Torque will allocate 65 nodes to your job for a maximum time of 3600 seconds and place 16 processes on one node with 64GB memory and 32 processes on each of the 64 allocated nodes with 32GB memory.
Torque will allocate 65 nodes to your job for a maximum time of 3600 seconds and place 16 processes on one node with 64GB memory and 32 processes on each of the 64 allocated nodes with 32GB memory.

Revision as of 13:40, 6 February 2012

The only way to start a parallel job on the compute nodes of this system is to use the batch system. The installed batch system is based on

  • the resource management system torque and
  • the scheduler moab

Additional you have to know on CRAY XE6 the user applications are always launched on the compute nodes using the application launcher, aprun, which submits applications to the Application Level Placement Scheduler (ALPS) for placement and execution.

Detailed information about how to use this system and many examples can be found in Cray Application Developer's Environment User's Guide and Workload Management and Application Placement for the Cray Linux Environment.



Writing a submission script is typically the most convenient way to submit your job to the batch system. You generally interact with the batch system in two ways: through options specified in job submission scripts (these are detailed below in the examples) and by using torque or moab commands on the login nodes. There are three key commands used to interact with torque:

  • qsub
  • qstat
  • qdel

Check the man page of torque for more advanced commands and options

 man pbs 

Submitting a Job / allocating resources

Batch Mode

Production jobs are typically run in batch mode. Batch scripts are shell scripts containing flags and commands to be interpreted by a shell and are used to run a set of commands in sequence. To submit a job, type

 qsub my_batchjob_script.pbs

This will submit your job script "my_batchjob_script.pbs" to the job-queues.

A simple MPI job submission script for the XE6 would look like:

#!/bin/bash
#PBS -N job_name
#PBS -l mppwidth=64
#PBS -l mppnppn=32
#PBS -l walltime=00:20:00             
  
# Change to the direcotry that the job was submitted from
cd $PBS_O_WORKDIR

# Launch the parallel job to the allocated compute nodes
aprun -n 64 -N 32 ./my_mpi_executable arg1 arg2 > my_output_file 2>&1

This will run your executable "my_mpi_executable" in parallel with 64 MPI processes. Torque will allocate 2 nodes to your job for a maximum time of 20 minutes and place 32 processes on each node (one per core). The batch systems allocates nodes exclusively only for one job. After the walltime limit is exceeded, the batch system will terminate your job.

Important: You have to change into a subdirectory of /mnt/lustre_server (your workspace), before calling aprun.

All torque options start with a "#PBS"-string.

You can overwrite this options on the qsub command line:

 qsub -N other_name -A myother_account -l mppwidth=64,walltime=01:00:00 my_batchjob_script.pbs

To have the same environmental settings (exported environment) of your current session in your batchjob, the qsub command needs the option argument -V:

 qsub -V my_batchjob_script.pbs

The individual options are explained in:

 man qsub

The job launcher for the XE6 parallel jobs (both MPI and OpenMP) is aprun. This needs to be started from a subdirectory of the /mnt/lustre_server (your workspace). The aprun example above will start the parallel executable "my_mpi_executable" with the arguments "arg1" and "arg2". The job will be started using 64 MPI processes with 32 processes placed on each of your allocated nodes (remember that a node consists of 32 cores in the XE6 system). You need to have nodes allocated by the batch system before (qsub). To query further options, please use

 man aprun 
 aprun -h

An example OpenMP job submission script for the XE6 nodes is shown below.

#!/bin/bash
#PBS -N job_name
# Request the number of cores that you need in total
#PBS -l mppwidth=16
#PBS -l mppnppn=16
# Request the time you need for computation
#PBS -l walltime=00:03:00

# Change to the directory that the job was submitted from
cd $PBS_O_WORKDIR

# Set the number of OpenMP threads per node
export OMP_NUM_THREADS=16

# Launch the OpenMP job to the allocated compute node
aprun -n 1 -N 1 -d $OMP_NUM_THREADS ./my_openmp_executable.x arg1 arg2 > my_output_file 2>&1

This will run your executable "my_openmp_executable" using 16 threads on one node. We set the environment variable OMP_NUM_THREADS to 16.

Interactive Mode

Interactive mode is typically used for debugging or optimizing code but not for running production code. To begin an interactive session, use the "qsub -I" command:

 qsub -I -l mppwidth=32,walltime=00:30:00

If the requested resources are available and free (in the example above: 2 nodes/32 cores, 30 minutes), then you will get a new session on the login node for your requested resources. Now you have to use the aprun command to launch your application to the allocated compute nodes. When you are finished, enter logout to exit the batch system and return to the normal command line.



Notes

  • You must use (in Interactive Mode) the "-l mppwidth=" option to specify at least one core when you start the interactive session. If you do not, your request for an interactive session will pause indefinitely.
  • Remember, you use aprun within the context of a batch session and the maximum size of the job is determined by the resources you requested when you launched the batch session. You cannot use the aprun command to use more resources than you reserved using the qsub command. Once a batch session begins, you can only use fewer resources than initially requested.
  • While your job is running (in Batch Mode), STDOUT and STDERR are written to a file or files in a system directory and the output is copied to your submission directory only after the job completes. Specifying the "qsub -j oe" option here and redirecting the output to a file (see examples above) makes it possible for you to view STDOUT and STDERR while the job is running.


Run job on other Account ID

There are Unix groups associated to the project account ID (ACID). To run a job on a non-default project budget, the groupname of this project has to be passed in the group_list:

qsub -W group_list=<groupname> ...

To get your available groups:

 id 

Usage of a Reservation

For nodes which are reserved for special groups or users, you need to specify an additional option for this reservation:

E.g. a reservation named john.1 will be used with following command:
qsub -W x=FLAGS:ADVRES:john.1 ...

Deleting a Batch Job

 qdel <jobID>
 canceljob <jobID>

This commands enables you to remove jobs from the job queue. If the job is running, qdel will abort it. You can obtain the Job ID from the output of command "qstat" or you remember the output of your qsub command of your job.

Status Information

* Status of jobs:
 qstat
 qstat -a
 showq
  • Status of Qeues:
 qstat -q
 qstat -Q
 
  • Status of job scheduling
 checkjob <jobID>
 showstart <jobID>
  • Status of backfill. This can help you to build small jobs that can be backfilled immediately while you are waiting for the resources to become available for your larger jobs
 showbf
 xtnodestat
 apstat

Note: for further details type on the login node:

 man qstat
 man apstat
 man xtnodestat
 showbf -h
 showq -h
 checkjob -h
 showstart -h

Limitations

 see the  Batch System Layout and Limits


Special Jobs / Special Nodes

32 GB nodes and 64 GB nodes

3072 nodes of total 3552 nodes are installed with 32GB memory; 480 nodes are installed with 64GB memory. If your job has not defined any node feature, then your job gets a default feature "mem32gb" which will allocate nodes with 32GB memory (see job examples above). If you want one or more of the 64GB nodes, then you have to specify the node feature "mem64gb":

 qsub -l feature=mem64gb <my_batchjob_script.pbs>

Or inside a simple script my_batchjob_script.pbs

#!/bin/bash
#PBS -N job_name
#PBS -l feature=mem64gb
#PBS -l mppwidth=64
#PBS -l mppnppn=32
#PBS -l walltime=00:20:00             
  
# Change to the direcotry that the job was submitted from
cd $PBS_O_WORKDIR

# Launch the parallel job to the allocated compute nodes
aprun -n 64 -N 32 ./my_mpi_executable arg1 arg2 > my_output_file 2>&1


Jobs with mixed node features

If your job needs some of the 64GB nodes and some of the 32GB nodes at the same time, then your job submission options looks totally different. Do not specify additional -l feature=<nodefeature>! You need to specify resource name nodes=<node count>:ppn=<process count per node>:mem64gb+<node count>:ppn=<proc count per node>:mem32gb:

 qsub -l nodes=1:ppn=16:mem64gb+64:ppn=32:mem32gb,walltime=3600 my_batchjob_script.pbs

Torque will allocate 65 nodes to your job for a maximum time of 3600 seconds and place 16 processes on one node with 64GB memory and 32 processes on each of the 64 allocated nodes with 32GB memory.