Newer
Older
#! /bin/bash
#
#SBATCH --job-name=split
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=24
#SBATCH --mem=8G
#SBATCH --partition=amd-hdr100
#SBATCH --time=02:00:00
#SBATCH --output=out/split-%A-%a.out
#SBATCH --error=out/split-%A-%a.err
#SBATCH --array=0-49
module load Anaconda3
# listcmd env var sets the command to enumerate datasets to process
# supports passing args during sbatch, e.g. listcmd="cat split-list" sbatch <thisscript>
# note: maxdeth speeds execution of find by avoiding deep dirs
listcmd=${listcmd:-find /data/rc/gpfs-policy/data -maxdepth 3 -path "*/list-policy_data-user_list-path-external_slurm-31[35]*/raw/*.gz"}
logs=($($listcmd))
log=${logs[${SLURM_ARRAY_TASK_ID}]}
# for lazy submit. only do work if there is work to do
if [ ${SLURM_ARRAY_TASK_ID} -lt ${#logs[@]} ]
then