Index: palm/trunk/SCRIPTS/subjob
===================================================================
--- palm/trunk/SCRIPTS/subjob	(revision 1047)
+++ palm/trunk/SCRIPTS/subjob	(revision 1090)
@@ -1,3 +1,7 @@
 #!/bin/ksh
+
+# subjob - script for automatic generation and submission of batch-job files
+#          for various batch queuing systems
+
 #--------------------------------------------------------------------------------#
 # This file is part of PALM.
@@ -18,5 +22,7 @@
 #
 # Current revisions:
-# -----------------
+# ------------------
+# adjustments for Kyushu-University computing center (lckyut)
+# old changelog messages removed
 #
 # Former revisions:
@@ -27,145 +33,10 @@
 # code put under GPL (PALM 3.9)
 #
-# subjob - Plot-Shellskript         Version:  @(#)SUBJOB 1.0
-     # Prozedur zum automatischen Generieren von Batch-Jobs, die unter NQS
-     # laufen sollen und deren Ergebnis (Dayfile) zum Job-generierenden
-     # Host zurueckgeschickt werden sollen
-
-
-     # letzte Aenderung:
-     # 29/06/94 - Siggi - Beginn mit Erstellung der Originalversion
-     # 08/07/94 - Siggi - Originalversion abgeschlossen (Version 1.0)
-     # 06/02/98 - Siggi - berte validiert
-     # 27/01/01 - Siggi - ground.yonsei.ac.kr validiert, Jobs zur T3E in Korea
-     #                    moeglich
-     # 08/02/01 - Siggi - alle subjob-Meldungen ins englische uebersetzt
-     # 25/05/02 - Siggi - Unterstuetzung des LoadLeveler
-     # 30/05/02 - Siggi - Validierung fuer ibm-Rechner in Seoul (nobel) sowie
-     #                    allgemeine Anpassungen fuer ibm-Rechner
-     # 15/10/02 - Siggi - Neue Default-Jobklasse (p_normal) fuer IBM in Seoul
-     #                    Ruecktransfer des Jobprotokolls fuer diese
-     #                    Maschine abgeschaltet
-     # 31/10/02 - Siggi - berni validiert
-     # 06/11/02 - Siggi - Neue Jobklassen auf ibmb und ibmh
-     # 08/11/02 - Siggi - quanero validiert
-     # 11/12/02 - Siggi - Notification fuer Transfer-Jobs abgeschaltet
-     # 23/01/03 - Siggi - hostname nobel changed to nobela
-     # 06/02/03 - Siggi - gregale validated
-     # 12/02/03 - Siggi - orkan and maestro validated
-     # 21/02/03 - Siggi - all nobel nodes in Seoul validated
-     # 12/03/03 - Siggi - nec at DKRZ validated
-     # 13/03/03 - Siggi - new nqs resource variable Memory
-     # 07/04/03 - Siggi - processor request option -c on nech needs tasks per
-     #                    node
-     # 11/04/03 - Siggi - network on ibms has attribute "shared"
-     # 31/07/03 - Siggi - nqs2 on nech implemented (provisional: -h nech2)
-     #                    cxxl added to ibmh
-     # 29/08/03 - Siggi - changes in job queues and communication system on
-     #                    ibms
-     # 24/10/03 - Siggi - using alternate hanni address 130.75.4.2
-     # 30/10/03 - Siggi - nech is not supported any more
-     # 10/11/03 - Siggi - nech2 renamed to nech
-     # 20/11/03 - Siggi - submit command on nech changed from qsub.test to qsub
-     # 29/03/04 - Siggi - ground not supported any more, gfdl3 validated
-     # 31/03/04 - Siggi - new option -N for node usage
-     # 12/04/04 - Siggi - scp2 instead of scp used for transfer from decalpha
-     #                    due to error in ssh installation (otherwise a prompt
-     #                    for the password appears)
-     # 23/07/04 - Siggi - changes due to the new berni configuration
-     #                    (federation switch)
-     # 01/09/04 - Gerald  new job-classes on hanni
-     # 08/09/04 - Siggi - hanni IP address changed to 130.75.4.10
-     # 23/11/04 - Siggi - new job class cdata on hanni and berni
-     # 03/12/04 - Siggi - notification on ibm switched of in case of
-     #                    delete_dayfile = true, node usage in cdev set to
-     #                    shared
-     # 16/02/05 - Gerald  hababai validated
-     # 29/03/05 - Micha - new job class channi on hanni
-     # 11/05/05 - Siggi - ConsumableMemory is now required as resource keyword
-     #                    on ibms
-     # 24/05/05 - Siggi - Default queue on ibms changed from p_normal_1.3 to
-     #                    p_normal
-     # 30/06/05 - Siggi - network changed for queue cdev from "us" to "ip"
-     # 12/07/05 - Siggi - in network.mpi on ibmh/ibmb "csss" changed to
-     #                    "sn_all", new job class cexp
-     # 08/09/05 - Siggi - IP-address of gfdl3 changed
-     # 31/10/05 - Siggi - new job class pp on hurricane, serial jobs on
-     #                    hurricane (with -X0)
-     # 01/11/05 - Siggi - missing queue for jobs submitted on nech (for nech)
-     #                    added
-     # 30/12/05 - Siggi - change of IP adresses in subnet 130.75.105
-     # 09/02/06 - Siggi - ibmy admitted
-     # 10/02/06 - Siggi - scp2 changed to /bin/scp on decalpha
-     # 13/04/06 - Siggi - ostria admitted
-     # 18/04/06 - Siggi - new option -O for OpenMP usage
-     # 24/05/06 - Siggi - lctit admitted, ftpjob renamed scpjob
-     # 25/07/06 - Siggi - gfdl5 (ibmy) admitted for submitting jobs
-     # 27/09/06 - Siggi - breg/hreg extended with berni/hanni
-     # 25/10/06 - Siggi - data_limit set to 1.76 GByte on hanni and berni
-     # 28/11/06 - Siggi - levanto admitted
-     # 13/02/07 - Siggi - hpmuk releated code removed
-     # 01/03/07 - Siggi - adjustments for RIAM machines gate and NEC-SX8 (n-sx)
-     # 12/04/07 - Siggi - option -f (filetransfer protocol) removed, scp only
-     # 27/07/07 - Siggi - autan admitted
-     # 03/08/07 - Marcus- lcfimm admitted
-     # 08/10/07 - Siggi - further job classes added for hanni (csoloh...)
-     # 15/10/07 - Siggi - preliminary adjustments for lctit based on Jin's
-     #                    suggestions
-     # 19/10/07 - Marcus- add new optional argument -g group_number
-     # 19/10/07 - Siggi - a ";" was missing in the last change done by Marcus
-     # 30/10/07 - Marcus- further adjustments for queues on lctit
-     # 15/05/08 - Siggi - adjustments for lcxt4 (Bergen Center for Computational
-     #                    Science)
-     # 14/07/08 - Siggi - adjustments for lcsgih
-     # 23/09/08 - Gerald- paesano admitted
-     # 02/10/08 - Siggi - PBS adjustments for lcxt4
-     # 02/03/09 - Siggi - Adjustments for new NEC-SX9 at RIAM
-     # 16/04/09 - Marcus- Adjustments for lcsgib and lcsgih
-     # 21/04/09 - Siggi - adjustments for new IBM at DKRZ, which is now ibmh
-     # 18/05/09 - Siggi - Settings for serial jobs on lcsgi changed
-     # 24/06/09 - BjornM- adjustments for lcxt4 (loading modules manually)
-     # 08/07/09 - Siggi - option -e added (email notification on lcsgih/b)
-     # 20/07/09 - Siggi - On lcsgi, jobs for returning the job protocol are
-     #                    now run on the data nodes (feature=data)
-     # 25/08/09 - BjornM- adapted for lck
-     # 26/08/09 - Marcus- caurus admitted; optional qos feature hiprio on lcsgi
-     # 03/09/09 - Siggi - PBS sgi feature directive only used if explicitly
-     #                    set in the config file by the user
-     # 16/10/09 - Carolin-adjustments for archiving on SGI-ICE of binary files;
-     #                    adding special1q
-     # 01/12/09 - BjornM- re-adjustments for lcxt4, added sno (130.75.105.113)
-     # 16/10/09 - Carolin-adding permq
-     # 01/02/10 - Siggi - adapted for lcxt5m and lckyoto (Fujitsu HX600)
-     # 03/02/10 - Siggi - bug in serial jobs removed
-     # 26/02/10 - BjornM- re-adjustments for lcxt4 (new modules, email
-     #                    notification)
-     # 01/03/10 - Siggi - loading of modules controlled by environment variable
-     #                    module_calls
-     # 17/08/10 - BjornM- re-adjustments for lcxt4 (location of qsub)
-     # 25/08/10 - BjornM- account geofysisk replaced by guest for lcxt4
-     # 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)
-     # 14/12/10 - Siggi - adjustments for new Tsubame system at Tokyo
-     #                    institute of technology (lctit)
-     # 02/02/11 - Siggi - further asjustments for Tsubame concerning openMP
-     # 06/03/11 - Siggi - adjustments for ibmkisti
-     # 17/03/11 - Siggi - adjustments for openmp usage on ibmkisti
-     # 03/04/11 - Micha - added lckordi
-     # 17/08/11 - Siggi - hicegate0 added
-     # 18/08/11 - Siggi - workaround on lcsgi in order to avoid appends to file
-     #                    last_job_transfer_protocol
-     # 21/08/11 - Siggi - inferno admitted
-     # 29/11/11 - Siggi - adjustments for lcsgih/lcsgib queues, pingui admitted
-     # 21/12/11 - Theres- solano admitted
-     # 31/01/12 - Matthias - adjustments for ibmh
-     # 02/05/12 - Bjoern  - lcxt4 is now lcxe6, adjustments for lcxe6, 
-     #                      bugfixes for the parameter file check, initial 
-     #                      commands on ssh calls sourced out to .mrun.config
-     # 02/10/12 - Siggi - adjustments for lcsb
-     # 01/11/12 - Siggi - adjustments for lckiaps
-
+# 08/07/94 - Siggi - first version finished
+# 29/06/94 - Siggi - script development started
+#--------------------------------------------------------------------------------#
+# subjob - script for automatic generation and submission of batch-job files
+#          for various batch queuing systems
+#--------------------------------------------------------------------------------#
 
 
@@ -284,4 +155,5 @@
      (scirocco)              local_addres=172.20.25.41;   local_host=lcmuk;;
      (solano)                local_addres=130.75.105.110; local_host=lcmuk;;
