"README.md" did not exist on "7e9c656727830ce19192b34997ce26353c149c62"
Newer
Older
#!/bin/bash
# set paths to use
nb_path=$1
python_path=$2
notebook=$4
detector=$5
caltype=$6
final=$7
finalize=$8
cluster_cores=$9
echo "Running with the following parameters:"
echo "Notebook path: $nb_path"
echo "Python path: $python_path"
echo "IP-Cluster profile: $ipcluster_profile"
echo "notebook: $notebook"
echo "detector: $detector"
echo "caltype: $caltype"
echo "final: $final"
echo "finalize: $finalize"
echo "cluster_cores: $cluster_cores"
echo "job ID: $SLURM_JOB_ID"
source /etc/profile.d/modules.sh
module load anaconda/3
echo "Starting influx feeder"
./cal_influx_feeder.sh $notebook $detector $caltype > /dev/null 2>&1 &
# make sure we use agg backend
export MPLBACKEND=AGG
# start an ip cluster if requested
${python_path} -m IPython profile create ${ipcluster_profile} --parallel
${python_path} -m ipyparallel.cluster start --n=${cluster_cores} --profile=${ipcluster_profile} --daemonize &
echo "Running notebook"
${python_path} -m princess ${nb_path} --save --on-error-resume-next
${python_path} -m nbconvert --to rst --TemplateExporter.exclude_input=True ${nb_path}
${python_path} -m ipyparallel.cluster stop --profile=${ipcluster_profile}
profile_path=$(${python_path} -m IPython locate profile ${ipcluster_profile})
echo "Removing cluster profile from: $profile_path"
rm -rf $profile_path
fi