Index: palm/trunk/SCRIPTS/subjob
===================================================================
--- palm/trunk/SCRIPTS/subjob	(revision 1091)
+++ palm/trunk/SCRIPTS/subjob	(revision 1094)
@@ -23,5 +23,5 @@
 # Current revisions:
 # ------------------
-# 
+# new option -P for explicit setting of ssh/scp port
 #
 # Former revisions:
@@ -181,5 +181,5 @@
 
     # PROZEDUROPTIONEN EINLESEN
- while  getopts  :c:dDe:g:h:m:n:N:O:q:t:T:u:vX:  option
+ while  getopts  :c:dDe:g:h:m:n:N:O:P:q:t:T:u:vX:  option
  do
    case  $option  in
@@ -194,4 +194,5 @@
        (N)   node_usage=$OPTARG;;
        (O)   threads_per_task=$OPTARG;;
+       (P)   scp_port=$OPTARG;;
        (q)   no_default_queue=$OPTARG;;
        (t)   cputime=$OPTARG;;
@@ -226,4 +227,5 @@
     printf "\n        -n    jobname                             <jobdatei>"
     printf "\n        -O    threads per task (for OpenMP usage) 1"
+    printf "\n        -P    ssh/scp port                        default port"
     printf "\n        -q    job-queue to be used                default"
     printf "\n        -t    allowed cpu-time in seconds         ---"
@@ -478,9 +480,19 @@
  fi
 
+
     # Calculate number of processes per node
  (( processes_per_node = tasks_per_node * threads_per_task ))
 
+
     # Calculate number of MPI tasks
  (( mpi_tasks = numprocs / threads_per_task ))
+
+
+    # Set port number option for calls of ssh/scp, subjob and batch_scp scripts
+ if [[ "$scp_port" != "" ]]
+ then
+    PORTOPT="-P $scp_port"
+    SSH_PORTOPT="-p $scp_port"
+ fi
 
 
@@ -1207,5 +1219,5 @@
 
           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
+          echo "echo \"batch_scp  $PORTOPT  -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
@@ -1224,5 +1236,5 @@
           echo "set -x"                            >>  $job_to_send
           echo "cd /pf/b/${remote_user}/job_queue" >>  $job_to_send
-          echo "batch_scp  -d  -w 10  -u $local_user $local_addres  $remote_dayfile  \"$job_catalog\"  $local_dayfile"  >>  $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
@@ -1236,5 +1248,5 @@
           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 "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
@@ -1253,5 +1265,5 @@
           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
+          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
@@ -1270,5 +1282,5 @@
           echo ". /usr/share/modules/init/bash"    >>  $job_to_send
           echo "set -x"                            >>  $job_to_send
-          echo "batch_scp  -d  -w 10  -u $local_user $local_addres  ${job_catalog}/$remote_dayfile  \"$job_catalog\"  $local_dayfile"  >>  $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 "%%END%%"                           >>  $job_to_send
@@ -1295,5 +1307,5 @@
           fi
           echo "set -x"                            >>  $job_to_send
-          echo "batch_scp  -d  -w 10  -u $local_user $local_addres  ${job_catalog}/$remote_dayfile  \"$job_catalog\"  $local_dayfile  >  /dev/null"  >>  $job_to_send
+          echo "batch_scp  $PORTOPT  -d  -w 10  -u $local_user $local_addres  ${job_catalog}/$remote_dayfile  \"$job_catalog\"  $local_dayfile  >  /dev/null"  >>  $job_to_send
           echo "[[ \"\$for_subjob_to_do\" != \"\" ]]  &&  eval \$for_subjob_to_do"  >>  $job_to_send
           echo "%%END%%"                           >>  $job_to_send
@@ -1317,10 +1329,10 @@
        then
           echo "mv  scpjob.$kennung  $job_catalog"           >>  $job_to_send
-          echo "ssh ${remote_username}@${remote_addres}  \"$submcom ${job_catalog}/scpjob.$kennung\" "  >>  $job_to_send
+          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 ]]
        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
+          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
        else
           echo "$submcom  scpjob.$kennung"      >>  $job_to_send
@@ -1393,12 +1405,12 @@
              # VERWENDUNG VON SCP AUF DECALPHA FRAGT FEHLERHAFTERWEISE
              # PASSWORT AB
-          /bin/scp  $job_to_send  ${remote_user}@${remote_addres}:${job_catalog}/$job_on_remhost
+          /bin/scp  $PORTOPT  $job_to_send  ${remote_user}@${remote_addres}:${job_catalog}/$job_on_remhost
        elif [[ $remote_host = nech ]]
        then
              # DATEIEN KOENNEN NUR UEBER DEN ARCHIVE-SERVER DES DKRZ
              # TRANSFERIERT WERDEN
-          scp  $job_to_send  ${remote_user}@136.172.44.205:${job_catalog}/$job_on_remhost
+          scp  $PORTOPT  $job_to_send  ${remote_user}@136.172.44.205:${job_catalog}/$job_on_remhost
        else
-          scp  $job_to_send  ${remote_user}@${remote_addres}:${job_catalog}/$job_on_remhost
+          scp  $PORTOPT  $job_to_send  ${remote_user}@${remote_addres}:${job_catalog}/$job_on_remhost
        fi
        if [[ $? = 1 ]]
@@ -1426,10 +1438,10 @@
        then
           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"
+          ssh  $SSH_PORTOPT $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"
+          ssh  $SSH_PORTOPT $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"
+          ssh  $SSH_PORTOPT $remote_addres  -l $remote_user  "cd $job_catalog; $submcom $job_on_remhost; rm $job_on_remhost"
        fi
 
