Index: palm/trunk/SCRIPTS/subjob
===================================================================
--- palm/trunk/SCRIPTS/subjob	(revision 1096)
+++ palm/trunk/SCRIPTS/subjob	(revision 1099)
@@ -23,5 +23,6 @@
 # Current revisions:
 # ------------------
-# 
+# adjustments for Kyushu-Univeristy computing center (lckyuh - hayaka)
+# and for Forwind cluster (lcflow)
 #
 # Former revisions:
@@ -34,5 +35,5 @@
 #
 # 2013-02-02 07:06:13Z raasch
-# adjustments for Kyushu-University computing center (lckyut)
+# adjustments for Kyushu-University computing center (lckyut - tatara)
 # old changelog messages removed
 #
@@ -128,4 +129,6 @@
      (elephanta)             local_addres=130.75.105.6;   local_host=lcmuk;;
      (fimm.bccs.uib.no)      local_addres=172.20.4.2;     local_host=lcfimm;;
+     (flow01)                local_addres=10.141.255.71;  local_host=lcflow;;
+     (flow02)                local_addres=10.141.255.72;  local_host=lcflow;;
      (node*)                 local_addres=165.132.26.61   local_host=lck;;
    #  (node*)                 local_addres=210.219.61.8    local_host=lckordi;;
@@ -135,4 +138,5 @@
      (gregale)               local_addres=130.75.105.109; local_host=lcmuk;;
      (hababai)               local_addres=130.75.105.108; local_host=lcmuk;;
+     (hayaka*)               local_addres=133.5.4.33;     local_host=lckyuh;;
      (hexagon.bccs.uib.no)   local_addres=129.177.20.113; local_host=lcxe6;;
      (hd1)                   local_addres=130.75.4.104;   local_host=lcsgih;;
@@ -150,4 +154,5 @@
      (login*)                local_addres=118.128.66.223; local_host=lckiaps;;
      (maestro)               local_addres=130.75.105.2;   local_host=lcmuk;;
+     (meller)                local_addres=134.106.74.155; local_host=lcfor;;
      (meteo-login*)          local_addres=193.166.211.144;local_host=lcxt5m;;
      (hexagon*)		     local_addres=129.177.20.113; local_host=lcxe6;;
@@ -156,4 +161,5 @@
      (ostria)                local_addres=130.75.105.106; local_host=lcmuk;;
      (paesano)               local_addres=130.75.105.46;  local_host=lcmuk;;
+     (pcj*)                  local_addres=172.31.120.1;   local_host=lckyut;;
      (pingui)                local_addres=134.106.74.118; local_host=lcfor;;
      (quanero)               local_addres=130.75.105.107; local_host=lcmuk;;
@@ -297,4 +303,5 @@
         (ibmy)    queue=parallel; remote_addres=165.132.26.58; submcom=/usr/lpp/LoadL/full/bin/llsubmit;;
 	(lcfimm)  remote_addres=172.20.4.2; submcom=/opt/torque/bin/qsub;;
+        (lcflow)  remote_addres=10.140.1.71; submcom=/cm/shared/apps/sge/6.2u5p2/bin/lx26-amd64/qsub;;
         (lckyoto) remote_addres=133.3.51.11; submcom=/thin/local/bin/qsub;;
         (lcsgib)  queue=smallq; remote_addres=130.73.232.104; submcom=/opt/moab/bin/msub;;
@@ -303,4 +310,5 @@
         (lckiaps) remote_addres=118.128.66.223; submcom=/cm/shared/apps/pbspro/11.0.2.110766/bin/qsub;;
         (lckordi) remote_addres=210.219.61.8; submcom=/usr/torque/bin/qsub;;
+        (lckyuh)  remote_addres=133.5.4.33; submcom=/usr/bin/pjsub;;
         (lckyut)  remote_addres=133.5.4.37; submcom=/usr/bin/pjsub;;
         (lcsb)    remote_addres=147.46.30.151; submcom=/usr/torque/bin/qsub;;
