#!/bin/zsh
#
#(otherwise the default shell would be used)
#$ -S /bin/zsh
#
#(the cpu time for this job, less than 30min to start quickly)
#$ -l h_cpu=30:00:00
#
#(the maximum memory usage of this job)
#$ -l h_rss=20G
#$ -l tmpdir_size=4
#
#(stderr and stdout are merged together to stdout)
#$ -j y
#(send mail on job's begin, end and abort bea) bea
#$  
#
#execute job from current directory and not relative to your home directory
##$ -cwd
#
# send output files to the trash, COMMENT TO SEE THE OUTPUT AND DEBUG
#$ -o /lustre/fs22/group/radio/plaisier/direction_paper/logs
#

#
source /afs/ifh.de/group/radio/software/anaconda_p3/etc/profile.d/conda.sh

export PATH=/afs/ifh.de/group/radio/software/anaconda_p3/bin:$PATH
#export ROOTSYS=/afs/ifh.de/group/radio/software/root5.34.36/compile
export LIBRARY_PATH=/afs/ifh.de/group/radio/software/anaconda_p3/lib:$LIBRARY_PATH
export LD_LIBRARY_PATH=/afs/ifh.de/group/radio/software/anaconda_p3/lib:$LD_LIBRARY_PATH
export ROOTSYS=/afs/ifh.de/group/radio/software/root5.34.36/compile
export PATH=$ROOTSYS/bin:$PATH
export PYTHONPATH=$ROOTSYS/lib:$PYTHONPATH
#export LIBRARY_PATH=/afs/ifh.de/group/radio/software/anaconda5.3/lib:$LIBRARY_PATH
#export LD_LIBRARY_PATH=/afs/ifh.de/group/radio/software/anaconda5.3/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$ROOTSYS/lib:$LD_LIBRARY_PATH
export SNS=/afs/ifh.de/group/radio/software/snowshovel/trunk
export LD_LIBRARY_PATH=$SNS/lib:$LD_LIBRARY_PATH
export PYTHONPATH=${SNS}/lib:$PYTHONPATH
export PYTHONPATH=$SNS:$PYTHONPATH
export PYTHONPATH=/lustre/fs22/group/radio/plaisier/software/NuRadioReco:$PYTHONPATH
export PYTHONPATH=/lustre/fs22/group/radio/plaisier/software/NuRadioMC:$PYTHONPATH
export PYTHONPATH=/afs/ifh.de/group/radio/software/astrotools:$PYTHONPATH
export PYTHONPATH=/afs/ifh.de/group/radio/software/radiotools:$PYTHONPATH
export PYTHONPATH=/lustre/fs22/group/radio/plaisier/software/nuRadioPropa/RadioPropa/radiopropa/build:$PYTHONPATH
INPUTFILENAME=$1



echo "tmpdir is: "
echo $TMPDIR
cd $TMPDIR
python /lustre/fs22/group/radio/plaisier/direction_paper/event_pre_sim_gen2.py $INPUTFILENAME
#cp -r $TMPDIR/$OUTPUT_FILE_NAME /lustre/fs22/group/radio/plaisier/software/simulations 
