BinAC/Quickstart Guide: Difference between revisions
F Bartusch (talk | contribs) No edit summary |
F Bartusch (talk | contribs) No edit summary |
||
Line 55: | Line 55: | ||
If your job creates temporary data, you can use the fast SSD with a capacity of 211 GB on the compute nodes. The temporary directory for your job is available via the $TMPDIR environment variable. |
If your job creates temporary data, you can use the fast SSD with a capacity of 211 GB on the compute nodes. The temporary directory for your job is available via the $TMPDIR environment variable. |
||
= |
= Batch System Basics = |
||
On cluster systems like BinAC you do not run your analysis by hand on the login node. |
|||
Instead, you write a script and submit it to the batch system, this is called a job. |
|||
The batch systems then tries to schedule the jobs on the available compute nodes. |
|||
== Queue/Job Basics == |
|||
⚫ | |||
The cluster consists of compute nodes with different [hardware features](https://wiki.bwhpc.de/e/BwForCluster_BinAC_Hardware_and_Architecture). |
|||
These hardware features (e.g. high-mem or GPUs) are only available when submitting the jobs to the [specific queue](https://wiki.bwhpc.de/e/Queues). |
|||
Also, each queue has different settings regarding maximal walltime. |
|||
The most recent queue settings are displayed on login as message of the day on the terminal. |
|||
⚫ | |||
<source lang="bash"> |
<source lang="bash"> |
||
Line 75: | Line 84: | ||
</source> |
</source> |
||
To check all running and queued jobs |
To check all running and queued jobs: |
||
<source lang="bash"> |
<source lang="bash"> |
||
qstat |
qstat |
||
</source> |
</source> |
||
Just your own jobs. |
Just your own jobs. |
||
<source lang="bash"> |
<source lang="bash"> |
||
qstat -u <username> |
qstat -u <username> |
||
</source> |
</source> |
||
= Interactive Jobs = |
== Interactive Jobs == |
||
Interactive jobs are a good method for testing if/how software works with your data. |
Interactive jobs are a good method for testing if/how software works with your data. |
||
Line 105: | Line 117: | ||
Be aware that we allow node sharing. Do not disturb the calculations of other users. |
Be aware that we allow node sharing. Do not disturb the calculations of other users. |
||
= Simple Script Job = |
== Simple Script Job == |
||
Use your favourite text editor to create a script calles 'script.sh'. |
Use your favourite text editor to create a script calles 'script.sh'. |
||
Line 135: | Line 147: | ||
If there is anything not working, as you like, send an email to hpcmaster@uni-tuebingen.de. |
If there is anything not working, as you like, send an email to hpcmaster@uni-tuebingen.de. |
||
⚫ | |||
= Best practices for job scripts = |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
<source lang="bash"> |
<source lang="bash"> |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
</source> |
</source> |
||
⚫ | |||
== |
== Best Practices == |
||
⚫ | |||
=== Specify memory for your job === |
|||
Often we get tickets with question like "Why did the system kill my job?". |
Often we get tickets with question like "Why did the system kill my job?". |
||
Line 171: | Line 172: | ||
If you do not know how much memory your job will need, look into the documentation of the tools you use or ask us. |
If you do not know how much memory your job will need, look into the documentation of the tools you use or ask us. |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
<source lang="bash"> |
<source lang="bash"> |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
</source> |
</source> |
||
⚫ |
Revision as of 15:28, 30 November 2020
File System Basics
The details of the file systems are explained here.
Home File System
Home directories are meant for permanent file storage of files that are keep being used like source codes, configuration files, executable programs, conda environments, etc. It is backuped daily and has a quota. If that quota is reached, you will usually experience problems when working on the cluster.
Work File System
Use the work file system and not your home directory for your calculations and data. Create a work directory, usually users use their username:
cd /beegfs/work/
mkdir <username>
cd <username>
Do not use the login nodes to carry out any calculations or heavy load file transfers.
You can share data with coworkers of your compute project my modifying file ownership and permissions on a work directory. Every compute project has its own group on BinAC, namely the project's acronym. In this example, the group for user tu_iioba01 is bw16f003.
$ id tu_iioba01
uid=900102(tu_iioba01) gid=500001(tu_tu) groups=500001(tu_tu),500002(bw16f003)
In order to share data with coworkers in the same compute project change the group owner of a directory you want to share to this acronym. You can also set the so-called SGID-Bit, then new files and and subdirectories will automatically belong to the group.
# Change ownership. This command changes the ownwership for ALL files and subdirectories.
$ chown -R <username>:<acronym> /beegfs/work/<your directory>
# Set SGID-Bit
$ chmod g+s /beegfs/work/<your directory>
Now you can set the file permissions for your coworkers in this directory as wanted by granting read, write, and execute permissions to files and subdirectories.
# Some examples
# Coworkers can read,write,delete,execute files in the directory
$ chmod 770 /beegfs/work/<your directory>
# Coworkers can read, owner still can write/delete files
$ chmod 640 /beegfs/work/<your directory>/<important_dataset>
Temporary Data
If your job creates temporary data, you can use the fast SSD with a capacity of 211 GB on the compute nodes. The temporary directory for your job is available via the $TMPDIR environment variable.
Batch System Basics
On cluster systems like BinAC you do not run your analysis by hand on the login node. Instead, you write a script and submit it to the batch system, this is called a job. The batch systems then tries to schedule the jobs on the available compute nodes.
Queue/Job Basics
The cluster consists of compute nodes with different [hardware features](https://wiki.bwhpc.de/e/BwForCluster_BinAC_Hardware_and_Architecture). These hardware features (e.g. high-mem or GPUs) are only available when submitting the jobs to the [specific queue](https://wiki.bwhpc.de/e/Queues). Also, each queue has different settings regarding maximal walltime. The most recent queue settings are displayed on login as message of the day on the terminal.
Get an overview of the number of running and queued jobs:
$ qstat -q
Queue Memory CPU Time Walltime Node Run Que Lm State
---------------- ------ -------- -------- ---- --- --- -- -----
tiny -- -- -- -- 0 0 -- E R
long -- -- -- -- 850 0 -- E R
gpu -- -- -- -- 66 0 -- E R
smp -- -- -- -- 4 1 -- E R
short -- -- -- -- 131 90 -- E R
----- -----
1051 91
To check all running and queued jobs:
qstat
Just your own jobs.
qstat -u <username>
Interactive Jobs
Interactive jobs are a good method for testing if/how software works with your data.
To start a 1 core job on a compute node providing a remote shell.
qsub -q short -l nodes=1:ppn=1 -I
The same but requesting the whole node.
qsub -q short -l nodes=1:ppn=28 -I
Standard Unix commands are directly available, for everything else use the modules.
module avail
Be aware that we allow node sharing. Do not disturb the calculations of other users.
Simple Script Job
Use your favourite text editor to create a script calles 'script.sh'.
#PBS -l nodes=1:ppn=1
#PBS -l walltime=00:05:00
#PBS -l mem=1gb
#PBS -S /bin/bash
#PBS -N Simple_Script_Job
#PBS -j oe
#PBS -o LOG
cd $PBS_O_WORKDIR
echo "my Username is:"
whoami
echo "My job is running on node:"
uname -a
Submit the job using
qsub -q tiny script.sh
Take a note of your jobID. The scheduler will reserve one core and 1 gigabyte of memory for 5 minutes on a compute node for your job. The job should be scheduled within minute if the tiny queue is empty and write your username and the execution node into the output file.
There are tons of options, details and caveats. Most of the options are explained on this page, but be aware that there are some differences on BinAC.
If there is anything not working, as you like, send an email to hpcmaster@uni-tuebingen.de.
Killing a Job
Let's assume you build a Homer and want to stop/kill/remove a running job.
qdel <jobID>
Best Practices
The scheduler will reserve computational resources (nodes, cores, gpus, memory) for a specified period for you. By following some best practices, you can avoid some common problems beforehand.
Specify memory for your job
Often we get tickets with question like "Why did the system kill my job?". Most often the user did not specify the required memory resources for the job. Then the following happens:
The job is started on a compute node, where it shares the resources other jobs. Let us assume that the other jobs on this node occupy already 100 gigabyte of memory. Now your job tries to allocate 40 gigabyte of memory. As the compute node has only 128 gigabyte, your job crashes because it cannot allocate that much memory.
You can make your life easier by specifying the required memory in your job script with:
#PBS -l mem=xxgb
Then you have the guarantee that your job can allocate xx gigabyte of memory.
If you do not know how much memory your job will need, look into the documentation of the tools you use or ask us.
Use the reserved resources
Reserved resources (nodes, cores, gpus, memory) are not available to other users and their jobs. You have the responsibility that your programs utilize the reserved resources.
An extreme example: You request a whole node (node=1:ppn=28), but your job uses just one core. The other 27 cores are idling. This is bad practice, so take care that the used programs really use the requested resources.
Another example are tools that do not benefit from a increasing number of cores. Please check the documentation of your tools and also check the feedback files that report the CPU efficiency of your job.
[...]
CPU efficiency, 0-100% | 25.00
[...]
This job for example used only 25% of the available CPU resources.