Index: palm/trunk/SCRIPTS/subjob
===================================================================
--- palm/trunk/SCRIPTS/subjob	(revision 555)
+++ palm/trunk/SCRIPTS/subjob	(revision 622)
@@ -121,4 +121,7 @@
      # 25/08/10 - Siggi - new variable project_account in pbs-statements for
      #                    lcxt4
+     # 08/12/10 - Siggi - initialization of the module command changed for
+     #                    SGI-ICE/lcsgi
+     #                    adjustments for Kyushu Univ. (lcrte, ibmku)
 
 
@@ -144,5 +147,5 @@
 
  typeset  -i   cputime=0  memory=0  Memory=0  minuten  resttime  sekunden  stunden
- typeset  -i   inumprocs  nodes=0  tasks_per_node=0  threads_per_task=1
+ typeset  -i   inumprocs  nodes=0  processes_per_node=0 tasks_per_node=0  threads_per_task=1
  typeset  -L20 spalte1
  typeset  -R40 spalte2
@@ -194,5 +197,4 @@
      (b01*|bicegate1)        local_addres=130.73.232.102; local_host=lcsgib;;
      (bicegate2)             local_addres=130.73.232.103; local_host=lcsgib;;
-     (breg*-en0|berni*-en0)  local_addres=130.73.230.10;  local_host=ibmb;;
      (breva)                 local_addres=130.75.105.98;  local_host=lcmuk;;
      (bicegate2)             local_addres=130.73.232.103; local_host=lcsgib;;
@@ -228,4 +230,5 @@
      (paesano)               local_addres=130.75.105.46;  local_host=lcmuk;;
      (quanero)               local_addres=130.75.105.107; local_host=lcmuk;;
+     (rte*)                  local_addres=133.5.185.60;   local_host=lcrte;;
      (scirocco)              local_addres=172.20.25.41;   local_host=lcmuk;;
      (sun1|sun2)             local_addres=130.75.6.1;     local_host=unics;;
@@ -235,4 +238,5 @@
      (tgg*)                  local_addres=172.17.75.161;  local_host=lctit;;
      (vorias)                local_addres=172.20.25.43;   local_host=lcmuk;;
+     (*.cc.kyushu-u.ac.jp)   local_addres=133.5.4.129;    local_host=ibmku;;
      (*)                     printf "\n  +++ \"$local_host\" unknown";
                              printf "\n      please inform S. Raasch!";
@@ -289,5 +293,5 @@
     printf "\n        -D    only the job-file will be created   ---"
     printf "\n        -h    execution host, available hosts:    $remote_host"
-    printf "\n              ibm, ibmb, ibmh, ibms, ibmy, lcmuk,"
+    printf "\n              ibm, ibmh, ibmku, ibms, ibmy, lc...,"
     printf "\n              lctit, nech, necriam, unics"
     printf "\n        -m    memory demand per process in MByte  ---"
@@ -354,6 +358,6 @@
     case  $remote_host  in
         (ibm)     queue=p690_standard; remote_addres=134.76.99.81; submcom=/usr/lpp/LoadL/full/bin/llsubmit;;
-        (ibmb)    queue=cpar; remote_addres=130.73.230.10; submcom=/usr/lpp/LoadL/full/bin/llsubmit;;
         (ibmh)    queue=no_class; remote_addres=136.172.40.15; submcom=/usr/lpp/LoadL/full/bin/llsubmit;;
+        (ibmku)   queue=s4; remote_addres=133.5.4.129; submcom=/usr/local/bin/llsubmit;;
         (ibms)    queue=p_normal; remote_addres=150.183.5.101; submcom=/usr/lpp/LoadL/full/bin/llsubmit;;
         (ibmy)    queue=parallel; remote_addres=165.132.26.58; submcom=/usr/lpp/LoadL/full/bin/llsubmit;;
@@ -386,10 +390,10 @@
                      (*)                                     error=true;;
                  esac;;
