This is an old revision of the document!


FUCHS Cluster Usage

The FUCHS is a general-purpose compute cluster based on Intel CPU architectures running Scientific Linux 7.6 and SLURM. Please read the following instructions and ensure that this guide is fully understood before using the system.

Login

An SSH client is required to connect to the cluster. On a Linux system the command is usually:

ssh <user_account>@fuchs.hhlr-gu.de

On Windows systems please use/install a Windows SSH client (e.g. PuTTY, or the Cygwin ssh package).

After your first login you will get the message, that your password has expired and you have to change it. Please use the password provided by CSC at the prompt, choose a new one and retype it. You will be logged out automatically. Now you can login with your new password and work on the cluster.

Never run heavy calculations, i.e. CPU-time-consuming processes, on the login nodes. You can check the CPU-time limit (in seconds) by running

ulimit -t

on the command line. On a login node, any process that exceeds the CPU-time limit (e.g. a long running test program or a long running rsync) will be killed automatically.

Environment Modules

There are several versions of software packages installed on our systems. The same name for an executable (e.g. mpirun) and/or library file may be used by more than one package. The environment module system, with its module command, helps to keep them apart and prevents name clashes. You can list the module-managed software by running module avail on the command line. Other important commands are module load <name> (loads a module) and module list (lists the already loaded modules). E.g. if you want to work with Intel MPI, run module load mpi/intel/2020.0

It's important to know, which modules you really need. Loading more than one MPI module at the same time will likely lead to overlapping.

If you want to know more about module commands, the module help command will give you an overview.

Compiling Software

You can compile your software on the login nodes (or on any other node, inside a job allocation). On Goethe-HLR several compiler suites are available. While GCC version 4.8.5 is the built-in OS default, you can list additional compilers and libraries by running module avail:

  • GNU compilers
  • Intel compilers
  • MPI libraries

For the right compilation commands please consider:

To compile and manage software which is not available under “module avail” we recommend Spack. Please read this small introduction on how to use Spack on the Cluster. More information is available on the Spack webpage.

Debugging

The TotalView parallel debugger is available on the Goethe-HLR cluster. Follow these steps to start a debugging session:

  1. Compile your code with your favored MPI using the debug option -g, e.g.
    mpicc -g -o mpi_prog mpi_prog.c
  2. Load the TotalView module by running
    module load debug/totalview/2019.0.4
  3. Allocate the resources you need using salloc, e.g.
    salloc -n 4 --partition=test --time=00:59:00
  4. Start a TotalView debugging session, e.g.
    totalview 
  5. Choose Debug a parallel session
  6. Choose your executable (mpi_prog), Parallel System (e.g. Intel MPI CSC or openmpi-m), number of tasks and load the session

Storage

