#!/bin/bash
# Invoke this as e.g. sbatch --time=5:00:00 --exclusive -N 5 --ntasks-per-node 2 -c 1 masterJob.sh clmp CC-MAIN-2019-35 cdx_tab1
# run clm.py in parallel 
n=$SLURM_NTASKS
c=$SLURM_CPUS_PER_TASK
nodename=$SLURMD_NODENAME
local=$SLURM_LOCALID
node=$SLURM_NODEID
echo $(date) $nodename:$node start

type parallel
#module load gnu-parallel

export PYTHONPATH=$PYTHONPATH:$HOME/lib/python
parallel --will-cite -j $c doCLM.sh "$1" '{}' < $2/$node.txt

echo $(date) $nodename:$node end