-        (ibmb)   case  $ndq  in
-                     (cdata|cdev|cexp|c1|cshare|csolo|cspec) error=false;;
+        (ibmh)   case  $ndq  in
+                     (no_class)  error=false;;
                      (*)                                     error=true;;
                  esac;;
-        (ibmh)   case  $ndq  in
-                     (no_class)  error=false;;
+        (ibmku)  case  $ndq  in
+                     (sdbg1|sdbg2|sdbg4|s4|s16|s32|s32-s)    error=false;;
                      (*)                                     error=true;;
                  esac;;
@@ -450,12 +454,4 @@
 
 
-    # KNOTENNUTZUNG IN ENTWICKLERQUEUE MUSS SHARED SEIN
- if [[ $node_usage != shared  &&  $queue = cdev ]]
- then
-    node_usage=shared
- fi
-
-
-
     # PRUEFEN DER CPU-ZEIT, ZEIT NACH STUNDEN, MINUTEN UND SEKUNDEN
     # AUFTEILEN
@@ -530,12 +526,9 @@
  if (( tasks_per_node != 0 ))
  then
-    if [[ $(echo $remote_host | cut -c1-5) = lcsgi ]]
-    then
-       (( nodes = numprocs / tasks_per_node ))
-    else
-       (( nodes = numprocs / ( tasks_per_node * threads_per_task ) ))
-    fi
- fi
-
+    (( nodes = numprocs / ( tasks_per_node * threads_per_task ) ))
+ fi
+
+    # Calculate number of processes per node
+ (( processes_per_node = tasks_per_node * threads_per_task ))
 
 
@@ -597,14 +590,18 @@
 
 
-    # QSUB- ODER LL-KOMMANDOS BZW. SKRIPTE  GENERIEREN
+    # Generate the batch job scripts (qsub/msub/LoadLeveler)
  if [[ $(echo $remote_host | cut -c1-3) = ibm  &&  $numprocs != 0 ]]
  then
 
-    if [[ $remote_host = ibmy ]]
-    then
-       consumable_memory=""
-    else
-       consumable_memory="ConsumableMemory($memory mb)"
-    fi
+       # General LoadLeveler settings
+    execute_in_shell="#!/bin/ksh"
+    use_shell="# @ shell = /bin/ksh"
+    consumable_memory="ConsumableMemory($memory mb)"
+    class="# @ class = $queue"
+    environment="# @ environment = OMP_NUM_THREADS=$threads_per_task; MP_SHARED_MEMORY=yes"
+    network_to_use="# @ network.mpi = sn_all,shared,us"
+    data_limit="# @ data_limit = 1.76gb"
+    image_size="# @ image_size = 50"
+
 
     if [[ $remote_host = ibmh ]]
@@ -614,28 +611,25 @@
        class=""
        environment=""
-    else
-       class="# @ class = $queue"
-       environment="# @ environment = OMP_NUM_THREADS=$threads_per_task; MP_SHARED_MEMORY=yes"
-       if [[ $queue = cdev ]]
-       then
-          data_limit="# @ data_limit = 1.76gb"
-          network_to_use="# @ network.mpi = sn_all,shared,ip"
-       else
-          if [[ $remote_host = ibms ]]
-          then
-             network_to_use="# @ network.mpi = csss,shared,us"
-          elif [[ $remote_host = ibmy ]]
-          then
-             network_to_use=""
-          else
-             network_to_use="# @ network.mpi = sn_all,shared,us"
-             data_limit="# @ data_limit = 1.76gb"
-          fi
-       fi
+    elif [[ $remote_host = ibmku ]]
+    then
+       execute_in_shell="#!/usr/bin/ksh"
+       use_shell="# @ shell = /usr/bin/ksh"
+       consumable_memory=""
+       environment=""
+       network_to_use="# @ network.mpi = sn_all,shared,us"
+       data_limit=""
+       image_size=""
+    elif [[ $remote_host = ibms ]]
+    then
+       network_to_use="# @ network.mpi = csss,shared,us"
+    elif [[ $remote_host = ibmy ]]
+    then
+       consumable_memory=""
+       network_to_use=""
     fi
 
     cat > $job_to_send << %%END%%
