]> Creatis software - vip-workflow-odin.git/commitdiff
odin fisp and epi workflow v0.1
authorSorina Pop <sorina.pop@creatis.insa-lyon.fr>
Mon, 20 Jun 2016 16:10:00 +0000 (18:10 +0200)
committerSorina Pop <sorina.pop@creatis.insa-lyon.fr>
Mon, 20 Jun 2016 16:10:00 +0000 (18:10 +0200)
bin/odin-release.tgz [new file with mode: 0644]
bin/odin.sh [new file with mode: 0644]
gasw/odin.xml [new file with mode: 0644]
workflow/odin.gwendia [new file with mode: 0644]
workflow/odin_epi.gwendia [new file with mode: 0644]
workflow/odin_fisp.gwendia [new file with mode: 0644]

diff --git a/bin/odin-release.tgz b/bin/odin-release.tgz
new file mode 100644 (file)
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 (file)
index 0000000..b761f60
--- /dev/null
@@ -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 (file)
index 0000000..fa74205
--- /dev/null
@@ -0,0 +1,26 @@
+<description>
+       <executable name="odin.sh">
+               <access type="LFN" cached="true">       
+               </access>
+               <value value="[BIN_DIR]/odin.sh"/>
+       
+               <input name="proc" option="no1">
+                        <access type="LFN" cached="true">
+                        </access>
+               </input>
+                <input name="smp" option="no2">
+                        <access type="LFN" cached="true">
+                        </access>
+               </input>
+               <input name="result_dir" option="no3">
+                </input>
+               <input name="odin_seq" option="no4">
+                </input>
+                <sandbox name="executable">
+                        <access type="LFN" cached="true">
+
+                        </access>
+                        <value value="[BIN_DIR]/odin-release.tgz"/>
+                </sandbox>
+       </executable> 
+</description>
diff --git a/workflow/odin.gwendia b/workflow/odin.gwendia
new file mode 100644 (file)
index 0000000..15cc854
--- /dev/null
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<workflow name="odin" version="0.1">
+
+  <description>There is no description for this application. Please contact the developers to know what it is about.</description>
+
+  <interface>
+    <source name="ProData" type="uri">
+      <source-comment>&lt;b&gt;&lt;font color="blue"&gt;new input&lt;/font&gt;&lt;/b&gt;: Pro file
+      </source-comment>
+    </source>
+    <source name="SmpData" type="uri">
+      <source-comment>&lt;b&gt;&lt;font color="blue"&gt;new input&lt;/font&gt;&lt;/b&gt;: Smp file
+      </source-comment>
+    </source>
+    <source name="ResultsDirectory" type="uri">
+      <source-comment>&lt;b&gt;&lt;font color="blue"&gt;new input&lt;/font&gt;&lt;/b&gt;: add description here...
+      </source-comment>
+    </source>
+  </interface>
+
+  <processors>
+    <processor name="odin" >
+      <in name="input2" type="string" depth="0" />
+      <in name="input1" type="uri" depth="0" />
+      <in name="input0" type="uri" depth="0" />
+      <iterationstrategy>
+        <cross>
+          <port name="input0" />
+          <port name="input1" />
+          <port name="input2" />
+        </cross>
+      </iterationstrategy>
+      <gasw descriptor="[GASW_DIR]/odin.xml"/>
+    </processor>
+    <processor name="append-date" >
+      <in name="dir" type="uri" depth="0" />
+      <out name="result" type="string" depth="0" />
+      <beanshell>/*----------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------------*/
+      </beanshell>
+    </processor>
+  </processors>
+
+  <links>
+      <link from="SmpData" to="odin:input1" />
+      <link from="ProData" to="odin:input0" />
+      <link from="ResultsDirectory" to="append-date:dir" />
+      <link from="append-date:result" to="odin:input2" />
+  </links>
+
+</workflow>
diff --git a/workflow/odin_epi.gwendia b/workflow/odin_epi.gwendia
new file mode 100644 (file)
index 0000000..7180ef1
--- /dev/null
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<workflow name="odin" version="0.1">
+
+  <description>There is no description for this application. Please contact the developers to know what it is about.</description>
+
+  <interface>
+    <source name="ProData" type="uri">
+      <source-comment>&lt;b&gt;&lt;font color="blue"&gt;new input&lt;/font&gt;&lt;/b&gt;: Pro file
+      </source-comment>
+    </source>
+    <source name="SmpData" type="uri">
+      <source-comment>&lt;b&gt;&lt;font color="blue"&gt;new input&lt;/font&gt;&lt;/b&gt;: Smp file
+      </source-comment>
+    </source>
+    <source name="ResultsDirectory" type="uri">
+      <source-comment>&lt;b&gt;&lt;font color="blue"&gt;new input&lt;/font&gt;&lt;/b&gt;: add description here...
+      </source-comment>
+    </source>
+    <constant name="OdinSeq" type="string" value="odinepiexe" cardinality="scalar" />
+  </interface>
+
+  <processors>
+    <processor name="odin" >
+      <in name="input3" type="string" depth="0" />
+      <in name="input2" type="string" depth="0" />
+      <in name="input1" type="uri" depth="0" />
+      <in name="input0" type="uri" depth="0" />
+      <iterationstrategy>
+        <cross>
+          <port name="input0" />
+          <port name="input1" />
+          <port name="input2" />
+          <port name="input3" />
+        </cross>
+      </iterationstrategy>
+      <gasw descriptor="[GASW_DIR]/odin.xml"/>
+    </processor>
+    <processor name="append-date" >
+      <in name="dir" type="uri" depth="0" />
+      <out name="result" type="string" depth="0" />
+      <beanshell>/*----------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------------*/
+      </beanshell>
+    </processor>
+  </processors>
+
+  <links>
+      <link from="SmpData" to="odin:input1" />
+      <link from="ProData" to="odin:input0" />
+      <link from="ResultsDirectory" to="append-date:dir" />
+      <link from="append-date:result" to="odin:input2" />
+      <link from="OdinSeq" to="odin:input3" />
+  </links>
+
+</workflow>
diff --git a/workflow/odin_fisp.gwendia b/workflow/odin_fisp.gwendia
new file mode 100644 (file)
index 0000000..f6d8204
--- /dev/null
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<workflow name="odin" version="0.1">
+
+  <description>There is no description for this application. Please contact the developers to know what it is about.</description>
+
+  <interface>
+    <source name="ProData" type="uri">
+      <source-comment>&lt;b&gt;&lt;font color="blue"&gt;new input&lt;/font&gt;&lt;/b&gt;: Pro file
+      </source-comment>
+    </source>
+    <source name="SmpData" type="uri">
+      <source-comment>&lt;b&gt;&lt;font color="blue"&gt;new input&lt;/font&gt;&lt;/b&gt;: Smp file
+      </source-comment>
+    </source>
+    <source name="ResultsDirectory" type="uri">
+      <source-comment>&lt;b&gt;&lt;font color="blue"&gt;new input&lt;/font&gt;&lt;/b&gt;: add description here...
+      </source-comment>
+    </source>
+    <constant name="OdinSeq" type="string" value="odinfispexe" cardinality="scalar" />
+  </interface>
+
+  <processors>
+    <processor name="odin" >
+      <in name="input3" type="string" depth="0" />
+      <in name="input2" type="string" depth="0" />
+      <in name="input1" type="uri" depth="0" />
+      <in name="input0" type="uri" depth="0" />
+      <iterationstrategy>
+        <cross>
+          <port name="input0" />
+          <port name="input1" />
+          <port name="input2" />
+          <port name="input3" />
+        </cross>
+      </iterationstrategy>
+      <gasw descriptor="[GASW_DIR]/odin.xml"/>
+    </processor>
+    <processor name="append-date" >
+      <in name="dir" type="uri" depth="0" />
+      <out name="result" type="string" depth="0" />
+      <beanshell>/*----------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------------*/
+      </beanshell>
+    </processor>
+  </processors>
+
+  <links>
+      <link from="SmpData" to="odin:input1" />
+      <link from="ProData" to="odin:input0" />
+      <link from="ResultsDirectory" to="append-date:dir" />
+      <link from="append-date:result" to="odin:input2" />
+      <link from="OdinSeq" to="odin:input3" />
+  </links>
+
+</workflow>