From: Sorina Pop Date: Mon, 20 Jun 2016 16:10:00 +0000 (+0200) Subject: odin fisp and epi workflow v0.1 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=b01e3c2793820d3e97933aa844bb503bdc750835;p=vip-workflow-odin.git odin fisp and epi workflow v0.1 --- b01e3c2793820d3e97933aa844bb503bdc750835 diff --git a/bin/odin-release.tgz b/bin/odin-release.tgz new file mode 100644 index 0000000..ad7fb14 Binary files /dev/null and b/bin/odin-release.tgz differ diff --git a/bin/odin.sh b/bin/odin.sh new file mode 100644 index 0000000..b761f60 --- /dev/null +++ b/bin/odin.sh @@ -0,0 +1,154 @@ +#!/bin/sh -l + +function unziptar { + zipname=`echo $1 | grep '\.zip'` + echo $zipname + tarname=`echo $1 | grep '\.tar'` + echo $tarname + tgzname=`echo $1 | grep '\.tgz'` + echo $tgzname + if [ "x$zipname" != "x" ] + then + echo "ZIP File" + unzip -j $1 -d data + else + if [ "x$tarname" != "x" ] + then + echo "TAR File" + COMP=`tar -tvf $1 | awk 'END{print}' | awk -F' ' '{print $NF}' | awk -F'/' '{print NF-1}'` + tar -xvf $1 --strip-components=${COMP} -C data + else + if [ "x$tgzname" != "x" ] + then + echo "TGZ File" + COMP=`tar -tvf $1 | awk 'END{print}' | awk -F' ' '{print $NF}' | awk -F'/' '{print NF-1}'` + tar -zxvf $1 --strip-components=${COMP} -C data + else + echo "Unknown File Type" + exit 6 + fi + fi + fi + + if [ $? != 0 ] + then + echo "A problem occurred while untargzing the input: giving up!" + exit 2 + fi +} + +function checkdir { + lfc-ls $1 > /dev/null + if [ $? != 0 ] + then + echo "Directory $1 not found, creating it!" + lfc-mkdir -p $1 + #exit 6 + fi +} + + +function downloadDir { + checkdir $1 + LOCALDIR=`basename $1` + mkdir -p ${LOCALDIR} + for i in `lfc-ls $1 | grep -v garbage` + do + lcg-cp -v lfn:$1/$i file:$PWD/${LOCALDIR}/$i + if [ $? != 0 ] + then + echo "lcg-cp failed: trying once more" + lcg-cp -v lfn:$1/$i file:$PWD/${LOCALDIR}/$i + if [ $? != 0 ] + then + echo "Unable to download file lfn:$1/$i: giving up." + exit 1 + fi + fi + done +} + +PROPATH=$1 +SMPPATH=$2 +RESDIR=$3 +ODINSEQ=$4 + +PRO=`basename $PROPATH` +SMP=`basename $SMPPATH` + +SELMODE=`/usr/sbin/getenforce` +if [ "${SELMODE}" != "Disabled" ] && [ "${SELMODE}" != "Permissive" ] +then + chcon -t textrel_shlib_t v*/bin/*/*.so + chcon -t textrel_shlib_t v*/bin/*/*.so* +fi + + +#export LFC_HOST=lfc-biomed.in2p3.fr +#export LCG_GFAL_INFOSYS=cclcgtopbdii02.in2p3.fr:2170 + +#echo "whoami, Printing env" +#whoami +#env + +tar -zxvf odin-release.tgz +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. +OUTNAME=`echo ${SMP%.smp}` + +#launching program odinfispexe +echo "executing ${ODINSEQ} simulate -magsi -s $SMP -p $PRO" +./${ODINSEQ} simulate -magsi -s $SMP -p $PRO + +CODE=$? +if [ ${CODE} != 0 ] +then + echo "Execution failed: exiting with code ${CODE}" + #exit ${CODE} +else + echo "Done" +fi + +#launching program odinrecopexe +echo "executing odinrecopexe -o $OUTNAME" +./odinrecoexe -o $OUTNAME + +CODE=$? +if [ ${CODE} != 0 ] +then + echo "Execution failed: exiting with code ${CODE}" + #exit ${CODE} +else + echo "Done" +fi + +JDX="${OUTNAME}.jdx" +test -f ${JDX} +CODE=$? +if [ ${CODE} != 0 ] +then + echo "No JDX produced, exit 6" + exit 6 +else + LFN=${RESDIR}/$JDX + echo "Uploading $JDX to lfn:${LFN}" + lfc-ls ${LFN} + if [ $? = 0 ] + then + lcg-del -a lfn:/${LFN} + if [ $? != 0 ] + then + echo "not able to lcg-del lfn:/${LFN}, renaming it" + d=`date -d "" +%s` + lfc-rename ${LFN} ${LFN}-garbage-${d} + fi + fi +fi +lcg-cr -v -d ccsrm02.in2p3.fr -l lfn:${LFN} file:$PWD/$JDX +CODE=$? +if [ ${CODE} != 0 ] +then + echo "JDX upload failed" + exit 6 +fi + + diff --git a/gasw/odin.xml b/gasw/odin.xml new file mode 100644 index 0000000..fa74205 --- /dev/null +++ b/gasw/odin.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/workflow/odin.gwendia b/workflow/odin.gwendia new file mode 100644 index 0000000..15cc854 --- /dev/null +++ b/workflow/odin.gwendia @@ -0,0 +1,57 @@ + + + + There is no description for this application. Please contact the developers to know what it is about. + + + + <b><font color="blue">new input</font></b>: Pro file + + + + <b><font color="blue">new input</font></b>: Smp file + + + + <b><font color="blue">new input</font></b>: add description here... + + + + + + + + + + + + + + + + + + + + + + /*----------Beginning of Beanshell------------*/ + import java.text.DateFormat; + import java.text.SimpleDateFormat; + import java.util.Date; + +DateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy_HH:mm:ss"); +String result = dir.toString()+"/"+(dateFormat.format(System.currentTimeMillis())); +/*------------End of Beanshell------------*/ + + + + + + + + + + + + diff --git a/workflow/odin_epi.gwendia b/workflow/odin_epi.gwendia new file mode 100644 index 0000000..7180ef1 --- /dev/null +++ b/workflow/odin_epi.gwendia @@ -0,0 +1,61 @@ + + + + There is no description for this application. Please contact the developers to know what it is about. + + + + <b><font color="blue">new input</font></b>: Pro file + + + + <b><font color="blue">new input</font></b>: Smp file + + + + <b><font color="blue">new input</font></b>: add description here... + + + + + + + + + + + + + + + + + + + + + + + + + /*----------Beginning of Beanshell------------*/ + import java.text.DateFormat; + import java.text.SimpleDateFormat; + import java.util.Date; + +DateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy_HH:mm:ss"); +String result = dir.toString()+"/"+(dateFormat.format(System.currentTimeMillis())); +/*------------End of Beanshell------------*/ + + + + + + + + + + + + + diff --git a/workflow/odin_fisp.gwendia b/workflow/odin_fisp.gwendia new file mode 100644 index 0000000..f6d8204 --- /dev/null +++ b/workflow/odin_fisp.gwendia @@ -0,0 +1,61 @@ + + + + There is no description for this application. Please contact the developers to know what it is about. + + + + <b><font color="blue">new input</font></b>: Pro file + + + + <b><font color="blue">new input</font></b>: Smp file + + + + <b><font color="blue">new input</font></b>: add description here... + + + + + + + + + + + + + + + + + + + + + + + + + /*----------Beginning of Beanshell------------*/ + import java.text.DateFormat; + import java.text.SimpleDateFormat; + import java.util.Date; + +DateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy_HH:mm:ss"); +String result = dir.toString()+"/"+(dateFormat.format(System.currentTimeMillis())); +/*------------End of Beanshell------------*/ + + + + + + + + + + + + +