Index: palm/trunk/SCRIPTS/mrun
===================================================================
--- palm/trunk/SCRIPTS/mrun	(revision 2293)
+++ palm/trunk/SCRIPTS/mrun	(revision 2295)
@@ -27,4 +27,8 @@
 # -----------------
 # $Id$
+# adjustments for using lcgeohu (cirrus @ HUB)
+# cpp_opts removed
+# 
+# 2290 2017-06-19 11:03:06Z raasch
 # further test output removed
 # 
@@ -278,5 +282,4 @@
  coupled_dist=""
  coupled_mode="mpi1"
- cpp_opts=""
  cpp_options=""
  cpumax=0
@@ -465,5 +468,5 @@
     # READ SHELLSCRIPT-OPTIONS AND REBUILD THE MRUN-COMMAND STRING (MC),
     # WHICH WILL BE USED TO START RESTART-JOBS
- while  getopts  :a:bBc:Cd:D:Fg:G:h:H:i:kK:m:M:n:o:O:p:P:q:r:R:s:St:T:u:U:vw:xX:yY:zZ option
+ while  getopts  :a:bBc:Cd:Fg:G:h:H:i:kK:m:M:n:o:O:p:P:q:r:R:s:St:T:u:U:vw:xX:yY:zZ option
  do
    case  $option  in
