Skip to content

SubatomicPhysics/Data Management

SubatomicPhysics

Optimizing ROOT and Event I/O

Subatomic physics workflows frequently perform random-access reads or high-frequency writes across large numbers of ROOT files (.root) or Monte Carlo event datasets. Shared parallel filesystems (/home, /project, /scratch) are optimized for large, sequential I/O rather than thousands of small random reads.

Use $SLURM_TMPDIR for Active Job I/O

Whenever your input files fit within the local node storage allocation, stage them to $SLURM_TMPDIR (fast local NVMe/SSD storage on the compute node) before running your analysis or reconstruction executable:

#!/bin/bash
#SBATCH --time=04:00:00
#SBATCH --mem=8G
#SBATCH --cpus-per-task=4

# 1. Stage input ROOT files to node-local storage
cp /project/def-group/username/inputs/*.root $SLURM_TMPDIR/

# 2. Run analysis inside Apptainer reading/writing in $SLURM_TMPDIR
apptainer exec --bind /cvmfs,$SLURM_TMPDIR /cvmfs/unpacked.cern.ch/... \
    root -l -b -q "myAnalysis.C(\"$SLURM_TMPDIR/input.root\", \"$SLURM_TMPDIR/output.root\")"

# 3. Copy final output back to /scratch or /project
cp $SLURM_TMPDIR/output.root /scratch/$USER/results/

See Storage and file management for cluster-specific details on local scratch capacities.

Managing File Counts and Quotas

Alliance filesystems enforce strict quotas on both total storage volume and total file/inode counts (see Filesystem quotas and policies).

  • Merge Small ROOT Files: Use ROOT's hadd utility to merge small output ntuples or histograms from parallel array jobs into larger consolidated files before storing them long-term in /project.
  • Archive Raw Text/Log Outputs: Bundle job logs, configuration cards, or small text outputs into .tar.gz archives. See Handling large collections of files.
  • Scratch Purging: Remember that /scratch is subject to an automated purging policy (see Scratch purging policy). Move valuable datasets to /project or external collaboration storage.

Large-Scale Data Transfers

  • Globus: For high-speed, reliable transfers between institutional servers, TRIUMF/SNOLAB storage, and Alliance clusters, use Globus.
  • Grid Tools (Rucio / XRootD / Gfal): When transferring data to or from WLCG/OSG storage elements, run Rucio or XRootD clients inside an Apptainer container with your grid proxy certificate (X509_USER_PROXY) bound into the container environment.