There are various storage systems available on the cluster. In this section we describe the most relevant:

  • your home directory /home/fuchs/<group>/<user> (NFS, slow),
  • your scratch directory /scratch/fuchs/<group>/<user> (parallel file system BeeGFS, fast),
  • the non-shared local storage (i.e. only accessible from the compute node it's connected to, max. 1.4 TB, slow) under /local/$SLURM_JOB_ID on each compute node

Please use your home directory for small permanent files, e.g. source files, libraries and executables.

Use the scratch space for large temporary job data and delete the data as soon as you no longer need it, e.g. when it's older than 30 days.

By default, the space in your home directory is limited to 10 GB and in your scratch directory to 5 TB and/or 800000 inodes (which corresponds to approximately 200000+ files). You can check your homedir and scratch usage by running the quota command on a login node.

While the data in your home directory is backed up nightly (please ask, if you want us to restore anything from there), there is no backup of your scratch directory.

If you need local storage on the compute nodes, you have to add the --tmp parameter to your job script (see SLURM section below). Set the amount of storage in megabytes, e.g. set --tmp=5000 to allocate 5 GB of local disk space. The local directory (/local/$SLURM_JOB_ID) is deleted after the corresponding job has finished. If, for some reason, you don't want the data to be deleted (e.g. for debugging), you can use salloc instead of sbatch and work interactively (see man salloc). Or, one can put an rsync at the end of the job script, in order to save the local data to /scratch just before the job exits:

...
 
mkdir /scratch/fuchs/<groupid>/<userid>/$SLURM_JOBID
scontrol show hostnames $SLURM_JOB_NODELIST | xargs -i ssh {} \
    rsync -a /local/$SLURM_JOBID/ \
    /scratch/fuchs/<groupid>/<userid>/$SLURM_JOBID/{}

All shared file systems are shared between users and jobs. There is no guarantee, that you always get the desired bandwidth and/or response time.

Although our storage systems are protected by RAID mechanisms, we can't guarantee the safety of your data. It is within the responsibility of the user to backup important files.

Running Jobs With SLURM

On our systems, compute jobs and resources are managed by SLURM (Simple Linux Utility for Resource Management). The compute nodes are organized in the partition (or queue) named fuchs.

PartitionNode type
fuchs Intel Broadwell CPU

Nodes are used exclusively, i.e. only whole nodes are allocated for a job and no other job can use the same nodes concurrently.

In this document we discuss several job types and use cases. In most cases, a compute job falls under one (or more than one) of the following categories:

For every compute job you have to submit a job script (unless working interactively using salloc or srun, see man page for more information). If jobscript.sh is such a script, then a job can be enqueued by running

sbatch jobscript.sh

on a login node. A SLURM job script is a shell script which may contain SLURM directives (options), i.e. pseudo-comment lines starting with

#SBATCH ...

The SLURM options define the resources to be allocated for the job (and some other properties). Otherwise the script contains the “job logic”, i.e. commands to be executed.

Read More

The following instructions shall provide you with the basic information you need to get started with SLURM on our systems. However, the official SLURM documentation covers some more use cases (also in more detail). Please read the SLURM man pages (e.g. man sbatch or man salloc) and/or visit http://www.schedmd.com/slurmdocs. It's highly recommended.

Helpful SLURM link: SLURM FAQ

Your First Job Script

In fuchs you can allocate up to 120 nodes with two Intel Ivy Bridge CPUs with 20 cores (i.e. 40 HT threads). In the following example we allocate 60 CPU cores (i.e. three nodes) and 512 MB per core for 5 minutes (SLURM may kill the job after that time, if it's still running):

#!/bin/bash
#SBATCH --job-name=foo
#SBATCH --partition=fuchs
#SBATCH --nodes=3
#SBATCH --ntasks=60
#SBATCH --cpus-per-task=1   1)
#SBATCH --mem-per-cpu=512   
#SBATCH --time=00:05:00
#SBATCH --no-requeue        2)
#SBATCH --mail-type=FAIL    3)
#SBATCH –-extra-node-info=2:10:1   4)
 
srun hostname
sleep 3

1) For SLURM, a CPU core (a CPU thread, to be more precise) is a CPU.
2) Prevent the job from being requeued after a failure.
3) Send an e-mail if sth. goes wrong.
4) Run job without Hyper-Threading.

The srun command is responsible for the distribution of the program (hostname in our case) across the allocated resources, so that 20 instances of hostname will run on each of the allocated nodes concurrently. Please note, that this is not the only way to run or to distribute your processes. Other cases and methods are covered later in this document. In contrast, the sleep command is executed only on the head1) node.

Although nodes are allocated exclusively, you should always specify a memory value that reflects the RAM requirements of your job. The scheduler treats RAM as a consumable resource. As a consequence, if you omit the --nodes parameter (so that only the number of CPU cores is defined) and allocate more memory per core than there actually is on a node, you'll automatically get more nodes if the job doesn't fit in otherwise. Moreover, jobs are killed through SLURM's memory enforcement when using more memory than requested.

After saving the above job script as e.g. jobscript.sh, you can submit your job by running

sbatch jobscript.sh

on the command line. The job's output streams (stdout and stderr) will be joined and saved to slurm-ID.out, where ID is a SLURM job ID, which is assigned automatically. You can change this behavior by adding an --output and/or --error argument to the SLURM options.

Job Monitoring

For job monitoring (to check the current state of your jobs) you can use the squeue command. Depending on the current cluster utilization (and other factors), your job(s) may take a while to start. You can list the current queuing times by running sqtimes on the command line.

If you need to cancel a job, you can use the scancel command (please see the manpage, man scancel, for further details).

Goethe-HLR users

All users with an account at Goethe-HLR and FUCHS, have to add

#SBATCH --account=<your FUCHS group>
#SBATCH --partition=fuchs
to the job script, when they want to use the FUCHS cluster.

Node Type

On FUCHS one type of compute node is available. There are

NumberTypeVendorProcessorProcessor x Core (HT)RAM [GB]
194dual-socketIntelXeon Ivy Bridge E5-2670 v2 2×10 (2×20)128

Per-User Resource Limits

On FUCHS, you have the following limits for the partition fuchs:

LimitValueDescription
MaxTime 21 days the maximum run time for jobs
MaxJobsPU 10 max. number of jobs a user is able to run simultaneously
MaxSubmitPU 20 max. number of jobs in running or pending state
MaxNodesPU 120 max. number of nodes a user is able to use at the same time
MaxArraySize 1001 the maximum job array size

