]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGLF/FORWARD/analysis2/sim/merge.sh
Files for simulation jobs
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / sim / merge.sh
diff --git a/PWGLF/FORWARD/analysis2/sim/merge.sh b/PWGLF/FORWARD/analysis2/sim/merge.sh
new file mode 100644 (file)
index 0000000..9946f75
--- /dev/null
@@ -0,0 +1,48 @@
+#!/bin/bash
+
+export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH
+cat <<EOF
+=========================================
+PATH=$PATH
+LD_LIBRARY_PATH=$LD_LIBRARY_PATH
+ROOTSYS=$ROOTSYS
+`which root`
+ALICE_ROOT=$ALICE_ROOT
+`which aliroot`
+`ulimit -a`
+`free -m`
+=========================================
+EOF
+
+which=$1
+run=$2
+dir=$3
+stage=$4
+counter=$5
+
+cat <<EOF
+Merge $which Stage $stage sub-job $counter 
+  Directory: $dir
+  Run:       $run
+EOF
+
+if test ! -f ${which}.C ; then 
+    echo "No ${which}.C found in current directory" \
+       > validation_error.message
+    exit 1
+fi 
+ARG="${which}.C($run,\"$dir\",$stage)"
+time aliroot -b -q -x $ARG
+exitcode=$?
+
+echo "======== $ARG finished with exit code: $exitcode ========"
+echo "############## memory after: ##############"
+free -m
+if [ $exitcode -ne 0 ]; then
+    echo "$ARG exited with code $exitcode" > validation_error.message
+fi
+
+exit $exitcode
+#
+# EOF
+#