Data Management: Difference between revisions

From SciNet Users Documentation
Jump to navigation Jump to search
No edit summary
No edit summary
Line 2: Line 2:


=Performance=
=Performance=
The file systems on SciNet, with the exception of archive, are [http://en.wikipedia.org/wiki/IBM_General_Parallel_File_System GPFS], a high-performance file system which provides rapid reads and writes to large datasets in parallel from many nodes.  As a consequence of this design, however, '''the file system performs quite ''poorly'' at accessing data sets which consist of many, small files.'''  For instance, you will find that reading data in from one 16MB file is enormously faster than from 400 40KB files. Such small files are also quite wasteful of space, as the [https://en.wikipedia.org/wiki/Block_(data_storage) blocksize] for the scratch and project filesystems is 16MB. This is something you should keep in mind when planning your input/output strategy for runs on SciNet.
With the exception of archive, the SciNet file systems use [http://en.wikipedia.org/wiki/IBM_General_Parallel_File_System GPFS], a high-performance file system that provides rapid reads and writes to large datasets in parallel from many nodes.  As a consequence of this design, however, '''the file system performs quite ''poorly'' at accessing data sets that consist of many, small files.'''  For instance, you will find that reading data in from one 16MB file is enormously faster than from 400 40KB files. Such small files are also quite wasteful of space, as the [https://en.wikipedia.org/wiki/Block_(data_storage) blocksize] for the scratch and project filesystems is 16MB. This is something you should keep in mind when planning your input/output strategy for runs on SciNet.


For instance, if you run multi-process jobs, having each process write to a file of its own is not an scalable I/O solution. A directory gets locked by the first process accessing it, so all other processes have to wait for it. Not only has the code just become considerably less parallel, chances are the file system will have a time-out while waiting for your other processes, leading your program to crash mysteriously.
For instance, if you run multi-process jobs, having each process write to its own file is not an scalable I/O solution. The directory is locked by the first process that accesses it, so the other processes must wait. The code becomes considerably less parallel, and the file system may time out while waiting, causing your program to fail mysteriously. Consider using MPI-IO (part of the MPI-2 standard), which allows files to be opened simultaneously by different processes, or using a dedicated process for I/O to which all other processes send their data, and which subsequently writes this data to a single file.
Consider using MPI-IO (part of the MPI-2 standard), which allows files to be opened simultaneously by different processes, or using a dedicated process for I/O to which all other processes send their data, and which subsequently writes this data to a single file.


= Purpose of each file system =
= Purpose of each file system =
Line 12: Line 11:


== /home ($HOME) ==
== /home ($HOME) ==
/home is intended primarily for individual user files, common software or small datasets used by others in the same group, provided it does not exceed individual quotas. Otherwise you may consider /scratch or /project. /home is read-only on the compute nodes and has daily backups.
/home is intended for individual user files, and for common software or small datasets shared within a group, provided the quota is respected. Otherwise you may consider /scratch or /project. /home is read-only on the compute nodes and has daily backups.


== /scratch ($SCRATCH) ==
== /scratch ($SCRATCH) ==
/scratch is to be used primarily for temporary or transient files, checkpoint dumps, for all the results of your computations and simulations, or any material that can be easily recreated or reacquired. You may use scratch as well for any intermediate step in your workflow, provided it does not induce too much I/O (Input/Output) or too many small files on this disk-based storage pool, otherwise you should consider burst buffer (/bb). Once you have your final results, those that you want to keep for the long term, you may migrate them to /project or /archive. /scratch has no backups.  There is currently no automatic purging policy on Trillium, but scratch is not a long-term storage location.
/scratch is to be used primarily for temporary or transient files, checkpoint dumps, for all the results of your computations and simulations, or any material that can be easily recreated or reacquired. You may use scratch as well for any intermediate step in your workflow, provided it does not create too much I/O (input/output) or too many small files on this disk-based storage pool, otherwise you should consider burst buffer (/bb). Once you have your final results, those that you want to keep for the long term, you may migrate them to /project or /archive. /scratch has no backups.  There is currently no automatic purging policy on Trillium, but scratch is not a long-term storage location.


== /project ($PROJECT) ==
== /project ($PROJECT) ==
Line 27: Line 26:


== $SLURM_TMPDIR (RAM) ==
== $SLURM_TMPDIR (RAM) ==
For consistency with the general purpose Alliance clusters (Nibi, Fir, Rorqual and Narval), the environment variable $SLURM_TMPDIR will be set on Trillium compute jobs.  Note that this variable will point to RAMdisk, not to local hard drives. The $SLURM_TMPDIR directory will be empty when your jobs starts and its content gets deleted after the job has finished.  
For consistency with the general purpose Alliance clusters (Nibi, Fir, Rorqual and Narval), the environment variable $SLURM_TMPDIR will be set on Trillium compute jobs.  Note that this variable will point to RAMdisk, not to local hard drives. The $SLURM_TMPDIR directory is empty when your job starts, and its contents are deleted when the job finishes.  


Note that Trillium and Balam compute nodes have no local disks, so <tt>$SLURM_TMPDIR</tt> lives in memory (ramdisk), in contrast to the general purpose systems of the {{Alliance}}, i.e., Fir, Nibi, Rorqual and Narval, where this variable points to a directory on a node-local SSD disk.
Note that Trillium and Balam compute nodes have no local disks, so <tt>$SLURM_TMPDIR</tt> lives in memory (ramdisk), in contrast to the general purpose systems of the {{Alliance}}, i.e., Fir, Nibi, Rorqual and Narval, where this variable points to a directory on a node-local SSD disk.


= Quotas and purging =
= Quotas =


You should familiarize yourself with the [[Data_Management#Purpose_of_each_file_system | various file systems]], what purpose they serve, and how to properly use them.  This table summarizes the various file systems.
You should understand what each file system is for and how to use it properly.  The table below summarizes them.  


{| class="wikitable"
{| class="wikitable"
Line 110: Line 109:
== How much Disk Space Do I have left? ==
== How much Disk Space Do I have left? ==


The <tt>'''diskusage_report'''</tt> command, available on the Trillium login nodes and datamovers, provides information in a number of ways on the home, scratch, project and archive file systems. For instance, how much disk space is being used by yourself and your group (with the -a option), or how much your usage has changed over a certain period ("delta information") or you may generate plots of your usage over time. Please see the usage help below for more details.
The <code>diskusage_report</code> command, available on the Trillium login nodes and datamovers, reports how much space and how many files you are using on the home, scratch, project, and archive file systems. It can also report your group's usage, show how your usage has changed over a period, and plot your usage over time. See the [https://docs.alliancecan.ca/wiki/Storage_and_file_management Alliance storage page] for an example of its output.
<pre>
Usage: diskUsage [-h|-?| [-a] [-u <user>]
      -h|-?: help
      -a: list usages of all members on the group
      -u <user>: as another user on your group
</pre>
 
Note: information on usage and quota is only updated every 3 hours!


== Scratch purging ==
== Scratch purging ==
Line 126: Line 117:


= Handling large collections of files =
= Handling large collections of files =
There are a number of situations in which dealing with a format that encapsulates and compacts very large numbers of small files may be more performant and convenient than handling those small files in expanded format directly in the file system. These alternative file formats also save a lot of stress on the backup system, since tape is not designed to deal with a lot of small files. It also help you not hit your inodes quota on the file systems.
There are a number of situations in which dealing with a format that encapsulates and compacts very large numbers of small files may be more performant and convenient than handling those small files in expanded format directly in the file system. These alternative file formats also save a lot of stress on the backup system, since tape is not designed to deal with a lot of small files. It also helps you avoid reaching your inode quota.


Please visit this page for more details:
Please visit this page for more details:
Line 133: Line 124:


= Backup Policy =
= Backup Policy =
Our backup is based on versions, not on date or age:
Our backups are version-based, not date-based:


* In general we keep the 2 most recent versions of a file, one per day, provided it exists on the file system. Once a file is deleted we expire the oldest version from the backup, and keep the most recent for 60 days. After that grace period then that only version is expired as well.
* In general we keep the 2 most recent versions of a file, one per day, provided it exists on the file system. Once a file is deleted we expire the oldest version from the backup, and keep the most recent for 60 days. After that grace period then that only version is expired as well.
Line 163: Line 154:
* If you do this often, consider using [https://docs.alliancecan.ca/wiki/Globus Globus], a web-based tool for data transfer.
* If you do this often, consider using [https://docs.alliancecan.ca/wiki/Globus Globus], a web-based tool for data transfer.


Note that you can only connect 4 times in a 2-minute window to the login nodes or the datamover nodes. So bundle your transfers, i.e., specify multiple files to be copied as arguments to scp or rsync, or copy whole directories, or zip/tar the files up and unzip/untar them on the other end.
You can make at most 4 connections in a 2-minute window to the login or datamover nodes, so bundle your transfers: pass several files to scp or rsync, copy whole directories, or create a tar archive, transfer it, and extract it at the other end.


If you want to transfer smaller files between other Digital Research Alliance Canada clusters and Trillium use the SSH agent forwarding flag, <code>-A</code> when logging into another cluster. For example, to copy files to Trillium from Nibi use:
To transfer smaller files between Trillium and other Digital Research Alliance of Canada clusters, use the SSH agent forwarding flag <code>-A</code> when logging in to the other cluster. For example, to copy files to Trillium from Nibi use:


<pre>
<pre>
Line 185: Line 176:
* Storage space on HPSS is allocated through the annual [https://alliancecan.ca/en/services/advanced-research-computing/accessing-resources/resource-allocation-competition Resource Allocation Competition (RAC) administered by the Digital Research Alliance of Canada].
* Storage space on HPSS is allocated through the annual [https://alliancecan.ca/en/services/advanced-research-computing/accessing-resources/resource-allocation-competition Resource Allocation Competition (RAC) administered by the Digital Research Alliance of Canada].


=File/Ownership Management (ACL)=
= File/Ownership management (ACL) =
* By default, at SciNet, users within the same group already have read permission to each other's files (not write)
* By default, at SciNet, users within the same group already have read permission to each other's files (not write)
* You may use access control list ('''ACL''') to allow your supervisor (or another user within your group) to manage files for you (i.e., create, move, rename, delete), while still retaining your access and permission as the original owner of the files/directories. You may also let users in other groups or whole other groups access (read, execute) your files using this same mechanism.
* You may use access control list ('''ACL''') to allow your supervisor (or another user within your group) to manage files for you (i.e., create, move, rename, delete), while still retaining your access and permission as the original owner of the files/directories. You may also let users in other groups or whole other groups access (read, execute) your files using this same mechanism.

Revision as of 20:31, 6 November 2026

Understanding the various file systems, and how to use them properly, is critical to optimizing your workflow and being a good SciNet citizen. This page describes the various Trillium file systems, and how to properly use them.

Performance

With the exception of archive, the SciNet file systems use GPFS, a high-performance file system that provides rapid reads and writes to large datasets in parallel from many nodes. As a consequence of this design, however, the file system performs quite poorly at accessing data sets that consist of many, small files. For instance, you will find that reading data in from one 16MB file is enormously faster than from 400 40KB files. Such small files are also quite wasteful of space, as the blocksize for the scratch and project filesystems is 16MB. This is something you should keep in mind when planning your input/output strategy for runs on SciNet.

For instance, if you run multi-process jobs, having each process write to its own file is not an scalable I/O solution. The directory is locked by the first process that accesses it, so the other processes must wait. The code becomes considerably less parallel, and the file system may time out while waiting, causing your program to fail mysteriously. Consider using MPI-IO (part of the MPI-2 standard), which allows files to be opened simultaneously by different processes, or using a dedicated process for I/O to which all other processes send their data, and which subsequently writes this data to a single file.

Purpose of each file system

Trillium and Balam access several different file systems. Note that not all of these file systems are available to all users.

/home ($HOME)

/home is intended for individual user files, and for common software or small datasets shared within a group, provided the quota is respected. Otherwise you may consider /scratch or /project. /home is read-only on the compute nodes and has daily backups.

/scratch ($SCRATCH)

/scratch is to be used primarily for temporary or transient files, checkpoint dumps, for all the results of your computations and simulations, or any material that can be easily recreated or reacquired. You may use scratch as well for any intermediate step in your workflow, provided it does not create too much I/O (input/output) or too many small files on this disk-based storage pool, otherwise you should consider burst buffer (/bb). Once you have your final results, those that you want to keep for the long term, you may migrate them to /project or /archive. /scratch has no backups. There is currently no automatic purging policy on Trillium, but scratch is not a long-term storage location.

/project ($PROJECT)

/project is available to groups whose PIs have a storage allocation, and is intended for common group software, large static datasets, or any material very costly to be reacquired or re-generated by the group, associated with jobs currently running on Trillium or Balam. Material on /project is expected to remain relatively immutable over time. You should think of $PROJECT as if it was $STATIC. Temporary or transient files should be kept on scratch, not project. High data turnover induces stress and unnecessary consumption of tapes on the TSM backup system, long after this material has been deleted, due to backup retention policies and the extra versions kept of the same file. Even renaming top directories is enough to trick the system into assuming a completely new directory tree has been created, and the old one deleted, hence think carefully about your naming convention ahead of time, and stick with it. Users abusing the project file system and using it as scratch will be flagged and contacted. Note that /project is only available to groups with RAC allocation.

/archive ($ARCHIVE)

/archive is available to groups whose PIs have a storage allocation, and on Trillium and Balam it is the 'nearline' storage pool. It's used if you want to temporarily offload semi-active material from any of the above file systems. In practice users will offload/recall material as part of their regular workflow, or when they hit their quotas on scratch or project. That material can remain on HPSS for a few months to a few years. Note that /archive is only available to groups with RAC allocation.

/dev/shm (RAM)

On the Trillium and Balam nodes ramdisk is available. Ramdisk is much faster than real disk, and faster than Burst Buffer. Up to 70 percent of the RAM on the node (i.e. 202GB) may be used as a temporary local file system. This is particularly useful in the early stages of migrating desktop-computing codes to an HPC platform, especially those that use a lot of file I/O (Input/Output). Using a lot of I/O is a bottleneck in large scale computing, especially on parallel file systems, since the files are synchronized across the whole network.

$SLURM_TMPDIR (RAM)

For consistency with the general purpose Alliance clusters (Nibi, Fir, Rorqual and Narval), the environment variable $SLURM_TMPDIR will be set on Trillium compute jobs. Note that this variable will point to RAMdisk, not to local hard drives. The $SLURM_TMPDIR directory is empty when your job starts, and its contents are deleted when the job finishes.

Note that Trillium and Balam compute nodes have no local disks, so $SLURM_TMPDIR lives in memory (ramdisk), in contrast to the general purpose systems of the Alliance (formerly Compute Canada), i.e., Fir, Nibi, Rorqual and Narval, where this variable points to a directory on a node-local SSD disk.

Quotas

You should understand what each file system is for and how to use it properly. The table below summarizes them.

location quota block size expiration time backed up on login nodes on compute nodes
$HOME 100 GB / 250,000 files per user 1 MB yes yes read-only
$SCRATCH 25 TB / 6,000,000 files per user provided group quota is not reached 16 MB none at present no yes yes
groups of up to 4 users 50TB for the group
groups of up to 11 users 125TB for the group
groups of up to 28 users 250TB for the group
groups of up to 60 users 400TB for the group
groups with over 60 users 500TB for the group
$PROJECT by group allocation 16 MB yes yes yes
$ARCHIVE by group allocation dual-copy no no
$BBUFFER 10 TB per user 1 MB very short no yes yes

How much Disk Space Do I have left?

The diskusage_report command, available on the Trillium login nodes and datamovers, reports how much space and how many files you are using on the home, scratch, project, and archive file systems. It can also report your group's usage, show how your usage has changed over a period, and plot your usage over time. See the Alliance storage page for an example of its output.

Scratch purging

There is currently no automatic purging policy for /scratch on Trillium. Scratch is still not a long-term storage location and has no backups: move anything you need to keep to /project or /archive. A purging policy may be introduced in the future; this page will be updated if that happens.


Handling large collections of files

There are a number of situations in which dealing with a format that encapsulates and compacts very large numbers of small files may be more performant and convenient than handling those small files in expanded format directly in the file system. These alternative file formats also save a lot of stress on the backup system, since tape is not designed to deal with a lot of small files. It also helps you avoid reaching your inode quota.

Please visit this page for more details:

https://docs.alliancecan.ca/wiki/Handling_large_collections_of_files

Backup Policy

Our backups are version-based, not date-based:

  • In general we keep the 2 most recent versions of a file, one per day, provided it exists on the file system. Once a file is deleted we expire the oldest version from the backup, and keep the most recent for 60 days. After that grace period then that only version is expired as well.
  • We may have 1 or 2 versions of a file on the backup for over 10 years, provided the original has never been deleted from the file system.
  • On the other hand we may not have any backup, if the user created the file in the morning and deleted in the afternoon, since the backup system never had a chance to capture the file (it runs once a day around midnight).
  • And the user may have generated several versions of a file during the day, however only the most recent version before the backup runs will be captured for that day.

Moving data

Data for analysis and final results need to be moved to and from Trillium and Balam. There are several ways to accomplish this.

Using rsync/scp

Move amounts less than 10GB through the login nodes.

  • Login nodes and datamovers are visible from outside SciNet.
  • Use scp or rsync to trillium.scinet.utoronto.ca or trillium.alliancecan.ca (no difference).
  • This will time out for amounts larger than about 10GB.

Move amounts larger than 10GB through the datamover nodes.

  • From a login node, ssh to tri-dm{1,2,3,4}. From there you can transfer to or from the cluster.
  • Alternatively, you may also login/scp/rsync directly to the datamovers from the outside:
 tri-dm1.scinet.utoronto.ca
 tri-dm2.scinet.utoronto.ca
 tri-dm3.scinet.utoronto.ca
 tri-dm4.scinet.utoronto.ca
  • If you do this often, consider using Globus, a web-based tool for data transfer.

You can make at most 4 connections in a 2-minute window to the login or datamover nodes, so bundle your transfers: pass several files to scp or rsync, copy whole directories, or create a tar archive, transfer it, and extract it at the other end.

To transfer smaller files between Trillium and other Digital Research Alliance of Canada clusters, use the SSH agent forwarding flag -A when logging in to the other cluster. For example, to copy files to Trillium from Nibi use:

ssh -A USERNAME@nibi.alliancecan.ca

then perform the copy:

[USERNAME@l1.nibi ~]$ scp file USERNAME@trillium.alliancecan.ca:/scratch/USERNAME/

Using Globus

Please check the comprehensive documentation here, and here.

The Trillium endpoint is "alliancecan#trillium".

Moving data to HPSS/Archive/Nearline

HPSS is for long-term storage of data.

File/Ownership management (ACL)

  • By default, at SciNet, users within the same group already have read permission to each other's files (not write)
  • You may use access control list (ACL) to allow your supervisor (or another user within your group) to manage files for you (i.e., create, move, rename, delete), while still retaining your access and permission as the original owner of the files/directories. You may also let users in other groups or whole other groups access (read, execute) your files using this same mechanism.