Hyper-Threading

On compute nodes you can use Hyper-Threading. That means, in addition to each physical CPU core a virtual core is available. SLURM identifies all physical and virtual cores of a node, so that you have 40 logical CPU cores on an Intel Ivy Bridge node. If you don't want to use HT, you can disable it by adding

Node typesbatch command
Ivy Bridge#SBATCH --extra-node-info=2:10:1

to your job script. Then you'll get half the threads per node (which will correspond to the number of cores). This can be beneficial in some cases (some jobs may run faster and/or more stable).

Bundling Single-Threaded Tasks

Note: Please also see the Job Arrays section below. Because only full nodes are given to you, you have to ensure, that the available resources are used efficiently. Please combine as many single-threaded jobs as possible into one. The limits for the number of combined jobs are given by the number of cores and the available memory. A simple job script to start 20 independent processes may look like this one:

#!/bin/bash
#SBATCH --partition=fuchs
#SBATCH --nodes=1
#SBATCH --ntasks=20
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=2000
#SBATCH --time=01:00:00
#SBATCH --mail-type=FAIL
 
export OMP_NUM_THREADS=1
 
#
# Replace by a for loop.
 
./program input01 >& 01.out &
./program input02 >& 02.out &
 
...
 
./program input20 >& 20.out &
# Wait for all child processes to terminate.
wait

In this (SIMD) example we assume, that there is a program (called program) which is run 20 times on 20 different inputs (usually input files). Both output streams (stdout and stderr) of each process are redirected to a file N.out. A job script is always executed on the first allocated node, so we don't need to use srun, since exactly one node is allocated. Further we assume that the executable is located in the same directory where the job was submitted (that is the initial working directory).

If the running times of your processes vary a lot, consider using the thread pool pattern. Have a look at the xargs -P command, for instance.

Job Arrays

If you have a lot of single-core computations to run, job arrays are worth a look. Telling SLURM to run a job script as a job array will result in running that script multiple times (after the corresponding resources have been allocated). Each instance will have a distinct SLURM_ARRAY_TASK_ID variable defined in its environment.

Due to our full-node policy, you still have to ensure, that your jobs don't waste any resources. Let's say, you have 400 single-core tasks. In the following example 400 tasks are run inside a job array while ensuring that only 20-core nodes are used and that each node runs exactly 20 tasks in parallel.

#!/bin/bash
#SBATCH --partition=fuchs
#SBATCH --nodes=1
#SBATCH --ntasks=20
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=2000
#SBATCH --time=00:10:00
#SBATCH --array=0-319:20
#SBATCH --mail-type=FAIL
 
my_task() {
     # Print the given "global task number" with leading zeroes
     # followed by the hostname of the executing node.
     K=$(printf "%03d" $1)
     echo "$K: $HOSTNAME"
 
     # Do nothing, just sleep for 3 seconds.
     sleep 3
}
 
#
# Every 20-task block will run on a separate node.
 
for I in $(seq 20); do
     # This is the "global task number". Since we have an array of
     # 400 tasks, J will range from 1 to 400.
     J=$(($SLURM_ARRAY_TASK_ID+$I))
 
     # Put each task into background, so that tasks are executed
     # concurrently.
     my_task $J &
 
     # Wait a little before starting the next one.
     sleep 1
done
 
# Wait for all child processes to terminate.
wait

If the task running times vary a lot, consider using the thread pool pattern. Have a look at the xargs -P command, for instance.

OpenMP Jobs

For OpenMP jobs, set the --cpus-per-task parameter. As usual, you should also specify a --mem-per-cpu value. But in this case you have to divide the total RAM required by your program by the number of threads. E.g. if your application needs 4000 MB and you want to run 20 threads, then you have to set --mem-per-cpu=200 (4000/20 = 200). Don't forget to set the OMP_NUM_THREADS environment variable. Example:

#!/bin/bash
#SBATCH --partition=fuchs
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=20
#SBATCH --mem-per-cpu=200
#SBATCH --mail-type=ALL
#SBATCH --time=48:00:00
 
export OMP_NUM_THREADS=20
./omp_program

MPI Jobs

Remember: Nodes are used exclusively. Each node has 20 CPU cores. If you want to run a lot of small jobs (i.e. where more than one job could be run on a single node concurrently), consider running more than one computation within a job (see next section). Otherwise it will most likely result in a waste of resources and will lead to a longer queueing time (for you and others).

See also: http://www.schedmd.com/slurmdocs/faq.html#steps

As an example, we want to run a program that spawns 80 Open MPI ranks and where 1200 MB of RAM are allocated for each rank.