@@ -349,4 +357,8 @@
                      (*)                                     error=true;;
                  esac;;
+        (lcflow) case  $ndq  in
+                     (cfd_lom_long.q|cfd_him_long.q|cfd_lom_serl.q|cfd_lom_shrt.q|cfd_him_shrt.q)  error=false;;
+                     (*)                                     error=true;;
+                 esac;;
         (lckiaps) case  $ndq  in
                      (express|normal)                        error=false;;
@@ -355,4 +367,8 @@
         (lckyoto) case  $ndq  in
                      (eh|ph)                                 error=false;;
+                     (*)                                     error=true;;
+                 esac;;
+        (lckyuh) case  $ndq  in
+                     (fx-dbg|fx-single|fx-small|fx-middle|fx-large)  error=false;;
                      (*)                                     error=true;;
                  esac;;
@@ -753,4 +769,42 @@
     fi
 
+ elif [[ $remote_host = lcflow ]]
+ then
+    if [ $memory -gt 1900 ]; then
+      use_himem=""
+    else
+      use_himem="#"
+    fi
+    if [[ $numprocs != 0 ]]
+    then
+      pe_set="#$ -pe impi $numprocs"
+    else
+      pe_set="#$ -pe impi 1"
+    fi
+    if [[ $queue = default ]]
+    then
+      queue_set=""
+    else
+      queue_set="#$ -q $queue"
+    fi
+    [[ "$disc_space" = "" ]]  &&  disc_space=50
+
+       cat > $job_to_send << %%END%%
+#!/bin/bash
+#$ -S /bin/bash
+#$ -N $job_name
+#$ -cwd
+#$ -l h_rt=$timestring
+#$ -l h_vmem=${memory}M
+#$ -o $remote_dayfile
+#$ -j y
+$pe_set
+#$ -R y
+${use_himem}#$ -l highmem=true
+#$ -l h_fsize=${disc_space}G
+$queue_set
+
+%%END%%
+
  elif [[ $remote_host = lck || $remote_host = lckordi || $remote_host = lcsb ]]
  then
@@ -1029,16 +1083,33 @@
     fi
 
- elif [[ $remote_host = lckyut ]]
+ elif [[ $remote_host = lckyuh ]]
  then
     cat > $job_to_send << %%END%%
 #!/bin/bash
+#PJM -L "rscgrp=$queue"
+#PJM -L "node=$nodes"
+#PJM --mpi "proc=$numprocs"
+#PJM -L "elapse=$timestring"
+#PJM -o $remote_dayfile
+#PJM -j
+#PJM -X
+#PJM --no-stging
+
+export LANG=en_US.UTF-8
+%%END%%
+
+ elif [[ $remote_host = lckyut ]]
+ then
+    cat > $job_to_send << %%END%%
+#!/bin/bash
+#PJM -L "rscgrp=$queue"
 #PJM -L "vnode=$numprocs"
 #PJM -L "vnode-core=1"
-#PJM -L "rscgrp=$queue"
-#PJM --no-stging
 #PJM -L "elapse=$timestring"
 #PJM --mpi proc=$numprocs
 #PJM -o $remote_dayfile
 #PJM -j
+#PJM -X
+#PJM --no-stging
 
 export LANG=en_US.UTF-8
@@ -1162,5 +1233,5 @@
     echo "trap '"                               >>  $job_to_send
     echo "set +vx"                              >>  $job_to_send
-    if [[ $(echo $remote_host | cut -c1-3) = ibm  ||  $(echo $remote_host | cut -c1-5) = lcsgi  ||  $(echo $remote_host | cut -c1-3) = nec  ||  $remote_host = lckiaps  ||  $remote_host = lckyut ]]
+    if [[ $(echo $remote_host | cut -c1-3) = ibm  ||  $(echo $remote_host | cut -c1-5) = lcsgi  ||  $(echo $remote_host | cut -c1-3) = nec  ||  $remote_host = lcflow  ||  $remote_host = lckiaps  ||  $remote_host = lckyu* ]]
     then
        if [[ $remote_host = ibmh ]]