@@ -522,5 +525,5 @@
  then
    (printf "\n  *** mrun can be called as follows:\n"
-    printf "\n      $mrun_script_name  -b -c.. -d.. -D.. -f.. -F -h.. -i.. -I -K.. -m.. -o.. -p.. -r.. -R -s.. -t.. -T.. -v -x -X.. -y -Y.. -Z <modus> \n"
+    printf "\n      $mrun_script_name  -b -c.. -d.. -f.. -F -h.. -i.. -I -K.. -m.. -o.. -p.. -r.. -R -s.. -t.. -T.. -v -x -X.. -y -Y.. -Z <modus> \n"
     printf "\n      Description of available options:\n"
     printf "\n      Option  Description                              Default-Value"
@@ -530,5 +533,4 @@
     printf "\n        -c    configuration file                       .mrun.config"
     printf "\n        -d    base name of files attached to program   test"
-    printf "\n        -D    preprocessor(cpp)-directives             \"\" "
     printf "\n        -F    create remote job file only              ---"
     printf "\n        -h    execution host                           $localhost_realname"
@@ -657,5 +659,5 @@
     do_remote=true
     case  $host  in
-        (ibm|ibmh|ibmkisti|ibmku|ibms|lcbullhh|lccrayb|lccrayh|lccrayf|lceddy|lckyoto|lcocean|unics|lcxe6|lcxt5m|lck|lckiaps|lckordi|lckyuh|lckyut|lcsb)  true;;
+        (ibm|ibmh|ibmkisti|ibmku|ibms|lcbullhh|lccrayb|lccrayh|lccrayf|lceddy|lckyoto|lcocean|unics|lcxe6|lcxt5m|lck|lckiaps|lckordi|lckyuh|lckyut|lcsb|lcgeohu)  true;;
         (*)  printf "\n"
              printf "\n  +++ sorry: execution of batch jobs on remote host \"$host\""
@@ -800,5 +802,5 @@
                    do_remote=true
                    case  $host  in
-                       (ibm|ibmh|ibmkisti|ibmku|ibms|lcbullhh|lccrayb|lccrayh|lccrayf|lceddy|lckyoto|lcocean|unics|lcxe6|lcxt5m|lck|lckiaps|lckordi|lckyuh|lckyut|lcsb)  true;;
+                       (ibm|ibmh|ibmkisti|ibmku|ibms|lcbullhh|lccrayb|lccrayh|lccrayf|lceddy|lckyoto|lcocean|unics|lcxe6|lcxt5m|lck|lckiaps|lckordi|lckyuh|lckyut|lcsb|lcgeohu)  true;;
                        (*)  printf "\n  +++ sorry: execution of batch jobs on remote host \"$host\""
                             printf "\n      is not available"
@@ -1064,5 +1066,5 @@
     do_remote=true
     case  $host  in
-        (ibm|ibmh|ibmkisti|ibmku|ibms|lcbullhh|lccrayb|lccrayh|lccrayf|lceddy|lckyoto|lcocean|unics|lcxe6|lcxt5m|lck|lckiaps|lckordi|lckyuh|lckyut|lcsb)  true;;
+        (ibm|ibmh|ibmkisti|ibmku|ibms|lcbullhh|lccrayb|lccrayh|lccrayf|lceddy|lckyoto|lcocean|unics|lcxe6|lcxt5m|lck|lckiaps|lckordi|lckyuh|lckyut|lcsb|lcgeohu)  true;;
         (*)  printf "\n"
              printf "\n  +++ sorry: execution of batch jobs on remote host \"$host\""
@@ -1202,4 +1204,5 @@
         (lccrayb)    queue=mpp1q;;
         (lccrayh)    queue=mpp1q;;
+        (lcgeohu)    queue=short;;
         (lckiaps)    queue=normal;;
         (lckyoto)    queue=ph;;
@@ -1816,18 +1819,4 @@
     fi
 
-       # SET DIRECTIVES GIVEN BY OPTION -D
-    if [[ -n $cpp_opts ]]
-    then
-       for  popts  in  $cpp_opts
-       do
-          if [[ $(echo $localhost | cut -c1-3) = ibm ]]
-          then
-             cpp_options="${cpp_options},-D__$popts=__$popts"
-          else
-             cpp_options="$cpp_options -D__$popts"
-          fi
-       done
-    fi
-
  else
 
@@ -2390,8 +2379,15 @@
           then
              make $mopts -f Makefile PROG=a.out  F90=$compiler_name  COPT="$cpp_options"  F90FLAGS="$fopts"  LDFLAGS="$lopts"
-	  elif [[ $localhost = lceddy ]]
-          then
-	     which mpifc
+          elif [[ $localhost = lceddy ]]
+          then
+             which mpifc
              make $mopts -f Makefile PROG=a.out  F90=$compiler_name  COPT="$cpp_options"  F90FLAGS="$fopts"  LDFLAGS="$lopts"
+          elif [[ $localhost = lcgeohu ]]
+          then 
+             printf "      compiler is called via ssh on \"cirrus\" \n"
+             ssh  $SSH_PORTOPT  cirrus.geo.hu-berlin.de -l $usern "$init_cmds $module_calls cd $TEMPDIR; make $mopts -f Makefile PROG=a.out F90=$compiler_name COPT=\"$cpp_options\" F90FLAGS=\"$fopts\" LDFLAGS=\"$lopts\" "
+#             this check did not work. Although a.out exists, it sets compile_error to true!
+#             [[ ! -f a.out ]]  &&  compile_error=true
+             continue   # STATUS=1, IF a.out EXISTS
           else
              [[ "$init_cmds" != "" ]]  &&  eval $init_cmds
@@ -2948,7 +2944,10 @@
                    then
                       echo $ii
-		      echo $tasks_per_node
-		      echo $nodes
+                      echo $tasks_per_node
+                      echo $nodes
                       mpirun -n $ii a.out  <  runfile_atmos
+                   elif [[ $host = lcgeohu ]]
+                   then
+                       srun -n $ii a.out  <  runfile_atmos
                    elif [[ $host = lcocean ]]
                    then
@@ -3533,5 +3532,5 @@
        then
 
-          if [[ $localhost = lcbullhh  ||  $localhost = lccrayb  ||  $localhost = lccrayh  ||  $localhost = ibmh  ||  $localhost = ibmkisti  ||  $localhost = ibmku  ||  $localhost = ibms  ||  $localhost = lceddy  ||  $localhost = lckyu*  ||  $localhost = lcxe6 ]]
+          if [[ $localhost = lcbullhh  ||  $localhost = lccrayb  ||  $localhost = lccrayh  ||  $localhost = ibmh  ||  $localhost = ibmkisti  ||  $localhost = ibmku  ||  $localhost = ibms  ||  $localhost = lceddy  ||  $localhost = lckyu*  ||  $localhost = lcxe6  ||  $localhost = lcgeohu ]]
           then
              echo "*** ssh will be used to initiate restart-runs!"
@@ -3574,4 +3573,7 @@
                 then
                    ssh $usern@hlogin1 "ssh $SSH_PORTOPT $return_address -l $return_username \"PATH=\\\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" "
+                elif [[ $localhost = lccgeohu ]]
+                then
+                   ssh $usern@cirrus.geo.hu-berlin.de "ssh $SSH_PORTOPT $return_address -l $return_username \"PATH=\\\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" "
                 else
                    ssh $SSH_PORTOPT $return_address -l $return_username "PATH=\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc "
@@ -3666,5 +3668,4 @@
        # BUILD THE MRUN-COMMAND TO BE CALLED IN THE BATCH-JOB ON THE REMOTE-MACHINE
     mrun_com="$mrun_script_name -a $afname -c $config_file -d $fname -h $host -H $fromhost -m $memory -t $cpumax -q $queue -R $return_address -U $return_username -u $remote_username"
-    [[ "$cpp_opts" != "" ]]       &&  mrun_com=${mrun_com}" -D \"$cpp_opts\""
     [[ "$global_revision" != "" ]]  &&  mrun_com=${mrun_com}" -G \"$global_revision\""
     [[ $group_number != none ]]   &&  mrun_com=${mrun_com}" -g $group_number"
@@ -3772,5 +3773,5 @@
        #              THIS MAY CREATE A QUITE LARGE JOB-FILE, WHICH CAN CAUSE PROBLEMS WITH SOME
        #              QUEUEING-SYSTEMS
-    if [[ $host = ibmkisti  ||  $host = lcbullhh  ||  $host = lccrayb  ||  $host = lccrayf  ||  $host = lccrayh  ||  $host = lcocean ]]
+    if [[ $host = ibmkisti  ||  $host = lcbullhh  ||  $host = lccrayb  ||  $host = lccrayf  ||  $host = lccrayh  ||  $host = lcocean  ||  $host = lcgeohu ]]
     then
 
Index: palm/trunk/SCRIPTS/subjob
===================================================================
--- palm/trunk/SCRIPTS/subjob	(revision 2293)
+++ palm/trunk/SCRIPTS/subjob	(revision 2295)
@@ -28,4 +28,7 @@
 # -----------------
 # $Id$
+# adjustments for using lcgeohu (cirrus @ HUB)
+# 
+# 2266 2017-06-09 09:27:21Z raasch
 # nech related parts removed
 # 
@@ -279,4 +282,5 @@
      (vorias)                local_address=172.20.25.43;   local_host=lcmuk;;
      (*.cc.kyushu-u.ac.jp)   local_address=133.5.4.129;    local_host=ibmku;;
+     (*.cluster)             local_address=192.168.1.254;  local_host=lcgeohu;;
      (*)                     printf "\n  +++ \"$local_host\" unknown";
                              printf "\n      please contact the PALM group at IMUK";
@@ -410,4 +414,5 @@
         (lccrayf) queue=small; remote_address=86.50.166.21; submcom=/opt/slurm/default/bin/sbatch;;
         (lceddy)  remote_address=eddy.hpc.uni-oldenburg.de; submcom=sbatch;;
+        (lcgeohu) remote_address=cirrus.geo.hu-berlin.de; submcom=sbatch;;
         (lckyoto) remote_address=133.3.51.11; submcom=/thin/local/bin/qsub;;
         (lck)     remote_address=165.132.26.61; submcom=/usr/torque/bin/qsub;;
@@ -964,4 +969,47 @@
     fi
 
+ elif [[ $remote_host = lcgeohu ]]
+ then
+
+    if [[ $email_notification = none ]]
+    then
+       notify_user=""
+    else
+       notify_user="#SBATCH --mail-type=ALL"
+    fi
+
+    if [[ $numprocs != 0 ]]
+    then
+       cat > $job_to_send << %%END%%
+#!/bin/bash
+#SBATCH --job-name=$job_name
+#SBATCH --ntasks=$processes_per_node
+#SBATCH --time=$timestring
+#SBATCH --output=$remote_dayfile
+#SBATCH --error=$remote_dayfile
+#SBATCH --qos=short
+$notify_user
+
+$init_cmds
+$module_calls
+
+%%END%%
+
+    else
+       cat > $job_to_send << %%END%%
+#!/bin/bash
+#SBATCH --job-name=$job_name
+#SBATCH --ntasks=$processes_per_node
+#SBATCH --output=$remote_dayfile
+#SBATCH --error=$remote_dayfile
+#SBATCH -l ncpus=1
+
+$init_cmds
+$module_calls
+
+%%END%%
+
+    fi
+
  elif [[ $remote_host = lckiaps ]]
  then
@@ -1223,5 +1271,5 @@
     echo "trap '"                               >>  $job_to_send
     echo "set +vx"                              >>  $job_to_send
-    if [[ $(echo $remote_host | cut -c1-3) = ibm  ||  $remote_host = lcbullhh  ||  $remote_host = lccrayb  ||  $remote_host = lccrayh  ||  $(echo $remote_host | cut -c1-3) = nec  ||  $remote_host = lckiaps  ||  $remote_host = lckyu* || $remote_host = lcxe6  ||  $remote_host = lcocean ]]
+    if [[ $(echo $remote_host | cut -c1-3) = ibm  ||  $remote_host = lcbullhh  ||  $remote_host = lccrayb  ||  $remote_host = lccrayh  ||  $(echo $remote_host | cut -c1-3) = nec  ||  $remote_host = lckiaps  ||  $remote_host = lckyu* || $remote_host = lcxe6  ||  $remote_host = lcocean  || $remote_host = lcgeohu ]]
     then
        if [[ $remote_host = ibmh ]]
@@ -1398,4 +1446,21 @@
           echo "[[ \"\$for_subjob_to_do\" != \"\" ]]  &&  eval \$for_subjob_to_do"  >>  $job_to_send
           echo "%%END%%"                                 >>  $job_to_send
+
+       elif [[ $remote_host = lcgeohu ]]
+       then
+          echo "cat > scpjob.$identifier << %%END%%"        >>  $job_to_send
+          echo "#!/bin/bash"                             >>  $job_to_send
+          echo "#SBATCH --job-name=job_protocol_transfer" >>  $job_to_send
+          echo "#SBATCH -t 00:20:00"                     >>  $job_to_send
+          echo "#SBATCH -N 1"                            >>  $job_to_send
+          echo "#SBATCH -n 1"                            >>  $job_to_send
+          echo "#SBATCH -o \$HOME/job_queue/last_job_transfer_protocol"      >>  $job_to_send
+          echo "#SBATCH -o $remote_dayfile"              >>  $job_to_send
+          echo "#SBATCH -e $remote_dayfile"              >>  $job_to_send
+          echo " "                                       >>  $job_to_send
+          echo "set -x"                                  >>  $job_to_send
+          echo "sbatch  scpjob.$identifier"              >>  $job_to_send
+          echo "%%END%%"                                 >>  $job_to_send
+
        else
 
@@ -1497,4 +1562,8 @@
           job_catalog_save=$job_catalog
           job_catalog=job_queue
+       elif [[ $remote_host = lcgeohu ]]
+       then
+          job_catalog_save=$job_catalog
+          job_catalog=/home/${remote_user}/job_queue
        fi
        scp  $ssh_key  $PORTOPT  $job_to_send  ${remote_user}@${remote_address}:${job_catalog}/$job_on_remhost
@@ -1503,5 +1572,5 @@
           locat=scp; exit
        fi
-       if [[ $remote_host = ibms ]]
+       if [[ $remote_host = ibms  ||  $remote_host = lcgeohu ]]
        then
           job_catalog=$job_catalog_save
@@ -1523,4 +1592,7 @@
        then
           ssh  $SSH_PORTOPT $remote_address  -l $remote_user  "cd $job_catalog; $submcom $job_on_remhost"
+       elif [[ $remote_host = lcgeohu ]]
+       then
+          ssh  $ssh_key  $SSH_PORTOPT $remote_address  -l $remote_user  "cd $job_catalog; $submcom $job_on_remhost"
        else
           ssh  $ssh_key  $SSH_PORTOPT $remote_address  -l $remote_user  "cd $job_catalog; $submcom $job_on_remhost; rm $job_on_remhost"
@@ -1530,5 +1602,5 @@
     else
        cd  $job_catalog
-       if [[ $(echo $local_host | cut -c1-3) = ibm  ||  $(echo $local_host | cut -c1-6) = lccray || $local_host = lceddy ]]
+       if [[ $(echo $local_host | cut -c1-3) = ibm  ||  $(echo $local_host | cut -c1-6) = lccray || $local_host = lceddy || $local_host = lcgeohu ]]
        then
           eval  $submcom  $job_on_remhost
@@ -1549,5 +1621,5 @@
           # JOBFILE MUST NOT BE DELETED ON lctit/ibmku. THIS WILL BE DONE
           # AT THE END OF THE JOB
-       if [[ $local_host != lctit  &&  $local_host != ibmku ]]
+       if [[ $local_host != lctit  &&  $local_host != ibmku  &&  $local_host != lcgeohu ]]
        then
           rm  $job_on_remhost