#!/bin/bash
#SBATCH --partition=fuchs
#SBATCH --ntasks=80
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=1200
#SBATCH --mail-type=ALL
#SBATCH --extra-node-info=2:10:1
#SBATCH --time=48:00:00
 
module load mpi/XXXX/....
export OMP_NUM_THREADS=1
mpirun -n 80 ./example_program

Combining Small MPI Jobs

As mentioned earlier, running small jobs while full nodes are allocated leads to a waste of resources. In cases where you have, let's say, a lot of 10-rank MPI jobs (with similar runtimes and low memory consumption), you can start more than one computation within a single allocation (and on a single node). Open MPI example (running two MPI jobs concurrently on a 20-core node):

#!/bin/bash
#SBATCH --partition=fuchs
#SBATCH --nodes=1
#SBATCH --ntasks=20
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=2000
#SBATCH --time=48:00:00
#SBATCH --mail-type=FAIL
 
export OMP_NUM_THREADS=1
mpirun -np 10 ./program input01 >& 01.out &
# Wait a little before starting the next one.
sleep 3
mpirun -np 10 ./program input02 >& 02.out &
# Wait for all child processes to terminate.
wait

You might also need to disable core binding (please see the mpirun man page, or when using MVAPICH2, set MV2_ENABLE_AFFINITY=0). Otherwise the ranks of the second run will interfere with the first one.

Hybrid Jobs: MPI/OpenMP

MVAPICH2 example script (20 ranks, 5 threads each and 200 MB per thread, i.e. 1.2 GB per rank; so, for 20*5 threads, you'll get five 20-core nodes):

#!/bin/bash
#SBATCH --partition=fuchs
#SBATCH --ntasks=40
#SBATCH --cpus-per-task=5
#SBATCH --mem-per-cpu=200
#SBATCH --mail-type=ALL
#SBATCH --extra-node-info=2:10:1
#SBATCH --time=48:00:00
 
export OMP_NUM_THREADS=5
export MV2_ENABLE_AFFINITY=0
mpirun -np 20 ./example_program

Please note, that this is just an example. You may or may not run it as-it-is with your software, which is likely to have a different scalability.

You have to disable the core affinity when running hybrid jobs with MVAPICH2. Otherwise all threads of an MPI rank will be pinned to the same core. Our example now includes the command

export MV2_ENABLE_AFFINITY=0

which disables this feature. The OS scheduler is now responsible for the placement of the threads during the runtime of the program. But the OS scheduler can dynamically change the thread placement during the runtime of the program. This leads to cache invalidation, which degrades performance. This can be prevented by thread pinning.

Local Storage

On each node there is up to 1.4 TB of local disk space (see also Storage). If you need local storage, you have to add the --tmp parameter to your SLURM script. Set the amount of storage in megabytes, e.g. set --tmp=5000 to allocate 5 GB of local disk space. The data in the local directory (/local/$SLURM_JOB_ID) is deleted after the corresponding batch job has finished.

The salloc Command

For interactive workflows you can use SLURM's salloc command. With salloc almost the same options can be used as with sbatch, e.g.:

[user@loginnode ~]$ salloc --nodes=4 --time=0:45:00 --mem=100g --partition=test
salloc: Granted job allocation 197553
salloc: Waiting for resource configuration
salloc: Nodes node45-[002-005] are ready for job
[user@loginnode ~]$ 

Now you can ssh into the nodes that were allocated for the job and run further commands, e.g.:

[user@loginnode ~]$ ssh node45-002
[user@node45-002 ~]$ hostname
node45-002.cm.cluster
[user@node45-002 ~]$ logout
Connection to node45-002 closed.
...
[user@loginnode ~]$ ssh node45-003
[user@node45-003 ~]$ hostname
node45-003.cm.cluster
[user@node45-003 ~]$ logout
Connection to node45-003 closed.
...
[user@loginnode ~]$ ssh node45-005
[user@node45-005 ~]$ hostname
node45-005.cm.cluster
[user@node45-005 ~]$ logout
Connection to node45-005 closed.

Or you can use srun for running a command on all allocated nodes in parallel:

[user@loginnode ~]$ srun hostname
node45-002.cm.cluster
node45-003.cm.cluster
node45-005.cm.cluster
node45-004.cm.cluster
[user@loginnode ~]$

Finally you can terminate your interactive job session by running exit, which will free the allocated nodes:

[user@loginnode ~]$ exit
salloc: Relinquishing job allocation 197553
[user@loginnode ~]$ 

1)
the first one of the three allocated nodes
public/usage/fuchs.1590144439.txt.gz · Last modified: 2020/05/22 12:47 by jankowiak
CC Attribution-Noncommercial-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0