From f443cb8dff715b8e1a026444c7ac045acef25eeb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Mon, 28 May 2007 12:29:27 +0000 Subject: [PATCH] Grouping URLs and files to xml structures. --- org.glite.jp/examples/pch06/align.sh | 41 +++++------------- org.glite.jp/examples/pch06/convert.sh | 32 +++----------- org.glite.jp/examples/pch06/functions.sh | 35 +++++++++++++++ org.glite.jp/examples/pch06/pch06.jdl-template | 31 +++++++------- org.glite.jp/examples/pch06/pch06.runme | 4 +- org.glite.jp/examples/pch06/pgmtoppm.sh | 23 +--------- org.glite.jp/examples/pch06/pnmtojpeg.sh | 23 +--------- org.glite.jp/examples/pch06/reslice.sh | 41 ++++-------------- org.glite.jp/examples/pch06/slicer.sh | 36 +++------------- org.glite.jp/examples/pch06/softmean.sh | 59 +++++++------------------- 10 files changed, 102 insertions(+), 223 deletions(-) create mode 100644 org.glite.jp/examples/pch06/functions.sh diff --git a/org.glite.jp/examples/pch06/align.sh b/org.glite.jp/examples/pch06/align.sh index 4f6a452..d6279b2 100644 --- a/org.glite.jp/examples/pch06/align.sh +++ b/org.glite.jp/examples/pch06/align.sh @@ -1,27 +1,6 @@ #!/bin/sh -log_event() #1 - attr.name #2 attr.value -{ - GLITE_WMS_SEQUENCE_CODE=`$lb_logevent\ - --jobid="$GLITE_WMS_JOBID"\ - --source="Application"\ - --sequence="$GLITE_WMS_SEQUENCE_CODE"\ - --event="UserTag"\ - --node=$host\ - --name="$1"\ - --value="$2"\ - || echo $GLITE_WMS_SEQUENCE_CODE` -} - -init_log_event() -{ - lb_logevent=${GLITE_WMS_LOCATION}/bin/glite-lb-logevent - if [ ! -x "$lb_logevent" ]; then - lb_logevent="${EDG_WL_LOCATION}/bin/edg-wl-logev" - fi - host=`hostname -f` -} - +. ./functions.sh exec 2>$$.err >&2 set -x @@ -33,28 +12,28 @@ echo $0 $* chmod +x align_warp scanheader -globus-url-copy $1.img file://$PWD/anatomy.img -globus-url-copy $1.hdr file://$PWD/anatomy.hdr -globus-url-copy $2.img file://$PWD/reference.img -globus-url-copy $2.hdr file://$PWD/reference.hdr +globus-url-copy $1/$2.img file://$PWD/anatomy.img +globus-url-copy $1/$2.hdr file://$PWD/anatomy.hdr +globus-url-copy $1/$3.img file://$PWD/reference.img +globus-url-copy $1/$3.hdr file://$PWD/reference.hdr ./align_warp reference.img anatomy.img warp -m 12 -q GLOBAL_MAXIMUM=`./scanheader anatomy.img | grep '^global maximum=' | sed 's/global maximum=//'` echo $GLOBAL_MAXIMUM -globus-url-copy file://$PWD/warp $1.warp +globus-url-copy file://$PWD/warp $1/$2.warp # Log LB user_tags init_log_event log_event "IPAW_STAGE" "1" log_event "IPAW_PROGRAM" "align_warp" -log_event "IPAW_INPUT" "$1.img" -log_event "IPAW_INPUT" "$2.img" -log_event "IPAW_OUTPUT" "$1.warp" +log_file_event "IPAW_INPUT" "$2" "$1/$2.img" +log_file_event "IPAW_INPUT" "$3" "$1/$3.img" +log_file_event "IPAW_OUTPUT" "$2" "$1/$2.warp" log_event "IPAW_PARAM" "-m 12" log_event "IPAW_PARAM" "-q" log_event "IPAW_HEADER" "GLOBAL_MAXIMUM=$GLOBAL_MAXIMUM" -globus-url-copy file://$PWD/$$.err $1.align-err +globus-url-copy file://$PWD/$$.err $1/$2.align-err diff --git a/org.glite.jp/examples/pch06/convert.sh b/org.glite.jp/examples/pch06/convert.sh index 70b4511..64b6e86 100644 --- a/org.glite.jp/examples/pch06/convert.sh +++ b/org.glite.jp/examples/pch06/convert.sh @@ -1,27 +1,6 @@ #!/bin/sh -log_event() #1 - attr.name #2 attr.value -{ - GLITE_WMS_SEQUENCE_CODE=`$lb_logevent\ - --jobid="$GLITE_WMS_JOBID"\ - --source="Application"\ - --sequence="$GLITE_WMS_SEQUENCE_CODE"\ - --event="UserTag"\ - --node=$host\ - --name="$1"\ - --value="$2"\ - || echo $GLITE_WMS_SEQUENCE_CODE` -} - -init_log_event() -{ - lb_logevent=${GLITE_WMS_LOCATION}/bin/glite-lb-logevent - if [ ! -x "$lb_logevent" ]; then - lb_logevent="${EDG_WL_LOCATION}/bin/edg-wl-logev" - fi - host=`hostname -f` -} - +. ./functions.sh set -ex @@ -29,18 +8,17 @@ hostname -f date echo $0 $* -globus-url-copy $1-$2.pgm file://$PWD/atlas.pgm +globus-url-copy $1/$2-$3.pgm file://$PWD/atlas.pgm chmod +x convert ./convert atlas.pgm atlas.gif -globus-url-copy file://$PWD/atlas.gif $1-$2.gif +globus-url-copy file://$PWD/atlas.gif $1/$2-$3.gif # Log LB user_tags init_log_event log_event "IPAW_STAGE" "5" log_event "IPAW_PROGRAM" "convert" -log_event "IPAW_INPUT" "$1-$2.pgm" -log_event "IPAW_OUTPUT" "$1-$2.gif" - +log_file_event "IPAW_INPUT" "$2-$3" "$1/$2-$3.pgm" +log_file_event "IPAW_OUTPUT" "$2-$3" "$1/$2-$3.gif" diff --git a/org.glite.jp/examples/pch06/functions.sh b/org.glite.jp/examples/pch06/functions.sh new file mode 100644 index 0000000..34427df --- /dev/null +++ b/org.glite.jp/examples/pch06/functions.sh @@ -0,0 +1,35 @@ +log_event() #1 - attr.name #2 attr.value +{ + GLITE_WMS_SEQUENCE_CODE=`$lb_logevent\ + --jobid="$GLITE_WMS_JOBID"\ + --source="Application"\ + --sequence="$GLITE_WMS_SEQUENCE_CODE"\ + --event="UserTag"\ + --node=$host\ + --name="$1"\ + --value="$2"\ + || echo $GLITE_WMS_SEQUENCE_CODE` +} + +init_log_event() +{ + lb_logevent=${GLITE_WMS_LOCATION}/bin/glite-lb-logevent + if [ ! -x "$lb_logevent" ]; then + lb_logevent="${EDG_WL_LOCATION}/bin/edg-wl-logev" + fi + host=`hostname -f` +} + +log_file_event() #1 - attr.name #2 file.name #3 file.uri... +{ + attr="$1" + str=" +" + while [ -n "$3" ]; do + str="$str $3 +" + shift + done + str="$str" + log_event "$attr" "$str" +} diff --git a/org.glite.jp/examples/pch06/pch06.jdl-template b/org.glite.jp/examples/pch06/pch06.jdl-template index 9390655..f756877 100644 --- a/org.glite.jp/examples/pch06/pch06.jdl-template +++ b/org.glite.jp/examples/pch06/pch06.jdl-template @@ -6,6 +6,7 @@ Requirements = other.GlueCEInfoHostname=="skurut17.cesnet.cz"; LBAddress = "skurut1.cesnet.cz:9000"; InputSandbox = { + "SANDBOX/functions.sh", "SANDBOX/align.sh", "SANDBOX/reslice.sh", "SANDBOX/softmean.sh", @@ -23,68 +24,68 @@ InputSandbox = { nodes = [ align1 = [ description = [ executable = "align.sh"; - arguments = "BASE1 REFERENCE"; + arguments = "PREFIX BASE1 REFERENCE"; ] ]; align2 = [ description = [ executable = "align.sh"; - arguments = "BASE2 REFERENCE"; + arguments = "PREFIX BASE2 REFERENCE"; ] ]; align3 = [ description = [ executable = "align.sh"; - arguments = "BASE3 REFERENCE"; + arguments = "PREFIX BASE3 REFERENCE"; ] ]; align4 = [ description = [ executable = "align.sh"; - arguments = "BASE4 REFERENCE"; + arguments = "PREFIX BASE4 REFERENCE"; ] ]; reslice1 = [ description = [ executable = "reslice.sh"; - arguments = "BASE1"; + arguments = "PREFIX BASE1"; ] ]; reslice2 = [ description = [ executable = "reslice.sh"; - arguments = "BASE2"; + arguments = "PREFIX BASE2"; ] ]; reslice3 = [ description = [ executable = "reslice.sh"; - arguments = "BASE3"; + arguments = "PREFIX BASE3"; ] ]; reslice4 = [ description = [ executable = "reslice.sh"; - arguments = "BASE4"; + arguments = "PREFIX BASE4"; ] ]; softmean = [ description = [ executable = "softmean.sh"; - arguments = "BASE1 BASE2 BASE3 BASE4 ATLAS"; + arguments = "PREFIX BASE1 BASE2 BASE3 BASE4 ATLAS"; ] ]; slicerx = [ description = [ executable = "slicer.sh"; - arguments = "ATLAS x"; + arguments = "PREFIX ATLAS x"; ] ]; slicery = [ description = [ executable = "slicer.sh"; - arguments = "ATLAS y"; + arguments = "PREFIX ATLAS y"; ] ]; slicerz = [ description = [ executable = "slicer.sh"; - arguments = "ATLAS z"; + arguments = "PREFIX ATLAS z"; ] ]; convertx = [ description = [ executable = "convert.sh"; - arguments = "ATLAS x"; + arguments = "PREFIX ATLAS x"; ] ]; converty = [ description = [ executable = "convert.sh"; - arguments = "ATLAS y"; + arguments = "PREFIX ATLAS y"; ] ]; convertz = [ description = [ executable = "convert.sh"; - arguments = "ATLAS z"; + arguments = "PREFIX ATLAS z"; ] ]; ]; diff --git a/org.glite.jp/examples/pch06/pch06.runme b/org.glite.jp/examples/pch06/pch06.runme index 64c0746..fc7fdc0 100644 --- a/org.glite.jp/examples/pch06/pch06.runme +++ b/org.glite.jp/examples/pch06/pch06.runme @@ -4,12 +4,12 @@ sandbox=. if [ -z "$6" ]; then - echo usage: $0 reference base1 base2 base3 base4 atlas + echo usage: $0 urlprefix reference base1 base2 base3 base4 atlas echo " all args are URLs without suffix" exit 1 fi -sed "s|REFERENCE|$1|; s|BASE1|$2|; s|BASE2|$3|; s|BASE3|$4|; s|BASE4|$5|; s|ATLAS|$6|; s|SANDBOX|$sandbox|" pch06.jdl-template >pch06.jdl +sed "s|PREFIX|$1|; s|REFERENCE|$2|; s|BASE1|$3|; s|BASE2|$4|; s|BASE3|$5|; s|BASE4|$6|; s|ATLAS|$7|; s|SANDBOX|$sandbox|" pch06.jdl-template >pch06.jdl # glite-wms-job-submit -a pch06.jdl diff --git a/org.glite.jp/examples/pch06/pgmtoppm.sh b/org.glite.jp/examples/pch06/pgmtoppm.sh index 7353ff3..2a1da74 100644 --- a/org.glite.jp/examples/pch06/pgmtoppm.sh +++ b/org.glite.jp/examples/pch06/pgmtoppm.sh @@ -1,27 +1,6 @@ #!/bin/sh -log_event() #1 - attr.name #2 attr.value -{ - GLITE_WMS_SEQUENCE_CODE=`$lb_logevent\ - --jobid="$GLITE_WMS_JOBID"\ - --source="Application"\ - --sequence="$GLITE_WMS_SEQUENCE_CODE"\ - --event="UserTag"\ - --node=$host\ - --name="$1"\ - --value="$2"\ - || echo $GLITE_WMS_SEQUENCE_CODE` -} - -init_log_event() -{ - lb_logevent=${GLITE_WMS_LOCATION}/bin/glite-lb-logevent - if [ ! -x "$lb_logevent" ]; then - lb_logevent="${EDG_WL_LOCATION}/bin/edg-wl-logev" - fi - host=`hostname -f` -} - +. ./functions.sh set -ex diff --git a/org.glite.jp/examples/pch06/pnmtojpeg.sh b/org.glite.jp/examples/pch06/pnmtojpeg.sh index 5a68c97..252b323 100644 --- a/org.glite.jp/examples/pch06/pnmtojpeg.sh +++ b/org.glite.jp/examples/pch06/pnmtojpeg.sh @@ -1,27 +1,6 @@ #!/bin/sh -log_event() #1 - attr.name #2 attr.value -{ - GLITE_WMS_SEQUENCE_CODE=`$lb_logevent\ - --jobid="$GLITE_WMS_JOBID"\ - --source="Application"\ - --sequence="$GLITE_WMS_SEQUENCE_CODE"\ - --event="UserTag"\ - --node=$host\ - --name="$1"\ - --value="$2"\ - || echo $GLITE_WMS_SEQUENCE_CODE` -} - -init_log_event() -{ - lb_logevent=${GLITE_WMS_LOCATION}/bin/glite-lb-logevent - if [ ! -x "$lb_logevent" ]; then - lb_logevent="${EDG_WL_LOCATION}/bin/edg-wl-logev" - fi - host=`hostname -f` -} - +. ./functions.sh set -ex diff --git a/org.glite.jp/examples/pch06/reslice.sh b/org.glite.jp/examples/pch06/reslice.sh index 2d0407b..c124224 100644 --- a/org.glite.jp/examples/pch06/reslice.sh +++ b/org.glite.jp/examples/pch06/reslice.sh @@ -1,27 +1,6 @@ #!/bin/sh -log_event() #1 - attr.name #2 attr.value -{ - GLITE_WMS_SEQUENCE_CODE=`$lb_logevent\ - --jobid="$GLITE_WMS_JOBID"\ - --source="Application"\ - --sequence="$GLITE_WMS_SEQUENCE_CODE"\ - --event="UserTag"\ - --node=$host\ - --name="$1"\ - --value="$2"\ - || echo $GLITE_WMS_SEQUENCE_CODE` -} - -init_log_event() -{ - lb_logevent=${GLITE_WMS_LOCATION}/bin/glite-lb-logevent - if [ ! -x "$lb_logevent" ]; then - lb_logevent="${EDG_WL_LOCATION}/bin/edg-wl-logev" - fi - host=`hostname -f` -} - +. ./functions.sh set -ex @@ -29,24 +8,22 @@ hostname -f date echo $0 $* -globus-url-copy $1.warp file://$PWD/warp -globus-url-copy $1.img file://$PWD/anatomy.img -globus-url-copy $1.hdr file://$PWD/anatomy.hdr +globus-url-copy $1/$2.warp file://$PWD/warp +globus-url-copy $1/$2.img file://$PWD/anatomy.img +globus-url-copy $1/$2.hdr file://$PWD/anatomy.hdr chmod +x reslice ./reslice warp resliced -globus-url-copy file://$PWD/resliced.img $1-resliced.img -globus-url-copy file://$PWD/resliced.hdr $1-resliced.hdr +globus-url-copy file://$PWD/resliced.img $1/$2-resliced.img +globus-url-copy file://$PWD/resliced.hdr $1/$2-resliced.hdr # Log LB user_tags init_log_event log_event "IPAW_STAGE" "2" log_event "IPAW_PROGRAM" "reslice" -log_event "IPAW_INPUT" "$1.warp" -log_event "IPAW_INPUT" "$1.img" -log_event "IPAW_INPUT" "$1.hdr" -log_event "IPAW_OUTPUT" "$1-resliced.img" -log_event "IPAW_OUTPUT" "$1-resliced.img" +log_file_event "IPAW_INPUT" "$2" "$1/$2.warp" +log_file_event "IPAW_INPUT" "$2" "$1/$2.img" "$1/$2.hdr" +log_file_event "IPAW_OUTPUT" "$2-resliced" "$1/$2-resliced.img" "$1/$2-resliced.hdr" diff --git a/org.glite.jp/examples/pch06/slicer.sh b/org.glite.jp/examples/pch06/slicer.sh index db6b3a0..39b1ecd 100644 --- a/org.glite.jp/examples/pch06/slicer.sh +++ b/org.glite.jp/examples/pch06/slicer.sh @@ -1,27 +1,6 @@ #!/bin/sh -log_event() #1 - attr.name #2 attr.value -{ - GLITE_WMS_SEQUENCE_CODE=`$lb_logevent\ - --jobid="$GLITE_WMS_JOBID"\ - --source="Application"\ - --sequence="$GLITE_WMS_SEQUENCE_CODE"\ - --event="UserTag"\ - --node=$host\ - --name="$1"\ - --value="$2"\ - || echo $GLITE_WMS_SEQUENCE_CODE` -} - -init_log_event() -{ - lb_logevent=${GLITE_WMS_LOCATION}/bin/glite-lb-logevent - if [ ! -x "$lb_logevent" ]; then - lb_logevent="${EDG_WL_LOCATION}/bin/edg-wl-logev" - fi - host=`hostname -f` -} - +. ./functions.sh set -ex @@ -29,22 +8,21 @@ hostname -f date echo $0 $* -globus-url-copy $1.hdr file://$PWD/atlas.hdr -globus-url-copy $1.img file://$PWD/atlas.img +globus-url-copy $1/$2.hdr file://$PWD/atlas.hdr +globus-url-copy $1/$2.img file://$PWD/atlas.img chmod +x slicer FSLOUTPUTTYPE=ANALYZE export FSLOUTPUTTYPE -./slicer atlas.hdr -$2 .5 atlas-$2.pgm +./slicer atlas.hdr -$3 .5 atlas-$3.pgm -globus-url-copy file://$PWD/atlas-$2.pgm $1-$2.pgm +globus-url-copy file://$PWD/atlas-$3.pgm $1/$2-$3.pgm # Log LB user_tags init_log_event log_event "IPAW_STAGE" "4" log_event "IPAW_PROGRAM" "slicer" -log_event "IPAW_INPUT" "$1.hdr" -log_event "IPAW_INPUT" "$1.img" -log_event "IPAW_OUTPUT" "$1-$2.pgm" +log_file_event "IPAW_INPUT" "$2" "$1/$2.hdr" "$1/$2.img" +log_file_event "IPAW_OUTPUT" "$2-$3" "$1/$2-$3.pgm" diff --git a/org.glite.jp/examples/pch06/softmean.sh b/org.glite.jp/examples/pch06/softmean.sh index 3136010..d5bde9b 100644 --- a/org.glite.jp/examples/pch06/softmean.sh +++ b/org.glite.jp/examples/pch06/softmean.sh @@ -1,27 +1,6 @@ #!/bin/sh -log_event() #1 - attr.name #2 attr.value -{ - GLITE_WMS_SEQUENCE_CODE=`$lb_logevent\ - --jobid="$GLITE_WMS_JOBID"\ - --source="Application"\ - --sequence="$GLITE_WMS_SEQUENCE_CODE"\ - --event="UserTag"\ - --node=$host\ - --name="$1"\ - --value="$2"\ - || echo $GLITE_WMS_SEQUENCE_CODE` -} - -init_log_event() -{ - lb_logevent=${GLITE_WMS_LOCATION}/bin/glite-lb-logevent - if [ ! -x "$lb_logevent" ]; then - lb_logevent="${EDG_WL_LOCATION}/bin/edg-wl-logev" - fi - host=`hostname -f` -} - +. ./functions.sh set -ex @@ -29,34 +8,28 @@ hostname -f date echo $0 $* -globus-url-copy $1-resliced.img file://$PWD/resliced1.img -globus-url-copy $1-resliced.hdr file://$PWD/resliced1.hdr -globus-url-copy $2-resliced.img file://$PWD/resliced2.img -globus-url-copy $2-resliced.hdr file://$PWD/resliced2.hdr -globus-url-copy $3-resliced.img file://$PWD/resliced3.img -globus-url-copy $3-resliced.hdr file://$PWD/resliced3.hdr -globus-url-copy $4-resliced.img file://$PWD/resliced4.img -globus-url-copy $4-resliced.hdr file://$PWD/resliced4.hdr +globus-url-copy $1/$2-resliced.img file://$PWD/resliced1.img +globus-url-copy $1/$2-resliced.hdr file://$PWD/resliced1.hdr +globus-url-copy $1/$3-resliced.img file://$PWD/resliced2.img +globus-url-copy $1/$3-resliced.hdr file://$PWD/resliced2.hdr +globus-url-copy $1/$4-resliced.img file://$PWD/resliced3.img +globus-url-copy $1/$4-resliced.hdr file://$PWD/resliced3.hdr +globus-url-copy $1/$5-resliced.img file://$PWD/resliced4.img +globus-url-copy $1/$5-resliced.hdr file://$PWD/resliced4.hdr chmod +x softmean ./softmean atlas.hdr y null resliced1.img resliced2.img resliced3.img resliced4.img -globus-url-copy file://$PWD/atlas.img $5.img -globus-url-copy file://$PWD/atlas.hdr $5.hdr +globus-url-copy file://$PWD/atlas.img $1/$6.img +globus-url-copy file://$PWD/atlas.hdr $1/$6.hdr # Log LB user_tags init_log_event log_event "IPAW_STAGE" "3" log_event "IPAW_PROGRAM" "softmean" -log_event "IPAW_INPUT" "$1-resliced.img" -log_event "IPAW_INPUT" "$1-resliced.hdr" -log_event "IPAW_INPUT" "$2-resliced.img" -log_event "IPAW_INPUT" "$2-resliced.hdr" -log_event "IPAW_INPUT" "$3-resliced.img" -log_event "IPAW_INPUT" "$3-resliced.hdr" -log_event "IPAW_INPUT" "$4-resliced.img" -log_event "IPAW_INPUT" "$4-resliced.hdr" -log_event "IPAW_OUTPUT" "$5.img" -log_event "IPAW_OUTPUT" "$5.hdr" - +log_file_event "IPAW_INPUT" "$2-resliced" "$1/$2-resliced.img" "$1/$2-resliced.hdr" +log_file_event "IPAW_INPUT" "$3-resliced" "$1/$3-resliced.img" "$1/$3-resliced.hdr" +log_file_event "IPAW_INPUT" "$4-resliced" "$1/$4-resliced.img" "$1/$4-resliced.hdr" +log_file_event "IPAW_INPUT" "$5-resliced" "$1/$5-resliced.img" "$1/$5-resliced.hdr" +log_file_event "IPAW_OUTPUT" "$6" "$1/$6.img" "$1/$6.hdr" -- 1.8.2.3