-#!/bin/ksh
-# @ shell = /bin/ksh
+$execute_in_shell
+$use_shell
 
 # @ job_type = parallel
@@ -645,5 +639,5 @@
 # @ output = $remote_dayfile
 # @ error = $remote_dayfile
-# @ image_size = 50
+$image_size
 $class
 $environment
@@ -659,5 +653,5 @@
        cat >> $job_to_send << %%END%%
 # @ node = $nodes
-# @ tasks_per_node = $tasks_per_node
+# @ tasks_per_node = $processes_per_node
 # @ node_usage = $node_usage
 # @ queue
@@ -721,5 +715,5 @@
 #PBS -A $project_account
 #PBS -l walltime=$timestring
-#PBS -l nodes=${nodes}:ppn=$tasks_per_node
+#PBS -l nodes=${nodes}:ppn=$processes_per_node
 #PBS -l pmem=${memory}mb
 #PBS -m abe
@@ -813,5 +807,5 @@
 #PBS -N $job_name
 #PBS -l walltime=$timestring
-#PBS -l nodes=$nodes:ppn=${tasks_per_node}
+#PBS -l nodes=$nodes:ppn=${processes_per_node}
 #PBS -l naccesspolicy=$node_usage
 #PBS -o $remote_dayfile
@@ -821,5 +815,6 @@
 $email_directive
 
