#!/bin/bash
# Invoke this as e.g. sbatch -n 30 -c 10 masterJob.sh cdx_segment
# run cdx_segment.py in parallel 
n=$SLURM_NTASKS
c=$SLURM_CPUS_PER_TASK
node=$SLURMD_NODENAME
local=$SLURM_LOCALID
proc=$SLURM_PROCID
echo $(date) $node:$proc start

module load gnu-parallel

PYTHONPATH=$PYTHONPATH:$HOME/lib/python
parallel --will-cite -j $c lib/python/cdx_segment.py 2019-35 15 '{}' < cdx_segment/$proc.txt

echo $(date) $proc end

