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/palmbuild

    r3210 r3236  
    2727# -----------------
    2828# $Id$
     29# "host identifier" in header output renamed "config. identifier",
     30# host_configuration renamed configuration_identifier,
     31# jobname renamed run_identifier
     32# header output of PALM code revision,
     33# options -m, -s, and -S removed
     34#
     35# 3210 2018-08-28 07:31:13Z sward
    2936# Bugfix: agent_preprocessing stays in MAKE_DEPOSITORY after compilation
    3037#
     
    7784 column1=""
    7885 column2=""
    79  host_configuration=default
     86 configuration_identifier=default
     87 global_revision=""
    8088 locat=normal
    8189 makefile=""
     
    95103    # ERROR HANDLING
    96104    # IN CASE OF EXIT:
    97  trap 'rm -rf  ${source_path}/${host_configuration}_last_make_protocol
     105 trap 'rm -rf  ${source_path}/${configuration_identifier}_last_make_protocol
    98106       if [[ $locat != normal ]]
    99107       then
     
    112120    # IN CASE OF TERMINAL-BREAK:
    113121 trap 'printf "\n\n +++ palmbuild killed by \"^C\" \n\n"
    114        rm  ${source_path}/${host_configuration}_last_make_protocol
     122       rm  ${source_path}/${configuration_identifier}_last_make_protocol
    115123       exit
    116124      ' 2
     
    119127
    120128    # READ SHELLSCRIPT-OPTIONS
    121  while  getopts  :d:h:m:s:S:uvV  option
     129 while  getopts  :d:h:uvV  option
    122130 do
    123131   case  $option  in
    124        (d)   jobname=$OPTARG;;
    125        (h)   host_configuration=$OPTARG;;
    126        (m)   makefile=$OPTARG;;
    127        (s)   suf=$OPTARG;;
    128        (S)   source_list="$OPTARG";;
     132       (d)   run_identifier=$OPTARG;;
     133       (h)   configuration_identifier=$OPTARG;;
    129134       (v)   silent=true;;
    130135       (V)   use_existing_sources_folder=true;;
     
    135140
    136141
    137     # FOR COMPATIBILITY REASONS SET OLD ENVIRONMENT VARIABLE
    138  export fname=$jobname
     142    # FOR COMPATIBILITY REASONS SET OLD ENVIRONMENT VARIABLES
     143 export fname=$run_identifier
     144 export jobname=$run_identifier
    139145
    140146
    141147    # BUILD THE CONFIGURATION-FILE NAME AND THE SOURCES_FOR_RUN-FOLDER NAME
    142  config_file=.palm.config.$host_configuration
    143  sources_for_run_catalog=SOURCES_FOR_RUN_${host_configuration}_$jobname
     148 config_file=.palm.config.$configuration_identifier
     149 sources_for_run_catalog=SOURCES_FOR_RUN_${configuration_identifier}_$run_identifier
    144150
    145151
     
    249255
    250256    # CHECK MAKEFILE
    251  [[ "$makefile" = "" ]]  &&  makefile=$source_path/Makefile
     257 makefile=$source_path/Makefile
    252258 if [[ ! -f $makefile ]]
    253259 then
     
    312318
    313319    line=`grep %base_directory $config_file`
    314     make_depository=`echo $line | cut -d" " -s -f2`/MAKE_DEPOSITORY_${host_configuration}
     320    make_depository=`echo $line | cut -d" " -s -f2`/MAKE_DEPOSITORY_${configuration_identifier}
    315321
    316322 else
    317323
    318     make_depository=${base_directory}/MAKE_DEPOSITORY_${host_configuration}
    319 
    320  fi
     324    make_depository=${base_directory}/MAKE_DEPOSITORY_${configuration_identifier}
     325
     326 fi
     327
     328
     329    # GET THE GLOBAL REVISION-NUMBER OF THE SVN-REPOSITORY
     330 global_revision=`svnversion $source_path  2>/dev/null`
     331 global_revision="Rev: $global_revision"
     332
    321333
    322334    # HEADER-OUTPUT (PART1: MESSAGES CONCERNING THE LOCAL HOST)
     
    327339    printf "#------------------------------------------------------------------------# \n"
    328340    printf "| %-40s%30s | \n" "$version" "$calltime"
     341    printf "| %-40s%30s | \n" "PALM code       $global_revision" " "
    329342    printf "|                                                                        | \n"
    330343    printf "| %-13s%-57s | \n" "called on:" "$(hostname) (IP:$local_ip)"
     
    363376    if [[ "$remote_ip" != "" ]]
    364377    then
    365        column2="$host_configuration"
    366        printf "| %-20s%-50s | \n" "host configuration:" "$column2"
     378       column2="$configuration_identifier"
     379       printf "| %-20s%-50s | \n" "config. identifier:" "$column2"
    367380       column2=$(echo "$make_depository" | cut -c1-50 )
    368381       printf "| %-20s%-50s | \n" "remote depository:" "$column2"
    369382    else
    370        column2="$host_configuration"
    371        printf "| %-20s%-50s | \n" "host identifier:" "$column2"
     383       column2="$configuration_identifier"
     384       printf "| %-20s%-50s | \n" "config. identifier:" "$column2"
    372385       column2=$(echo "$make_depository" | cut -c1-50 )
    373386       printf "| %-20s%-50s | \n" "local depository:" "$column2"
     
    496509
    497510       # NEXT IS THE BRANCH FOR CREATING THE MAKE_DEPOSITORY_...
    498     if [[ "$jobname" = "" ]]
     511    if [[ "$run_identifier" = "" ]]
    499512    then
    500513
     
    543556       fi
    544557       make_call_string="make  -f Makefile_utilities  $make_options  F90=$compiler_name  F90_SER=$compiler_name_ser  COPT=\"$cpp_options\"  F90FLAGS=\"$compiler_options\"  LDFLAGS=\"$linker_options\" "
    545        echo "$login_init_cmd $module_commands cd ${make_depository}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh  -q  $ssh_key  ${remote_username}@${remote_ip} 2>&1 | tee ${host_configuration}_last_make_protocol
    546 
    547        if [[ $(grep -c MAKE_ERROR ${host_configuration}_last_make_protocol) != 0 ]]
     558       echo "$login_init_cmd $module_commands cd ${make_depository}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh  -q  $ssh_key  ${remote_username}@${remote_ip} 2>&1 | tee ${configuration_identifier}_last_make_protocol
     559
     560       if [[ $(grep -c MAKE_ERROR ${configuration_identifier}_last_make_protocol) != 0 ]]
    548561       then
    549562          printf "\a\n  +++ error(s) occurred during compiling or linking of utilities"
    550           printf "\n      for host configuration \"$host_configuration\" "
     563          printf "\n      for host configuration \"$configuration_identifier\" "
    551564          if [[ $silent = false ]]
    552565          then
     
    559572                if [[ "$answer" = l ]]
    560573                then
    561                    more ${host_configuration}_last_make_protocol
     574                   more ${configuration_identifier}_last_make_protocol
    562575                fi
    563576             done
     
    582595       fi
    583596       make_call_string="make  $make_options  PROG=$program_name  F90=$compiler_name  COPT=\"$cpp_options\"  F90FLAGS=\"$compiler_options\"  LDFLAGS=\"$linker_options\" "
    584        echo "$login_init_cmd $module_commands cd ${make_depository}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh  -q  $ssh_key  ${remote_username}@${remote_ip} 2>&1 | tee ${host_configuration}_last_make_protocol
    585 
    586        if [[ $(grep -c MAKE_ERROR ${host_configuration}_last_make_protocol) != 0 ]]
    587        then
    588           printf "\a\n  +++ error(s) occurred during compiling or linking for host configuration \"$host_configuration\" "
     597       echo "$login_init_cmd $module_commands cd ${make_depository}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh  -q  $ssh_key  ${remote_username}@${remote_ip} 2>&1 | tee ${configuration_identifier}_last_make_protocol
     598
     599       if [[ $(grep -c MAKE_ERROR ${configuration_identifier}_last_make_protocol) != 0 ]]
     600       then
     601          printf "\a\n  +++ error(s) occurred during compiling or linking for host configuration \"$configuration_identifier\" "
    589602          if [[ $silent = false ]]
    590603          then
     
    597610                if [[ "$answer" = l ]]
    598611                then
    599                    more ${host_configuration}_last_make_protocol
     612                   more ${configuration_identifier}_last_make_protocol
    600613                fi
    601614             done
     
    621634       # INCLUDING E.G. USER-INTERFACE ROUTINES. ALSO ADD OTHER UTILITY EXECUTABLES. EVERYTHING IS
    622635       # COLLECTED IN DIRECTORY SOURCES_FOR_RUN_...
    623     elif [[ "$jobname" != "" ]]
     636    elif [[ "$run_identifier" != "" ]]
    624637    then
    625638
    626639          # FIRST CHECK, IF COMPILED SOURCES FOR THIS RUN IDENTIFIER EXISTS
    627640          # AND ASK, IF THEY SHALL BE USED
    628        echo  "[[ -d ${fast_io_catalog}/${sources_for_run_catalog} ]]  &&  echo sources for run found" | ssh  -q  $ssh_key  ${remote_username}@${remote_ip} 2>&1  >  ${host_configuration}_last_make_protocol
    629        if [[ $(grep -c "sources for run found" ${host_configuration}_last_make_protocol) != 0  &&  $use_existing_sources_folder = true ]]
    630        then
    631           printf "\a\n  *** compiled sources for run \"$jobname\" found on remote host in folder"
     641       echo  "[[ -d ${fast_io_catalog}/${sources_for_run_catalog} ]]  &&  echo sources for run found" | ssh  -q  $ssh_key  ${remote_username}@${remote_ip} 2>&1  >  ${configuration_identifier}_last_make_protocol
     642       if [[ $(grep -c "sources for run found" ${configuration_identifier}_last_make_protocol) != 0  &&  $use_existing_sources_folder = true ]]
     643       then
     644          printf "\a\n  *** compiled sources for run \"$run_identifier\" found on remote host in folder"
    632645          printf "\n      ${fast_io_catalog}/${sources_for_run_catalog}"
    633646          printf "\n      will be used!"
     
    638651       if [[ $silent = false ]]
    639652       then
    640           printf "\n  *** copy MAKE_DEPOSITORY_${host_configuration} on remote host to $sources_for_run_catalog \n"
     653          printf "\n  *** copy MAKE_DEPOSITORY_${configuration_identifier} on remote host to $sources_for_run_catalog \n"
    641654       fi
    642655       echo  "rm -rf ${fast_io_catalog}/${sources_for_run_catalog}; mkdir -p ${fast_io_catalog}/${sources_for_run_catalog}; cp ${make_depository}/${program_name}_current_version.tar  ${fast_io_catalog}/${sources_for_run_catalog}; cd ${fast_io_catalog}/${sources_for_run_catalog}; tar xf ${program_name}_current_version.tar"  |  ssh  -q  $ssh_key  ${remote_username}@${remote_ip}  2>&1
     
    663676             echo "  *** execute \"make\" on remote host"
    664677          fi
    665           echo "$login_init_cmd $module_commands cd ${fast_io_catalog}/${sources_for_run_catalog}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh  -q  $ssh_key  ${remote_username}@${remote_ip} 2>&1 | tee ${host_configuration}_last_make_protocol
    666 
    667           if [[ $(grep -c MAKE_ERROR ${host_configuration}_last_make_protocol) != 0 ]]
     678          echo "$login_init_cmd $module_commands cd ${fast_io_catalog}/${sources_for_run_catalog}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh  -q  $ssh_key  ${remote_username}@${remote_ip} 2>&1 | tee ${configuration_identifier}_last_make_protocol
     679
     680          if [[ $(grep -c MAKE_ERROR ${configuration_identifier}_last_make_protocol) != 0 ]]
    668681          then
    669              printf "\a\n  +++ error(s) occurred during compiling or linking for host configuration \"$host_configuration\" "
     682             printf "\a\n  +++ error(s) occurred during compiling or linking for host configuration \"$configuration_identifier\" "
    670683             if [[ $silent = false ]]
    671684             then
     
    678691                   if [[ "$answer" = l ]]
    679692                   then
    680                       more ${host_configuration}_last_make_protocol
     693                      more ${configuration_identifier}_last_make_protocol
    681694                   fi
    682695                done
     
    701714    fi
    702715
    703     rm -rf  ${source_path}/${host_configuration}_last_make_protocol
     716    rm -rf  ${source_path}/${configuration_identifier}_last_make_protocol
    704717
    705718
     
    710723       # NEXT IS THE BRANCH FOR CREATING THE MAKE_DEPOSITORY_... ON THE
    711724       # LOCAL HOST
    712     if [[ "$jobname" = "" ]]
     725    if [[ "$run_identifier" = "" ]]
    713726    then
    714727
     
    774787       fi
    775788
    776        make  $make_options  PROG=$program_name  F90=$compiler_name  COPT="$cpp_options"  F90FLAGS="$compiler_options"  LDFLAGS="$linker_options"  2>&1 | tee ${host_configuration}_last_make_protocol
     789       make  $make_options  PROG=$program_name  F90=$compiler_name  COPT="$cpp_options"  F90FLAGS="$compiler_options"  LDFLAGS="$linker_options"  2>&1 | tee ${configuration_identifier}_last_make_protocol
    777790
    778791       if [[ $? != 0 ]]
    779792       then
    780           printf "\a\n  +++ error(s) occurred during compiling or linking for host configuration \"$host_configuration\" "
     793          printf "\a\n  +++ error(s) occurred during compiling or linking for host configuration \"$configuration_identifier\" "
    781794          if [[ $silent = false ]]
    782795          then
     
    789802                if [[ "$answer" = l ]]
    790803                then
    791                    more ${host_configuration}_last_make_protocol
     804                   more ${configuration_identifier}_last_make_protocol
    792805                fi
    793806             done
     
    820833       if [[ -d ${fast_io_catalog}/${sources_for_run_catalog}  &&  $use_existing_sources_folder = true ]]
    821834       then
    822           printf "\a\n  *** compiled sources for run \"$jobname\" found on local host in folder"
     835          printf "\a\n  *** compiled sources for run \"$run_identifier\" found on local host in folder"
    823836          printf "\n      ${fast_io_catalog}/${sources_for_run_catalog}"
    824837          printf "\n      will be used!"
     
    831844          printf "\n  +++ directory for local make depository:"
    832845          printf "\n           $make_depository"
    833           printf "\n      not found. Please run \"palmbuild -h $host_configuration\" "
     846          printf "\n      not found. Please run \"palmbuild -h $configuration_identifier\" "
    834847          locat=make_depository; exit
    835848       fi
     
    839852       if [[ $silent = false ]]
    840853       then
    841           printf "\n  *** copy MAKE_DEPOSITORY_${host_configuration} on local host to "
     854          printf "\n  *** copy MAKE_DEPOSITORY_${configuration_identifier} on local host to "
    842855          printf "\n      ${fast_io_catalog}/${sources_for_run_catalog} \n"
    843856       fi
     
    875888          then
    876889
    877              printf "\a\n  +++ error(s) occurred during compiling or linking for host configuration \"$host_configuration\" "
     890             printf "\a\n  +++ error(s) occurred during compiling or linking for host configuration \"$configuration_identifier\" "
    878891             if [[ $silent = false ]]
    879892             then
Note: See TracChangeset for help on using the changeset viewer.