Ignore:
Timestamp:
Sep 10, 2018 9:07:06 AM (6 years ago)
Author:
raasch
Message:

host identifier in header output renamed config. identifier, host_configuration renamed configuration_identifier, jobname renamed run_identifier, palmbuild: header output of PALM code revision, options -m, -s, and -S removed, palmrun: run_id renamed run_id_number, job_id renamed run_id, option -r renamed -i

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SCRIPTS/palmrun

    r3151 r3236  
    2727# -----------------
    2828# $Id$
     29# warning issued in case of file connection file version mismatch,
     30# host_configuration renamed configuration_identifier,
     31# "host identifier" in header output renamed "config. identifier",
     32# jobname renamed run_identifier,
     33# run_id renamed run_id_number
     34# job_id renamed run_id
     35# option -r renamed -i
     36#
     37# 3151 2018-07-19 08:45:38Z raasch
    2938# removed additional listing of files to be compiled, print PALM code revision
    3039# in header
     
    170179 compiler_name_ser=""
    171180 compiler_options=""
     181 configuration_identifier="default"
    172182 cores=1
    173183 cores_atmos=0
     
    188198 execution_error=false
    189199 fileconnection_file=trunk/SCRIPTS/.palm.iofiles
    190  jobname=test
    191200 global_revision=""
    192  host_configuration="default"
    193201 hostfile=""
    194202 hp=""
     
    221229 run_coupled_model=false
    222230 run_id=""
     231 run_id_number=""
     232 run_identifier=test
    223233 silent=false
    224234 source_list=""
     
    267277    # READ SHELLSCRIPT-OPTIONS AND REBUILD THE PALMRUN-COMMAND STRING (prc),
    268278    # WHICH WILL BE USED TO START RESTART-JOBS
    269  while  getopts  :a:A:bBCd:FG:h:jkm:M:O:q:r:R:s:t:T:u:U:vVw:W:xX:yY:Z option
     279 while  getopts  :a:A:bBCd:FG:h:i:jkm:M:O:q:R:s:t:T:u:U:vVw:W:xX:yY:Z option
    270280 do
    271281   case  $option  in
     
    275285       (B)   delete_temporary_catalog=false; prc="$prc -B";;
    276286       (C)   restart_run=true; prc="$prc -C";;
    277        (d)   jobname=$OPTARG; prc="$prc -d$OPTARG";;
     287       (d)   run_identifier=$OPTARG; prc="$prc -d$OPTARG";;
    278288       (F)   create_jobfile_only=true;;
    279289       (G)   global_revision=$OPTARG; prc="$prc -G'$OPTARG'";;
    280        (h)   host_configuration=$OPTARG; prc="$prc -h$OPTARG";;
     290       (h)   configuration_identifier=$OPTARG; prc="$prc -h$OPTARG";;
     291       (i)   run_id_number=$OPTARG;;
    281292       (j)   running_in_batch_mode=true;;
    282293       (k)   keep_data_from_previous_run=true; prc="$prc -k";;
     
    285296       (O)   use_openmp=true; threads_per_task=$OPTARG; prc="$prc -O$OPTARG";;
    286297       (q)   queue=$OPTARG; prc="$prc -q$OPTARG";;
    287        (r)   run_id=$OPTARG;;
    288298       (R)   return_address=$OPTARG;;
    289299       (s)   source_list=$OPTARG;;
     
    367377
    368378
    369     # FOR COMPATIBILITY REASONS SET OLD ENVIRONMENT VARIABLE
    370  export fname=$jobname
     379    # FOR COMPATIBILITY REASONS SET OLD ENVIRONMENT VARIABLES
     380 export fname=$run_identifier
     381 export jobname=$run_identifier
    371382
    372383
    373384    # BUILD THE CONFIGURATION-FILE NAME AND THE SOURCES_FOR_RUN-FOLDER NAME
    374  config_file=.palm.config.$host_configuration
    375  sources_for_run_catalog=SOURCES_FOR_RUN_${host_configuration}_$jobname
     385 config_file=.palm.config.$configuration_identifier
     386 sources_for_run_catalog=SOURCES_FOR_RUN_${configuration_identifier}_$run_identifier
    376387
    377388
     
    389400 if [[ -f .palm.iofiles ]]
    390401 then
     402
     403       # CHECK VERSION MISMATCH
     404    if [[ $running_in_batch_mode != true ]]
     405    then
     406       if [[ $(head -n1 $fileconnection_file) != $(head -n1 .palm.iofiles) ]]
     407       then
     408          printf "\n\n  +++ WARNING: A file connection file has been found in your"
     409          printf "\n               working directory, but its revision does not match"
     410          printf "\n               the revision of the default (trunk) version."
     411          printf "\n               You may need to update your connection file!"
     412       fi
     413    fi
     414
    391415    fileconnection_file=.palm.iofiles
     416
    392417 fi
    393418
     
    11241149       eval filename=${pathin_pre[$i]}/${endin_pre[$i]}
    11251150    else
    1126        eval filename=${pathin_pre[$i]}/${jobname}${endin_pre[$i]}
     1151       eval filename=${pathin_pre[$i]}/${run_identifier}${endin_pre[$i]}
    11271152    fi
    11281153
     
    11561181    else
    11571182
    1158           # FIRST CHECK FOR MULTIPLE NAMES WITH THE SAME BASENAME ($jobname) AND
    1159           # CREATE A LIST FOR THE DETECTED BASENAME ENDINGS
     1183          # FIRST CHECK FOR MULTIPLE NAMES WITH THE SAME BASENAME
     1184          # ($run_identifier) AND CREATE A LIST FOR THE DETECTED BASENAME
     1185          # ENDINGS
    11601186       if [[ "${multin[$i]}" = true ]]
    11611187       then
     
    11851211              fi
    11861212
    1187                  # remove the jobname from the beginning
    1188               length_jobname=${#jobname}
    1189               ending=${basefilename:${length_jobname}}
     1213                 # remove the run_identifier from the beginning
     1214              length_run_identifier=${#run_identifier}
     1215              ending=${basefilename:${length_run_identifier}}
    11901216
    11911217                 # remove the ending given in the .iofiles from the beginning
     
    12491275             eval filename=${pathin[$nr_of_input_files]}/${endin[$nr_of_input_files]}
    12501276          else
    1251              eval filename=${pathin[$nr_of_input_files]}/${jobname}${endin[$nr_of_input_files]}
     1277             eval filename=${pathin[$nr_of_input_files]}/${run_identifier}${endin[$nr_of_input_files]}
    12521278          fi
    12531279
     
    13291355                frelin[$nr_of_input_files]=${endin[$nr_of_input_files]}.$cyclestring
    13301356             else
    1331                 frelin[$nr_of_input_files]=${jobname}${endin[$nr_of_input_files]}.$cyclestring
     1357                frelin[$nr_of_input_files]=${run_identifier}${endin[$nr_of_input_files]}.$cyclestring
    13321358             fi
    13331359          else
     
    13361362                frelin[$nr_of_input_files]=${endin[$nr_of_input_files]}
    13371363             else
    1338                 frelin[$nr_of_input_files]=${jobname}${endin[$nr_of_input_files]}
     1364                frelin[$nr_of_input_files]=${run_identifier}${endin[$nr_of_input_files]}
    13391365             fi
    13401366          fi
     
    13701396       fi
    13711397       (( maxcycle = 0 ))
    1372        eval filename=${pathout_pre[$i]}/${jobname}${endout_pre[$i]}
     1398       eval filename=${pathout_pre[$i]}/${run_identifier}${endout_pre[$i]}
    13731399       eval catalogname=${pathout_pre[$i]}
    13741400       if ! ls $filename* 1>/dev/null 2>&1
     
    14161442 if [[ $running_in_batch_mode = false ]]
    14171443 then
    1418     run_id=$RANDOM
    1419     job_id=${jobname}.$run_id
    1420 
    1421     tempdir=$fast_io_catalog/$job_id
     1444    run_id_number=$RANDOM
     1445    run_id=${run_identifier}.$run_id_number
     1446
     1447    tempdir=$fast_io_catalog/$run_id
    14221448 fi
    14231449
     
    15111537 if [[ $create_remote_batch_job = true ]]
    15121538 then
    1513     column1="execution on:"; column2="$host_configuration (username: $remote_username)"
     1539    column1="execution on:"; column2="$configuration_identifier (username: $remote_username)"
    15141540 else
    15151541    if [[ $running_on_remote = true ]]
    15161542    then
    1517        column1="host identifier:"; column2="$host_configuration (execute on IP: $remote_ip)"
     1543       column1="config. identifier:"; column2="$configuration_identifier (execute on IP: $remote_ip)"
    15181544    else
    1519        column1="host identifier:"; column2="$host_configuration (execute on IP: $local_ip)"
     1545       column1="config. identifier:"; column2="$configuration_identifier (execute on IP: $local_ip)"
    15201546    fi
    15211547 fi
     
    16621688 fi
    16631689 printf "|                                                                        | \n"
    1664  column1="run identifier:"; column2=$jobname
     1690 column1="run identifier:"; column2=$run_identifier
    16651691 printf "| %-25s%-45s | \n" "$column1" "$column2"
    16661692 column1="activation string list:"; column2=$(echo $activation_string_list)
     
    17801806
    17811807       line=`grep %base_directory $config_file`
    1782        make_depository=`echo $line | cut -d" " -s -f2`/MAKE_DEPOSITORY_${host_configuration}
    1783        echo  "[[ ! -d ${make_depository} ]]  &&  echo depository not found" | ssh  -q  $ssh_key  ${remote_username}@${remote_ip} 2>&1  | tee ${host_configuration}_last_make_protokoll
    1784 
    1785        if [[ $(grep -c "depository not found" ${host_configuration}_last_make_protokoll) != 0 ]]
     1808       make_depository=`echo $line | cut -d" " -s -f2`/MAKE_DEPOSITORY_${configuration_identifier}
     1809       echo  "[[ ! -d ${make_depository} ]]  &&  echo depository not found" | ssh  -q  $ssh_key  ${remote_username}@${remote_ip} 2>&1  | tee ${configuration_identifier}_last_make_protokoll
     1810
     1811       if [[ $(grep -c "depository not found" ${configuration_identifier}_last_make_protokoll) != 0 ]]
    17861812       then
    17871813          printf "\n\n  +++ make depository \"${make_depository}\""
     
    17891815          ask_for_make_depository=true
    17901816       fi
    1791        rm ${host_configuration}_last_make_protokoll
     1817       rm ${configuration_identifier}_last_make_protokoll
    17921818
    17931819    else
    17941820
    17951821          # CHECK FOR MAKE_DEPOSITORY ON THE LOCAL HOST
    1796        make_depository=${base_directory}/MAKE_DEPOSITORY_${host_configuration}
     1822       make_depository=${base_directory}/MAKE_DEPOSITORY_${configuration_identifier}
    17971823       if [[ ! -d ${make_depository} ]]
    17981824       then
     
    18261852       if [[ $do_trace = true ]]
    18271853       then
    1828           palmbuild  -h $host_configuration
     1854          palmbuild  -h $configuration_identifier
    18291855       else
    1830           palmbuild  -v  -h $host_configuration
     1856          palmbuild  -v  -h $configuration_identifier
    18311857       fi
    18321858
     
    18451871
    18461872       # NOW CREATE THE SOURCES_FOR_RUN FOLDER
    1847     palmbuild  -v  $use_existing_sources_folder  -h $host_configuration  -d $jobname
     1873    palmbuild  -v  $use_existing_sources_folder  -h $configuration_identifier  -d $run_identifier
    18481874
    18491875    if [[ $? != 0 ]]
     
    21102136       # (FILE ENVPAR WILL BE READ BY PALM)
    21112137    cat  >  ENVPAR  <<  EOF
    2112  &envpar  run_identifier = '$jobname', host = '$host_configuration',
     2138 &envpar  run_identifier = '$run_identifier', host = '$configuration_identifier',
    21132139          write_svf = .${write_svf}., write_binary = .${write_binary}.,
    21142140          read_svf = .${read_svf}., tasks_per_node = $tasks_per_node,
     
    23612387       then
    23622388
    2363           eval filename=${pathout[$i]}/${jobname}${endout[$i]}
     2389          eval filename=${pathout[$i]}/${run_identifier}${endout[$i]}
    23642390
    23652391             # DETERMINE THE CYCLE NUMBER
     
    25032529                transfer_failed=false
    25042530                printf "\n  >>> OUTPUT: ${localout[$i]}$catalog_string  $append_string by SCP to"
    2505                 printf "\n              ${pathout[$i]}/${host_configuration}_${jobname}${endout[$i]}$catalog_string\n"
     2531                printf "\n              ${pathout[$i]}/${configuration_identifier}_${run_identifier}${endout[$i]}$catalog_string\n"
    25062532
    25072533                   # TRANSFER VIA SCP
    25082534                if [[ "$remote_loginnode" != "" ]]
    25092535                then
    2510                    echo "cd $tempdir; ${fast_io_catalog}/${sources_for_run_catalog}/batch_scp $PORTOPT $catalog_option $append_option -b -m $usecycle_option -u $local_username $return_address  ${localout[$i]} \"${pathout[$i]}\" ${host_configuration}_${jobname}${endout[$i]}  ${extout[$i]}"  |  ssh -q $remote_username@$remote_loginnode
     2536                   echo "cd $tempdir; ${fast_io_catalog}/${sources_for_run_catalog}/batch_scp $PORTOPT $catalog_option $append_option -b -m $usecycle_option -u $local_username $return_address  ${localout[$i]} \"${pathout[$i]}\" ${configuration_identifier}_${run_identifier}${endout[$i]}  ${extout[$i]}"  |  ssh -q $remote_username@$remote_loginnode
    25112537                else
    2512                    batch_scp $PORTOPT $catalog_option $append_option -b -m $usecycle_option -u $local_username $return_address  ${localout[$i]} "${pathout[$i]}" ${host_configuration}_${jobname}${endout[$i]}  ${extout[$i]}
     2538                   batch_scp $PORTOPT $catalog_option $append_option -b -m $usecycle_option -u $local_username $return_address  ${localout[$i]} "${pathout[$i]}" ${configuration_identifier}_${run_identifier}${endout[$i]}  ${extout[$i]}
    25132539                fi
    25142540                [[ $? != 0 ]]  &&  transfer_failed=true
     
    25192545                then
    25202546                   printf "  +++ transfer failed. Trying to save a copy on this host under:\n"
    2521                    printf "      ${pathout[$i]}/${host_configuration}_${jobname}${endout[$i]}_$run_id\n"
     2547                   printf "      ${pathout[$i]}/${configuration_identifier}_${run_identifier}${endout[$i]}_$run_id_number\n"
    25222548
    25232549                      # FIRST CHECK, IF DIRECTORY EXISTS, AND CREATE IT, IF NECESSARY
     
    25292555                      mkdir -p  $local_catalog
    25302556                   fi
    2531                    eval  cp  ${localout[$i]}  ${pathout[$i]}/${host_configuration}_${jobname}${endout[$i]}_$run_id
     2557                   eval  cp  ${localout[$i]}  ${pathout[$i]}/${configuration_identifier}_${run_identifier}${endout[$i]}_$run_id_number
    25322558                   transfer_problems=true
    25332559                fi
     
    27552781
    27562782       # BUILD THE PALMRUN-COMMAND TO BE CALLED IN THE BATCH-JOB
    2757     palmrun_com="$palmrun_script_name -d $jobname -h $host_configuration -m $memory -t $cpumax -q $queue -r $run_id -U $local_username"
     2783    palmrun_com="$palmrun_script_name -d $run_identifier -h $configuration_identifier -m $memory -t $cpumax -q $queue -i $run_id_number -U $local_username"
    27582784    [[ "$activation_string_list" != "" ]]  &&  palmrun_com=${palmrun_com}" -a \"$activation_string_list\""
    27592785    [[ "$global_revision" != "" ]]  &&  palmrun_com=${palmrun_com}" -G \"$global_revision\""
     
    27882814       # DETERMINE THE FULL PATHS FOR THE JOB PROTOCOL FILES ON THE LOCAL AND
    27892815       # REMOTE HOST
    2790     job_protocol_file_local=${local_jobcatalog}/${host_configuration}_${job_id}
     2816    job_protocol_file_local=${local_jobcatalog}/${configuration_identifier}_${run_id}
    27912817    job_protocol_file=$job_protocol_file_local
    27922818    if [[ $create_remote_batch_job = true ]]
    27932819    then
    2794        job_protocol_file_remote=${remote_jobcatalog}/${host_configuration}_${job_id}
     2820       job_protocol_file_remote=${remote_jobcatalog}/${configuration_identifier}_${run_id}
    27952821       job_protocol_file=$job_protocol_file_remote
    27962822       job_transfer_protocol_file=${remote_jobcatalog}/last_job_transfer_protocol
    2797        scpjob_file=${remote_jobcatalog}/scpjob.$run_id
     2823       scpjob_file=${remote_jobcatalog}/scpjob.$run_id_number
    27982824    fi
    27992825
    28002826
    28012827       # BUILD THE JOB-SCRIPTS ON FILE jobfile
    2802     jobfile=jobfile.$run_id
     2828    jobfile=jobfile.$run_id_number
    28032829
    28042830
     
    28192845    if [[ $create_remote_batch_job = true ]]
    28202846    then
    2821        echo "set +vx"                              >>  $jobfile
    2822        echo "trap '"                               >>  $jobfile
    2823        echo "set +vx"                              >>  $jobfile
    2824        echo "cd ${remote_jobcatalog}"              >>  $jobfile
    2825        echo "cat >  scpjob.$run_id << %%END%%"     >>  $jobfile
     2847       echo "set +vx"                                   >>  $jobfile
     2848       echo "trap '"                                    >>  $jobfile
     2849       echo "set +vx"                                   >>  $jobfile
     2850       echo "cd ${remote_jobcatalog}"                   >>  $jobfile
     2851       echo "cat >  scpjob.$run_id_number << %%END%%"   >>  $jobfile
    28262852
    28272853          # ADD THE BATCH DIRECTIVES
     
    28372863
    28382864       echo "set -x"                               >>  $jobfile
    2839        echo "${fast_io_catalog}/${sources_for_run_catalog}/batch_scp  $PORTOPT  -d  -w 10  -u $local_username $local_ip  $job_protocol_file_remote  \"$local_jobcatalog\"  ${host_configuration}_${jobname}"  >>  $jobfile
     2865       echo "${fast_io_catalog}/${sources_for_run_catalog}/batch_scp  $PORTOPT  -d  -w 10  -u $local_username $local_ip  $job_protocol_file_remote  \"$local_jobcatalog\"  ${configuration_identifier}_${run_identifier}"  >>  $jobfile
    28402866       echo "%%END%%"                              >>  $jobfile
    28412867       echo "echo \" *** submitting job for transfering the job protocol file to $local_ip\" "  >>  $jobfile
     
    29162942          if [[ $do_trace = true ]]
    29172943          then
    2918              echo "     scp $ssh_key $PORTOPT $jobfile ${remote_username}@${remote_ip}:${remote_jobcatalog}/${host_configuration}_${job_id}"
    2919           fi
    2920           scp $ssh_key $PORTOPT $jobfile ${remote_username}@${remote_ip}:${remote_jobcatalog}/${host_configuration}_${job_id}  >  /dev/null
     2944             echo "     scp $ssh_key $PORTOPT $jobfile ${remote_username}@${remote_ip}:${remote_jobcatalog}/${configuration_identifier}_${run_id}"
     2945          fi
     2946          scp $ssh_key $PORTOPT $jobfile ${remote_username}@${remote_ip}:${remote_jobcatalog}/${configuration_identifier}_${run_id}  >  /dev/null
    29212947
    29222948          printf " *** submit the job (output of submit command, e.g. the job-id, may follow)"
    29232949          if [[ $do_trace = true ]]
    29242950          then
    2925              echo "     cd $remote_jobcatalog; $submit_command ${host_configuration}_${job_id}; rm ${host_configuration}_${job_id}  |  ssh  -q  $ssh_key $SSH_PORTOPT  ${remote_username}@${remote_ip}  2>&1"
    2926           fi
    2927           echo "cd $remote_jobcatalog; $submit_command ${host_configuration}_${job_id}; rm ${host_configuration}_${job_id}"  |  ssh  -q  $ssh_key $SSH_PORTOPT  ${remote_username}@${remote_ip}  2>&1
     2951             echo "     cd $remote_jobcatalog; $submit_command ${configuration_identifier}_${run_id}; rm ${configuration_identifier}_${run_id}  |  ssh  -q  $ssh_key $SSH_PORTOPT  ${remote_username}@${remote_ip}  2>&1"
     2952          fi
     2953          echo "cd $remote_jobcatalog; $submit_command ${configuration_identifier}_${run_id}; rm ${configuration_identifier}_${run_id}"  |  ssh  -q  $ssh_key $SSH_PORTOPT  ${remote_username}@${remote_ip}  2>&1
    29282954
    29292955       elif [[ $create_batch_job = true ]]
     
    29312957
    29322958          eval  local_jobcatalog=$local_jobcatalog
    2933           cp  $jobfile  ${local_jobcatalog}/${host_configuration}_${job_id}
     2959          cp  $jobfile  ${local_jobcatalog}/${configuration_identifier}_${run_id}
    29342960          cd $local_jobcatalog
    29352961          echo " "
     
    29372963          if [[ $do_trace = true ]]
    29382964          then
    2939              echo "$submit_command ${host_configuration}_${job_id}"
    2940           fi
    2941           $submit_command ${host_configuration}_${job_id}
    2942           rm ${host_configuration}_${job_id}
     2965             echo "$submit_command ${configuration_identifier}_${run_id}"
     2966          fi
     2967          $submit_command ${configuration_identifier}_${run_id}
     2968          rm ${configuration_identifier}_${run_id}
    29432969          cd -  > /dev/null
    29442970
Note: See TracChangeset for help on using the changeset viewer.