#!/bin/bash # #SBATCH --job-name=mesmer_m #SBATCH --ntasks=1 #SBATCH --cpus-per-task=64 #SBATCH --time=24:00:00 #SBATCH --mail-user=lilian.schuster@uibk.ac.at #SBATCH --qos=normal # Abort whenever a single step fails. Without this, bash will just continue on errors. set -e # Current RGI region OGGM_GLACIER_JOB=$SLURM_ARRAY_TASK_ID export OGGM_GLACIER_JOB echo "OGGM_GLACIER_JOB number : $OGGM_GLACIER_JOB" # On every node, when slurm starts a job, it will make sure the directory # /work/username exists and is writable by the jobs user. # We create a sub-directory there for this job to store its runtime data at. OGGM_WORKDIR="/work/$SLURM_JOB_USER/$SLURM_JOB_ID/wd" mkdir -p "$OGGM_WORKDIR" export OGGM_WORKDIR echo "Workdir for this run: $OGGM_WORKDIR" # Use the local data download cache export OGGM_DOWNLOAD_CACHE=/home/data/download export OGGM_DOWNLOAD_CACHE_RO=1 export OGGM_EXTRACT_DIR="/work/$SLURM_JOB_USER/$SLURM_JOB_ID/oggm_tmp" export OGGM_USE_MULTIPROCESSING=1 # Try to make mp better # export OGGM_USE_MP_SPAWN=1 # Link www fmaussion data here to avoid useless downloads mkdir -p "$OGGM_WORKDIR/cache/cluster.klima.uni-bremen.de" ln -s /home/www/fmaussion "$OGGM_WORKDIR/cache/cluster.klima.uni-bremen.de/~fmaussion" ln -s /home/www/lschuster "$OGGM_WORKDIR/cache/cluster.klima.uni-bremen.de/~lschuster" # Add other useful defaults export LRU_MAXSIZE=1000 OGGM_OUTDIR="/work/$SLURM_JOB_USER/$SLURM_JOB_ID/out" export OGGM_OUTDIR echo "Output dir for this run: $OGGM_OUTDIR" # All commands in the EOF block run inside of the container # Adjust container version to your needs, they are guaranteed to never change after their respective day has passed. srun -n 1 -c "${SLURM_JOB_CPUS_PER_NODE}" singularity exec /home/users/lschuster/images/oggm_20230222.sif bash -s < see: https://github.com/OGGM/oggm/commit/7665516f3f15a6fdec0aab1d3fe180fef99dfae8 pip install --no-deps "git+https://github.com/OGGM/oggm.git@7665516f3f15a6fdec0aab1d3fe180fef99dfae8" # Increase number of allowed open file descriptors ulimit -n 65000 # Finally, the run python run_with_hydro_mesmer_m.py $1 $2 EOF # Write out echo "Copying files..." # note that we moved and restructed the files from output to https://cluster.klima.uni-bremen.de/~oggm/oggm-standard-projections/oggm_v16/2023.3/ # this gives sometime some strange error # rsync -avzh "$OGGM_OUTDIR/" output rsync -avz --no-perms --no-owner --no-group "$OGGM_OUTDIR/" output # Print a final message so you can actually see it being done in the output log. echo "SLURM DONE"