Ignore:
Timestamp:
2017-11-22T11:28:53+01:00 (3 years ago)
Author:
nicolasmartin
Message:

Push modifications from functional Trusting in Curie HPC

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/inc/trusting_func.sh

    r5988 r8780  
    33 
    44## Messenger filenames 
    5 FILE_DATE=mesg_01_date_$PATTERNAME.txt  ; FILE_RSLT=mesg_02_result_$PATTERNAME.txt 
    6 FILE_STAT=mesg_03_state_$PATTERNAME.txt ; FILE_NEMO=mesg_04_nemo_$PATTERNAME.txt 
    7 FILE_XIOS=mesg_05_xios_$PATTERNAME.txt  ; FILE_CMPF=mesg_06_compiler_$PATTERNAME.txt 
    8 FILE_LMPI=mesg_07_mpi_$PATTERNAME.txt   ; FILE_NCDF=mesg_08_netcdf_$PATTERNAME.txt 
    9 FILE_INPT=mesg_09_inputs_$PATTERNAME.txt; FILE_TIME=mesg_10_time_$PATTERNAME.txt 
    10 FILE_MEMY=mesg_11_memory_$PATTERNAME.txt; FILE_NOTE=mesg_12_comments_$PATTERNAME.txt 
     5file_date=mesg_01_date.txt  ; file_rslt=mesg_02_result.txt 
     6file_stat=mesg_03_state.txt ; file_nemo=mesg_04_nemo.txt 
     7file_xios=mesg_05_xios.txt  ; file_cmpf=mesg_06_compiler.txt 
     8file_lmpi=mesg_07_mpi.txt   ; file_ncdf=mesg_08_netcdf.txt 
     9file_inpt=mesg_09_inputs.txt; file_time=mesg_10_time.txt 
     10file_memy=mesg_11_memory.txt; file_note=mesg_12_comments.txt 
    1111 
    1212## Trusting timestamped logfile & archive 
    13 TRUS_FILE=trusting_${DATE}_$PATTERNAME.txt; TRUS_ARCH=trusting_${DATE}_$PATTERNAME.tgz 
     13TRUS_FILE=trusting_${TRUS_DATE}_$TRUS_NAME.txt; TRUS_ARCH=trusting_${TRUS_DATE}_$TRUS_NAME.tgz 
    1414 
    1515 
     
    2323 
    2424init_files() { 
    25     echo 'Date'               > ${FILE_DATE}; echo 'Result'           > ${FILE_RSLT} 
    26     echo 'State'              > ${FILE_STAT}; echo 'NEMOGCM rev.'     > ${FILE_NEMO} 
    27     echo 'XIOS rev.'          > ${FILE_XIOS}; echo 'Fortran compiler' > ${FILE_CMPF} 
    28     echo 'MPI libs'           > ${FILE_LMPI}; echo 'NetCDF libs'      > ${FILE_NCDF} 
    29     echo 'Input files'        > ${FILE_INPT}; echo 'Elapsed time'     > ${FILE_TIME} 
    30     echo 'Memory usage (P/V)' > ${FILE_MEMY}; echo 'Comments'         > ${FILE_NOTE} 
     25    echo 'Date'               > ${file_date}; echo 'Result'           > ${file_rslt} 
     26    echo 'State'              > ${file_stat}; echo 'NEMOGCM rev.'     > ${file_nemo} 
     27    echo 'XIOS rev.'          > ${file_xios}; echo 'Fortran compiler' > ${file_cmpf} 
     28    echo 'MPI libs'           > ${file_lmpi}; echo 'NetCDF libs'      > ${file_ncdf} 
     29    echo 'Input files'        > ${file_inpt}; echo 'Elapsed time'     > ${file_time} 
     30    echo 'Memory usage (P/V)' > ${file_memy}; echo 'Comments'         > ${file_note} 
    3131 
    3232    ## 'Failed' status with 'Unknown error' by default 
    3333    echo ${TRUS_RSLT}      \ 
    34    >> ${FILE_RSLT} 
     34   >> ${file_rslt} 
    3535    echo 'Unknown error' \ 
    36    >> ${FILE_STAT} 
     36   >> ${file_stat} 
    3737} 
    3838 
    3939get_date() { 
    4040    ## UTC time zone for timestamping 
    41     local dat=$( date -ud "${DATE}" +"%F %R %Z" ) 
     41    local dat=$( date -ud "${TRUS_DATE}" +"%F %R %Z" ) 
    4242 
    4343    echo $dat           \ 
    44    >> ${FILE_DATE} 
     44   >> ${file_date} 
    4545} 
    4646 
     
    5858      >> model.log 
    5959       echo "<a href=\"https://forge.ipsl.jussieu.fr/ioserver/changeset/${rev_loc}\" target=\"_blank\">${rev_loc}</a>" \ 
    60       >> ${FILE_XIOS} 
     60      >> ${file_xios} 
    6161       continue 
    6262   fi 
     
    7272   >> model.log 
    7373    echo "<a href=\"https://forge.ipsl.jussieu.fr/nemo/changeset/$rev\" target=\"_blank\">$rev</a>" \ 
    74    >> ${FILE_NEMO} 
     74   >> ${file_nemo} 
    7575} 
    7676 
     
    110110 
    111111    sed -n 3p model.log \ 
    112    >> ${FILE_CMPF} 
     112   >> ${file_cmpf} 
    113113    sed -n 4p model.log \ 
    114    >> ${FILE_LMPI} 
     114   >> ${file_lmpi} 
    115115    sed -n 5p model.log \ 
    116    >> ${FILE_NCDF} 
     116   >> ${file_ncdf} 
    117117} 
    118118 
     
    145145    [ $mesg == 'Same' ] && echo $mesg 
    146146    echo $mesg          \ 
    147    >> ${FILE_INPT} 
     147   >> ${file_inpt} 
    148148 
    149149    ## List different files for web comment 
    150150    [ -n "${files_list}" ] && echo 'Inputs  : '${files_list}'differ<br>' \ 
    151    >> temp_${FILE_NOTE} 
     151   >> temp_${file_note} 
    152152} 
    153153 
     
    161161   printf "\n%s\n" ${outline// /#}          \ 
    162162       >> computation.log 
    163    [ -n "${TRUS_JINF}" ] && eval ${JOB_INFO} \ 
     163   [ -n "${TRUS_JINF}" ] && eval ${TRUS_JINF} \ 
    164164       >> computation.log 
    165165   sleep ${time_increment} 
     
    170170 
    171171    ## Kill remaining job & stop the test if it's too long 
    172     [ ${time_elapsed} -eq ${TRUS_TOUT} ] && { eval ${JOB_DELE} &> /dev/null; get_out 6; } 
     172    [ ${time_elapsed} -eq ${TRUS_TOUT} ] && { eval ${TRUS_JKIL} &> /dev/null; get_out 6; } 
    173173} 
    174174 
     
    192192    ## List different files for web comment 
    193193    [ -n "${files_list}" ] && echo 'Results : '${files_list}'differ<br>' \ 
    194    >> temp_${FILE_NOTE} 
     194   >> temp_${file_note} 
    195195} 
    196196 
     
    263263   if [ ${dif_sum} -ne 0 ]; then 
    264264       echo 'Restarts: '${files_list}${dif_sum}' record(s) differ<br>' \ 
    265       >> temp_${FILE_NOTE} 
     265      >> temp_${file_note} 
    266266   else 
    267267       echo 'Same' 
     
    281281 
    282282    printf "Elapsed time: " 
    283     echo ${time_cpu} | tee -a ${FILE_TIME} 
     283    echo ${time_cpu} | tee -a ${file_time} 
    284284} 
    285285 
     
    291291 
    292292    printf "Memory max usage (physical/virtual): " 
    293     echo ${memory_pmax}' / '${memory_vmax} | tee -a ${FILE_MEMY} 
     293    echo ${memory_pmax}' / '${memory_vmax} | tee -a ${file_memy} 
    294294} 
    295295 
     
    308308 
    309309    [ -n "$line" ] && ( echo $line; printf "$line<br>" \ 
    310    >> temp_${FILE_NOTE} ) 
     310   >> temp_${file_note} ) 
    311311} 
    312312 
    313313log_make() { 
    314314    ## Format comments for web 
    315     [ -e temp_${FILE_NOTE} ] && cat temp_${FILE_NOTE} | tr -d '\n' | sed 's/<br>$//' \ 
    316    >> ${FILE_NOTE} 
     315    [ -e temp_${file_note} ] && cat temp_${file_note} | tr -d '\n' | sed 's/<br>$//' \ 
     316   >> ${file_note} 
    317317 
    318318    ## Construct txt file with all messenger files 
     
    328328 
    329329   ## Create or append trusting logfile 
    330    if [ -f ${TRUS_STOR}/trusting_$PATTERNAME.txt ]; then cmd='tail -1'; else cmd='cat'; fi 
     330   if [ -f ${TRUS_STOR}/trusting_$TRUS_NAME.txt ]; then cmd='tail -1'; else cmd='cat'; fi 
    331331 
    332332   $cmd ${TRUS_FILE}                            \ 
    333        >> ${TRUS_STOR}/trusting_$PATTERNAME.txt 
     333       >> ${TRUS_STOR}/trusting_$TRUS_NAME.txt 
    334334 
    335335        ## Send mail only when FAILED 
     
    409409    ## Last messenger files 
    410410    #export TRUS_RORR 
    411     sed -i "2 s/.*/$TRUS_RSLT/" ${FILE_RSLT}; sed -i "2 s/.*/$TRUS_RORR/" ${FILE_STAT} 
     411    sed -i "2 s/.*/$TRUS_RSLT/" ${file_rslt}; sed -i "2 s/.*/$TRUS_RORR/" ${file_stat} 
    412412 
    413413    ## Save tested configuration if trusting failed in production mode (-p|--prod) 
Note: See TracChangeset for help on using the changeset viewer.