@@ -1188,4 +1259,7 @@
        then
           return_queue=express
+       elif [[ $remote_host = lckyuh ]]
+       then
+          return_queue=cx-single
        elif [[ $remote_host = lckyut ]]
        then
@@ -1255,4 +1329,21 @@
           echo "%%END%%"                           >>  $job_to_send
 
+       elif [[ $remote_host = lckyuh ]]
+       then
+          echo "cat > scpjob.$kennung << %%END%%"  >>  $job_to_send
+          echo "#!/bin/bash"                       >>  $job_to_send
+          echo "#PJM -L \"node=1\""                >>  $job_to_send
+          echo "#PJM -L \"rscgrp=$return_queue\""  >>  $job_to_send
+          echo "#PJM --no-stging"                  >>  $job_to_send
+          echo "#PJM -L \"elapse=30:00\""          >>  $job_to_send
+          echo "#PJM -o \$HOME/job_queue/last_job_transfer_protocol"  >>  $job_to_send
+          echo "#PJM -j"                           >>  $job_to_send
+          echo " "                                 >>  $job_to_send
+          echo "export LANG=en_US.UTF-8"           >>  $job_to_send
+          echo "set -x"                            >>  $job_to_send
+          echo "batch_scp  $PORTOPT  -d  -w 10  -u $local_user $local_addres  $remote_dayfile  \"$job_catalog\"  $local_dayfile"  >>  $job_to_send
+          echo "[[ \"\$for_subjob_to_do\" != \"\" ]]  &&  eval \$for_subjob_to_do"  >>  $job_to_send
+          echo "%%END%%"                           >>  $job_to_send
+
        elif [[ $remote_host = lckyut ]]
        then
@@ -1288,4 +1379,27 @@
           echo "[[ \"\$for_subjob_to_do\" != \"\" ]]  &&  eval \$for_subjob_to_do"  >>  $job_to_send
           echo "%%END%%"                           >>  $job_to_send
+
+       elif [[ $remote_host = lcflow ]]
+       then
+          echo "cat > scpjob.${kennung}.tmp << %%END%%"                  >>  $job_to_send
+          echo "#!/bin/bash"                                             >>  $job_to_send
+          echo "SGEPREFIX -S /bin/bash"                                  >>  $job_to_send
+          echo "SGEPREFIX -N transfer_$job_name"                         >>  $job_to_send
+          echo "SGEPREFIX -cwd"                                          >>  $job_to_send
+          echo "SGEPREFIX -l h_rt=01:00:00"                              >>  $job_to_send
+          echo "SGEPREFIX -l h_vmem=100M"                                >>  $job_to_send
+          echo "SGEPREFIX -j y"                                          >>  $job_to_send
+          echo "SGEPREFIX -o ${local_host}_${job_name}_scpjob_$kennung"  >>  $job_to_send 
+          echo " "                                                       >>  $job_to_send 
+          echo "set -x"                                                  >>  $job_to_send 
+          echo "export PALM_BIN=$PALM_BIN" | sed -e 's:'$HOME':$HOME:'   >>  $job_to_send
+          echo "export PATH=\$PATH:\$PALM_BIN"                           >>  $job_to_send
+          echo ""                                 >>  $job_to_send         
+          echo "batch_scp  $PORTOPT  -d  -w 10  -u $local_user $local_addres  ${job_catalog}/$remote_dayfile  \"$job_catalog\"  $local_dayfile"  >>  $job_to_send
+          echo "[[ \"\$for_subjob_to_do\" != \"\" ]]  &&  eval \$for_subjob_to_do"  >>  $job_to_send
+          echo "rm -f scpjob.${kennung}"                                 >>  $job_to_send         
+          echo "%%END%%"                                                 >>  $job_to_send
+          echo "sed -e 's/SGEPREFIX/#$/g' scpjob.${kennung}.tmp > scpjob.${kennung}" >>  $job_to_send         
+          echo "rm -f scpjob.${kennung}.tmp"                             >>  $job_to_send         
 
        else
