From: David Sarrut Date: Wed, 26 Jul 2017 06:13:15 +0000 (+0200) Subject: Merge branch 'master' of git.creatis.insa-lyon.fr:clitk X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=01ea93b48bce2e9e9a27c487e1b097a4d9f37547;hp=60850f3574637676931f327adee41d29f94bc067;p=clitk.git Merge branch 'master' of git.creatis.insa-lyon.fr:clitk --- diff --git a/cluster_tools/gate_job_cluster.job b/cluster_tools/gate_job_cluster.job index 9401268..be749e5 100644 --- a/cluster_tools/gate_job_cluster.job +++ b/cluster_tools/gate_job_cluster.job @@ -40,7 +40,13 @@ echo "PARAM=${PARAM}" if test "$RELEASEDIR" = "NONE" then echo Using $(which Gate) - ldd $(which Gate) + unamestr=`uname` + if [[ "$unamestr" != 'Darwin' ]]; then + ldd $(which Gate) + else + ## ldd "equivalent" on osx is otool + otool -L $(which Gate) + fi else test -d "${RELEASEDIR}" || error "can't find release" md5sum ${RELEASEDIR}/Gate @@ -64,7 +70,13 @@ echo "Copying inputs" LOCALMACRODIR=$(mktemp -d) trap "mv output ${OUTPUTDIR}/output.${PBS_JOBID%%.*} ; rm -r ${LOCALMACRODIR} ; exit 1" 1 2 3 15 cd ${LOCALMACRODIR} -cp -r -L "${MACRODIR}"/{data,mac} . +unamestr=`uname` +if [[ "$unamestr" == 'Darwin' ]]; then + ## cp is slightly different on OSX + cp -R -L "${MACRODIR}"/{data,mac} . +else + cp -r -L "${MACRODIR}"/{data,mac} . +fi mkdir output # Enforce one thread @@ -74,8 +86,8 @@ echo "Lauching macro" date if test "$RELEASEDIR" = "NONE" then - echo Gate ${PARAM} ${MACROFILE} - eval Gate ${PARAM} ${MACROFILE} || error "gate failed" + echo Gate ${PARAM} ${MACROFILE} + eval Gate ${PARAM} ${MACROFILE} || error "gate failed" else LD_PRELOAD="${ROOTLIBS}${G4LIBS}${CLHEPLIBS}${GATELIBS}" \ G4LEVELGAMMADATA="${RELEASEDIR}/PhotonEvaporation2.1" \ @@ -92,6 +104,7 @@ else fi echo "Copying data back" +pwd mv output "${OUTPUTDIR}/output.${PBS_JOBID%%.*}" echo "Cleanup" diff --git a/cluster_tools/gate_run_submit_cluster.sh b/cluster_tools/gate_run_submit_cluster.sh index edd798b..904a0d7 100755 --- a/cluster_tools/gate_run_submit_cluster.sh +++ b/cluster_tools/gate_run_submit_cluster.sh @@ -52,7 +52,16 @@ then OUTPUTDIR=$(mktemp -d -p "${MACRODIR}" run.XXXX || error "can't create temp dir") ssh -i ${HOME}/.ssh/ccin2p3 linux1.dg.creatis.insa-lyon.fr mkdir -p "cc/$(basename ${OUTPUTDIR})" else - OUTPUTDIR=$(mktemp --tmpdir=${MACRODIR} -d run.XXXX || error "can't create temp dir") + unamestr=`uname` + if [[ "$unamestr" == 'Darwin' ]]; then + ## On OSX (Darwin), mktemp version is different from Linux version . We + ## need the absolute folder here + OUTPUTDIR=$(mktemp -d run.XXXX || error "can't create temp dir") + OUTPUTDIR=${MACRODIR}/${OUTPUTDIR} + else + OUTPUTDIR=$(mktemp --tmpdir=${MACRODIR} -d run.XXXX || error "can't create temp dir") + fi + echo $OUTPUTDIR fi test -d ${OUTPUTDIR} || error "can't locate output dir" RUNID=${OUTPUTDIR##*.}