+     (sugoka*)               local_addres=172.31.120.1;   local_host=lckyut;;
      (sun1|sun2)             local_addres=130.75.6.1;     local_host=unics;;
      (sx-*)                  local_addres=172.16.1.131;   local_host=necriam;;
@@ -423,4 +295,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;;
+        (lckyut)  remote_addres=133.5.4.37; submcom=/usr/bin/pjsub;;
         (lcsb)    remote_addres=147.46.30.151; submcom=/usr/torque/bin/qsub;;
         (lctit)   queue=S; remote_addres=10.1.6.165; submcom=/opt/pbs/tools/bin/t2sub;;
@@ -474,4 +347,8 @@
         (lckyoto) case  $ndq  in
                      (eh|ph)                                 error=false;;
+                     (*)                                     error=true;;
+                 esac;;
+        (lckyut) case  $ndq  in
+                     (cx-dbg|cx-single|cx-small|cx-middle|cx-large)  error=false;;
                      (*)                                     error=true;;
                  esac;;
@@ -1134,4 +1011,20 @@
     fi
 
+ elif [[ $remote_host = lckyut ]]
+ then
+    cat > $job_to_send << %%END%%
+#!/bin/bash
+#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
+
+export LANG=en_US.UTF-8
+%%END%%
+
  elif [[ $remote_host = nech ]]
  then