@@ -1334,8 +1448,12 @@
           echo "ssh $SSH_PORTOPT ${remote_username}@${remote_addres}  \"$submcom ${job_catalog}/scpjob.$kennung\" "  >>  $job_to_send
           echo "rm  ${job_catalog}/scpjob.$kennung"          >>  $job_to_send
-       elif [[ $remote_host = lckyut ]]
+       elif [[ $remote_host = lckyu* ]]
        then
           echo "scp $PORTOPT scpjob.$kennung  ${remote_username}@${remote_addres}:job_queue"           >>  $job_to_send
           echo "ssh $SSH_PORTOPT ${remote_username}@${remote_addres}  \"cd job_queue; $submcom scpjob.$kennung; rm scpjob.$kennung\" "  >>  $job_to_send
+       elif [[ $remote_host = lcflow ]]
+       then
+          echo "mv  scpjob.$kennung  $job_catalog"           >>  $job_to_send
+          echo "ssh ${remote_username}@${remote_addres}  \"$init_cmds $module_calls cd $job_catalog; $submcom scpjob.$kennung\" "  >>  $job_to_send
        else
           echo "$submcom  scpjob.$kennung"      >>  $job_to_send
@@ -1370,5 +1488,5 @@
 
     # remove job file
- if [[ $remote_host = lctit  ||  $remote_host = ibmku ]]
+ if [[ $remote_host = lctit  ||  $remote_host = ibmku  ||  $remote_host = lcflow ]]
  then
     echo " "                               >>  $job_to_send
@@ -1440,4 +1558,7 @@
        then
           ssh  $SSH_PORTOPT $remote_addres  -l $remote_user  "cd $job_catalog; $submcom $job_on_remhost"
+       elif [[ $remote_host = lcflow ]]
+       then
+          ssh  $SSH_PORTOPT $remote_addres  -l $remote_user  "$init_cmds $module_calls cd $job_catalog; $submcom $job_on_remhost"
        else
           ssh  $SSH_PORTOPT $remote_addres  -l $remote_user  "cd $job_catalog; $submcom $job_on_remhost; rm $job_on_remhost"
@@ -1450,5 +1571,5 @@
        then
           eval  $submcom  $job_on_remhost
-       elif [[  $local_host = lcfimm  ||  $local_host = lctit  ||  $localhost = lcxe6  ||  $localhost = lck  || $localhost = lckordi ||  $localhost = lcyon || $localhost = lcsb  ||  $localhost = lckyut ]]
+       elif [[  $local_host = lcfimm  ||  $local_host = lctit  ||  $localhost = lcxe6  ||  $localhost = lck  || $localhost = lckordi ||  $localhost = lcyon || $localhost = lcsb  ||  $localhost = lckyu* ]]
        then
           chmod  u+x  $job_on_remhost
@@ -1469,5 +1590,5 @@
           # Jobfile must not be deleted on lctit/ibmku!! This will be done
           # only at the end of the job.
-       if [[ $local_host != lctit  &&  $local_host != ibmku ]]
+       if [[ $local_host != lctit  &&  $local_host != ibmku  &&  $local_host != lcflow ]]
        then
           rm  $job_on_remhost
@@ -1483,5 +1604,5 @@
  if [[ $no_submit = false ]]
  then
-    rm  $job_to_send
+    rm  -f $job_to_send
  fi
  [[ $verify = true ]]  &&  printf "\n\n *** SUBJOB finished \n\n"
