X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=cluster_tools%2Fgate_run_submit_cluster.sh;h=904a0d7162e2f12c664db4cec1e37efd16de5d4c;hb=b7842673d15e983fde13046981c9eb0d4e4158c8;hp=8858c68780d89832a7720f56700205bb58c93207;hpb=cca0bd0f7fa28f196192c835dc60a6eff7541973;p=clitk.git diff --git a/cluster_tools/gate_run_submit_cluster.sh b/cluster_tools/gate_run_submit_cluster.sh index 8858c68..904a0d7 100755 --- a/cluster_tools/gate_run_submit_cluster.sh +++ b/cluster_tools/gate_run_submit_cluster.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#! /bin/bash -lx set -u SCRIPTNAME="$(basename "${0}")" @@ -52,13 +52,22 @@ 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##*.} NJOBS=${2:-"${DEFAULTNUMBEROFJOBS}"} NJOBSMAX=${NJOBS} -PARAM="${4:-""}" +PARAM="${4:-\"\"}" echo "Lets roll!!" echo "runid is ${RUNID}" @@ -102,13 +111,14 @@ while test $NJOBS -gt 0; do PARAM=\"${PARAM}\" INDEX=${NJOBS} INDEXMAX=${NJOBSMAX} OUTPUTDIR=${OUTPUTDIR} RELEASEDIR=${RELEASEDIR} MACROFILE=${MACROFILE} MACRODIR=${MACRODIR} PBS_JOBID="local_${NJOBS}" bash "${JOBFILE}" > ${OUTPUTDIR}/gate_${NJOBS}.log & elif test "$(dnsdomainname)" = "in2p3.fr" then - PROJECTGROUP=creatis + PROJECTGROUP=creatis qsub -o "${OUTPUTDIR}" \ + -l sps=1 \ -N "gate.${RUNID}" \ -v "PARAM=\"${PARAM}\",INDEX=${NJOBS},INDEXMAX=${NJOBSMAX},OUTPUTDIR=${OUTPUTDIR},RELEASEDIR=${RELEASEDIR},MACROFILE=${MACROFILE},MACRODIR=${MACRODIR}" \ "${JOBFILE}" || error "submission error" else - qsub -N "gatejob.${RUNID}" -o "${OUTPUTDIR}" \ + qsub -N "gatejob.${RUNID}" -o "${OUTPUTDIR}" \ -v "PARAM=${PARAM},INDEX=${NJOBS},INDEXMAX=${NJOBSMAX},OUTPUTDIR=${OUTPUTDIR},RELEASEDIR=${RELEASEDIR},MACROFILE=${MACROFILE},MACRODIR=${MACRODIR}" \ "${JOBFILE}" || error "submission error" fi @@ -117,7 +127,3 @@ while test $NJOBS -gt 0; do done echo "runid is ${RUNID}" -if test "$(dnsdomainname)" = "in2p3.fr" -then - rsync -av --remove-source-files -e "ssh -i ${HOME}/.ssh/ccin2p3" ${OUTPUTDIR}/ "linux1.dg.creatis.insa-lyon.fr:./cc/$(basename ${OUTPUTDIR})" --exclude '.__afs*' --exclude "${OUTPUTDIR}/gatejob.*.o*" -fi