@@ -1251,5 +1144,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 ]]
+    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 ]]
     then
        if [[ $remote_host = ibmh ]]
@@ -1277,4 +1170,7 @@
        then
           return_queue=express
+       elif [[ $remote_host = lckyut ]]
+       then
+          return_queue=cx-single
        else
           return_queue=unknown
@@ -1336,4 +1232,21 @@
           echo "#PBS -j o"                         >>  $job_to_send
           echo " "                                 >>  $job_to_send
+          echo "set -x"                            >>  $job_to_send
+          echo "batch_scp  -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
+          echo "cat > scpjob.$kennung << %%END%%"  >>  $job_to_send
+          echo "#!/bin/bash"                       >>  $job_to_send
+          echo "#PJM -L \"vnode=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  -d  -w 10  -u $local_user $local_addres  $remote_dayfile  \"$job_catalog\"  $local_dayfile"  >>  $job_to_send
@@ -1403,4 +1316,8 @@
           echo "ssh ${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 ]]
+       then
+          echo "scp -P 22 scpjob.$kennung  ${remote_username}@${remote_addres}:job_queue"           >>  $job_to_send
+          echo "ssh -p 22 ${remote_username}@${remote_addres}  \"cd job_queue; $submcom scpjob.$kennung; rm scpjob.$kennung\" "  >>  $job_to_send
        else
           echo "$submcom  scpjob.$kennung"      >>  $job_to_send
@@ -1520,5 +1437,5 @@
        then
           eval  $submcom  $job_on_remhost
-       elif [[  $local_host = lcfimm  ||  $local_host = lctit  ||  $localhost = lcxe6  ||  $localhost = lck  || $localhost = lckordi ||  $localhost = lcyon || $localhost = lcsb ]]
+       elif [[  $local_host = lcfimm  ||  $local_host = lctit  ||  $localhost = lcxe6  ||  $localhost = lck  || $localhost = lckordi ||  $localhost = lcyon || $localhost = lcsb  ||  $localhost = lckyut ]]
        then
           chmod  u+x  $job_on_remhost
