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=2ae6186bcfc38a27bfc230d4052d6c4f338e16e6;hpb=6aec27678d61269347c9fb6eed0ff270711777a2;p=clitk.git diff --git a/cluster_tools/gate_run_submit_cluster.sh b/cluster_tools/gate_run_submit_cluster.sh index 2ae6186..904a0d7 100755 --- a/cluster_tools/gate_run_submit_cluster.sh +++ b/cluster_tools/gate_run_submit_cluster.sh @@ -1,4 +1,4 @@ -#!/bin/bash -l +#! /bin/bash -lx set -u SCRIPTNAME="$(basename "${0}")" @@ -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##*.} @@ -91,7 +100,6 @@ cp ${MACROFILE} ${OUTPUTDIR}/mac files=`grep "control/execute" ${MACROFILE} | cut -d " " -f 2` for i in $files do - echo $i cp $i ${OUTPUTDIR}/mac done @@ -105,11 +113,12 @@ while test $NJOBS -gt 0; do then 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 @@ -118,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