-. /usr/share/modules/init/bash
+eval \`/sw/swdist/bin/modulesinit\`
+#. /usr/share/modules/init/bash
 $module_calls
 
@@ -839,5 +834,6 @@
 $email_directive
 
-. /usr/share/modules/init/bash
+eval \`/sw/swdist/bin/modulesinit\`
+#. /usr/share/modules/init/bash
 $module_calls
 
@@ -859,5 +855,5 @@
 #PBS -l walltime=$timestring
 #PBS -l mppwidth=${numprocs}
-#PBS -l mppnppn=${tasks_per_node}
+#PBS -l mppnppn=${processes_per_node}
 #PBS -m abe
 #PBS -o $remote_dayfile
@@ -927,5 +923,5 @@
 #PBS -l walltime=$timestring
 #PBS -l mppwidth=${numprocs}
-#PBS -l mppnppn=${tasks_per_node}
+#PBS -l mppnppn=${processes_per_node}
 #PBS -m abe
 #PBS -o $remote_dayfile
@@ -962,5 +958,5 @@
        cat > $job_to_send << %%END%%
 #!/bin/ksh
-#PBS -l cpunum_prc=$tasks_per_node,cputim_job=$cputime
+#PBS -l cpunum_prc=$processes_per_node,cputim_job=$cputime
 #PBS -l ${qsubmem}=${Memory}gb
 #PBS -b $nodes
@@ -976,5 +972,5 @@
        cat > $job_to_send << %%END%%
 #!/bin/ksh
-#PBS -l cpunum_prc=$tasks_per_node,cputim_job=$cputime
+#PBS -l cpunum_prc=$processes_per_node,cputim_job=$cputime
 #PBS -l ${qsubmem}=${Memory}gb
 #PBS -o $remote_dayfile
@@ -1072,7 +1068,10 @@
     if [[ $(echo $remote_host | cut -c1-3) = ibm  ||  $(echo $remote_host | cut -c1-5) = lcsgi  ||  $(echo $remote_host | cut -c1-3) = nec  ||  $remote_host = lctit ]]
     then
-       if [[ $remote_host = ibmb  ||  $remote_host = ibmh ]]
+       if [[ $remote_host = ibmh ]]
        then
           return_queue=c1
+       elif [[ $remote_host = ibmku ]]
+       then
+          return_queue=sdbg2
        elif [[ $remote_host = ibms ]]
        then
@@ -1097,5 +1096,11 @@
        then
 
-          echo "echo \"#!/bin/ksh\" >> scpjob.$kennung"               >>  $job_to_send
+          if [[ $remote_host = ibmku ]]
+          then
+             echo "echo \"#!/usr/bin/ksh\" >> scpjob.$kennung"            >>  $job_to_send
+             echo "echo \"# @ shell = /usr/bin/ksh\" >> scpjob.$kennung"  >>  $job_to_send
+          else
+             echo "echo \"#!/bin/ksh\" >> scpjob.$kennung"                >>  $job_to_send
+          fi
           echo "echo \"# @ job_type = serial\" >> scpjob.$kennung"    >>  $job_to_send
           echo "echo \"# @ job_name = transfer\" >> scpjob.$kennung"  >>  $job_to_send
@@ -1116,4 +1121,8 @@
           echo "echo \"set -x\" >> scpjob.$kennung"                   >>  $job_to_send
           echo "echo \"batch_scp  -d  -w 10  -u $local_user  $local_addres  ${job_catalog}/$remote_dayfile  \\\"$job_catalog\\\"  $local_dayfile\" >> scpjob.$kennung"  >>  $job_to_send
+          if [[ $remote_host = ibmku ]]
+          then
+             echo "echo \"rm  scpjob.$kennung\" >> scpjob.$kennung"   >>  $job_to_send
+          fi
           echo "echo \"exit\" >> scpjob.$kennung"                     >>  $job_to_send
 
@@ -1219,5 +1228,8 @@
           echo "qsub  scpjob.$kennung"          >>  $job_to_send
        fi
-       echo "rm  scpjob.$kennung"               >>  $job_to_send
+       if [[ $remote_host != ibmku ]]
+       then
+          echo "rm  scpjob.$kennung"            >>  $job_to_send
+       fi
        if [[ $remote_host = nech ]]
        then
@@ -1243,5 +1255,5 @@
     echo "exit"      >>  $job_to_send
  fi
- if [[ $remote_host = lctit ]]
+ if [[ $remote_host = lctit  ||  $remote_host = ibmku ]]
  then
     echo " "                               >>  $job_to_send
@@ -1316,9 +1328,12 @@
              printf "\n >>> submit with HLRN qos-feature hiprio...\n"
              ssh  $remote_addres  -l $remote_user  "cd $job_catalog; $submcom -l qos=hiprio $job_on_remhost; rm $job_on_remhost"
+          elif [[ $remote_host = ibmku ]]
+          then
+             ssh  $remote_addres  -l $remote_user  "cd $job_catalog; $submcom $job_on_remhost"
           else
              ssh  $remote_addres  -l $remote_user  "cd $job_catalog; $submcom $job_on_remhost; rm $job_on_remhost"
           fi
        else
-             # TIT ERLAUBT NUR DIE AUSFï¿œHRUNG GANZ BESTIMMTER KOMMANDOS
+             # TIT ERLAUBT NUR DIE AUSFUEHRUNG GANZ BESTIMMTER KOMMANDOS
              # MIT SSH, DESHALB AUFRUF PER PIPE
              # UEBERGANGSWEISE CHECK, OB N1GE ENVIRONMENT WIRKLICH VERFUEGBAR
@@ -1365,6 +1380,11 @@
           qsub  $job_on_remhost
        fi
-          # JOBFILE DARF AUF LCTIT NICHT GELOESCHT WERDEN!! GESCHIEHT ERST AM JOBENDE
-       [[ $local_host != lctit ]]  &&  rm  $job_on_remhost
+
+          # 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 ]]
+       then
+          rm  $job_on_remhost
+       fi
        cd  -  > /dev/null
     fi
