Fast disk areas¶
In this tutorial you will learn
- Which disk areas to use for I/O-intensive workloads, i.e. frequent read and write operations
Slides
This tutorial requires that you have a
user account at CSC
that is a member of a project that
has access to the Roihu service.
Perform a light-weight pre-processing of data files using fast local disk¶
You may sometimes come across situations where you have to process a large
number of smaller files, which can cause heavy input/output load on the shared
file system used in CSC's computing environment.
In order to facilitate such heavy I/O operations, CSC provides fast local
disk areas on the login and compute nodes.
-
First, log in to Roihu using SSH (or by opening a login node shell in the Roihu web interface):
-
Identify the fast local disk areas on the login nodes with the following command:
The local disk area on the login nodes is meant for light-weight
pre-processing of data and I/O-intensive tasks such as software compilation.
Actual computations should be submitted to the batch queue from the
/scratch
disk.
The local disk area on the login nodes is meant for temporary use and
cleaned often, so make sure to move important data to
/scratch or /projappl
once you do not need the fast disk anymore.
Note that a local disk is specific to a particular node, i.e. you cannot
access the local disk of
roihu-cpu-login1 from roihu-cpu-login2.
Download a tar archive containing thousands of small files and merge the files into one large file using the fast local disk¶
-
Download a tar file from the Allas object storage directly to the local disk:
-
Unpack the downloaded tar file:
-
Merge each small file into a larger one and remove all small files:
find . -name 'individual.fasta*' | xargs cat >> Merged.fasta find . -name 'individual.fasta*' | xargs rmxargsis a convenient command that takes the output from one command and uses it as an argument to another.
Move your pre-processed data to the project-specific /scratch area before analysis¶
Remember: the commands
csc-projects and csc-workspaces reveal
information about your projects.
-
Create your own folder (using the environment variable
$USER) under a project-specific directory on the/scratchdisk (or skip this step if you already created the folder in a previous tutorial): -
Move your pre-processed data from the previous step (i.e., the
Merged.fastafile) from the fast disk to/scratch: -
You have now successfully moved your data to the
/scratcharea and can start performing actual analysis using batch job scripts.
Optional: Fast local disk areas on compute nodes¶
If you intend to perform heavy computing tasks using a large number of small
files, you have to use the fast local disk areas on the compute nodes
instead of the login nodes. The compute nodes are accessed either
interactively or using
batch jobs.
On Roihu, local NVMe storage on compute nodes is available automatically
for every job, with no extra flag needed. The amount you get depends on the
partition. More information is available in
Docs CSC.
-
Move to the
/scratcharea of your project and use thesinteractivecommand to request an interactive session on a compute node for 10 minutes: -
In the interactive session, use the following command to locate the fast local storage areas on that compute node:
Note how the path to the fast local storage area contains your username and the ID of your Slurm job,
/tmp/<username>/<jobid>. -
Exit the interactive session with
exit, and then try the same in a proper batch job. Create a file calledmy_nvme.bashusing, for example, thenanotext editor: -
Copy the following batch script there and change
<project>to the CSC project you actually want to use:#!/bin/bash #SBATCH --account=<project> # Choose the billing project. Has to be defined! #SBATCH --time=00:01:00 # Maximum duration of the job. Upper limit depends on the partition. #SBATCH --partition=small # Job queues (CPU): interactive, test, small, medium, large, longrun, hugemem, hugemem_longrun #SBATCH --ntasks=1 # Number of tasks. Upper limit depends on partition. For a serial job this should be set to 1! echo $TMPDIRIt is possible to request additional local storage if the
$TMPDIRquota is not sufficient. Note however, that this currently requires allocating a full node. More information in Docs CSC. -
Submit the batch job with the command:
-
Monitor the progress of your batch job and print the contents of the output file when it has completed:
If you write important data to the local disk in your interactive session or batch job, remember to copy the data back to
/scratchbefore the job terminates! The local disk is cleaned immediately after your job, and salvaging any forgotten files is not possible afterwards.Bonus exercise
Try to repeat the first part of this tutorial using a batch job!
More information¶
- Docs CSC: Temporary local disk areas on Roihu