New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 8818 for branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/trusting.sh – NEMO

Ignore:
Timestamp:
2017-11-27T14:10:49+01:00 (6 years ago)
Author:
nicolasmartin
Message:

Continuation of global refactoring of the tool, set cfg files mime property and modify trusting.env trying to handle default settings

File:
1 edited

Legend:

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

    r8808 r8818  
    44cd $( dirname $0 ) 
    55 
    6 ## Set defaults 
    7 ##--------------------------------------------------- 
     6## Set flags & defaults 
     7##-------------------------------------------------------------------------------- 
     8 
    89TRUST_MAIN_DIR=$PWD 
     10 
    911TRUST_FLAG_DEBUG=0; TRUST_FLAG_PROD=0; TRUST_FLAG_HELP=0 
     12TRUST_FLAG_RESULT='FAILED'; TRUST_FLAG_ERROR=0 
     13 
    1014## No update on SVN directories & 'FAILED' result for 'Unknown error' ) 
    1115TRUST_SVN_ACTION='svn status' 
    12 TRUST_FLAG_RESULT='FAILED'; TRUST_FLAG_ERROR=0 
    1316 
    1417xios_mode='--full'; stdout_redir='>&' 
     
    1720 
    1821## Get options (replacing initials settings) 
    19 ##--------------------------------------------------- 
     22##-------------------------------------------------------------------------------- 
     23 
    2024while [ $# -ne 0 ]; do 
    2125 
    2226    case $1 in 
    23    '-a'|'--archive') TRUST_CFG_FORC=$2; shift 2;; '-b'|'--branch' ) TRUST_SVN_BRANCH=$2; shift 2;; 
     27   '-a'|'--archive') TRUST_IO_FORC_TAR=$2; shift 2;; '-b'|'--branch' ) TRUST_SVN_BRANCH=$2; shift 2;; 
    2428   '-d'|'--debug'  ) TRUST_FLAG_DEBUG=1 ; shift  ;; '-e'|'--email'  ) TRUST_TEST_MAILING=$2; shift 2;; 
    25    '-f'|'--forcdir') TRUST_DIR_FORC=$2; shift 2;; '-j'|'--job'    ) TRUST_COMPILE_NPROC=$2; shift 2;; 
     29   '-f'|'--forcdir') TRUST_IO_FORC_PATH=$2; shift 2;; '-j'|'--job'    ) TRUST_COMPILE_NPROC=$2; shift 2;; 
    2630   '-h'|'--help'   ) TRUST_FLAG_HELP=1 ; shift  ;; '-m'|'--machine') TRUST_MAIN_HPCC=$2; shift 2;; 
    2731   '-n'|'--newconf') TRUST_CFG_NEW=$2; shift 2;; '-r'|'--refconf') TRUST_CFG_REF=$2; shift 2;; 
     
    3539 
    3640## Initialization (HPC & user environment) 
    37 ##--------------------------------------------------- 
     41##-------------------------------------------------------------------------------- 
     42 
    3843if [[ ! -e cfg/${TRUST_MAIN_USER}.cfg || ! -e cfg/${TRUST_MAIN_HPCC}.cfg || ${TRUST_FLAG_HELP} -eq 1 ]]; then 
    3944    cat ./inc/trusting_help.txt 
     
    6974 
    7075## Display contextual summary of trusting test 
    71 ##--------------------------------------------------- 
     76##-------------------------------------------------------------------------------- 
     77 
    7278echo 
    7379 
     
    8288echo '****************************************************************************************************' 
    8389echo 
     90printf "\t§ (Super)Computer\t\t%s\n"             ${TRUST_MAIN_HPCC} 
     91printf "\t§ User installation\t\t%s\n\n"         ${TRUST_MAIN_USER} 
     92echo 
    8493printf "\t§ Testing configuration\t\t%s based on %s\n" ${TRUST_CFG_NEW} ${TRUST_CFG_REF} 
    8594printf "\t§ SVN working copy\t\t%s/%s\n"               ${TRUST_DIR_WORK} ${TRUST_SVN_BRANCH} 
    86 printf "\t§ Benchmark folder\t\t%s\n"               ${TRUST_DIR_STORE} 
    87 printf "\t§ (Super)Computer\t\t%s\n"             ${TRUST_MAIN_HPCC} 
    88 printf "\t§ User installation\t\t%s\n\n"         ${TRUST_MAIN_USER} 
     95if [ ${TRUST_TEST_BENCHMARK} ]; then 
     96printf "\t§ Benchmark folder\t\t%s\n"               ${TRUST_TEST_BENCHMARK} 
     97fi 
    8998 
    9099 
    91100## Make timestamped directory with messenger files 
    92 ##--------------------------------------------------- 
     101##-------------------------------------------------------------------------------- 
     102 
    93103print_step 'Timestamped testing directory' 
    94104 
    95 mkdir -p ${TRUST_DIR_SCRATCH} ${TRUST_DIR_STORE} 
    96 cd       ${TRUST_DIR_SCRATCH} 
    97 echo     ${TRUST_DIR_SCRATCH} 
     105mkdir -p ${TRUST_TEST_DIR} ${TRUST_TEST_BENCHMARK} 
     106cd       ${TRUST_TEST_DIR} 
     107echo     ${TRUST_TEST_DIR} 
    98108 
    99109init_files 
     
    103113 
    104114## Get SVN revision on XIOS & NEMO essentials directories 
    105 ##--------------------------------------------------- 
     115##-------------------------------------------------------------------------------- 
     116 
    106117print_step "SVN action on NEMO directories: ${TRUST_SVN_ACTION}" 
    107118 
     
    110121 
    111122## Check softwares versions (after sourced arch environment) 
    112 ##--------------------------------------------------- 
     123##-------------------------------------------------------------------------------- 
     124 
    113125print_step 'Get testing environement' 
    114126 
     
    120132 
    121133## XIOS compilation from scratch 
    122 ##--------------------------------------------------- 
     134##-------------------------------------------------------------------------------- 
     135 
    123136print_step 'Compile XIOS' 
    124137 
    125 cd ${TRUST_DIR_XIOS} 
     138cd ${TRUST_IO_XIOS} 
    126139 
    127140eval ./make_xios ${xios_mode} --arch ${TRUST_MAIN_HPCC} --job ${TRUST_COMPILE_NPROC} \ 
     
    132145 
    133146## NEMO compilation from scratch 
    134 ##--------------------------------------------------- 
     147##-------------------------------------------------------------------------------- 
     148 
    135149print_step "Compile ${TRUST_CFG_REF} configuration" 
    136150 
    137 cd ${TRUST_DIR_NEMOGCM}/CONFIG 
     151cd ${TRUST_SVN_NEMOGCM}/CONFIG 
    138152 
    139153if [[ -d ${TRUST_CFG_NEW} && ${TRUST_FLAG_DEBUG} -eq 0 ]]; then 
     
    153167 
    154168## Get all inputs for running 
    155 ##--------------------------------------------------- 
     169##-------------------------------------------------------------------------------- 
     170 
    156171print_step 'Set job (copying or extracting inputs)' 
    157172 
    158 cd ${TRUST_DIR_SCRATCH} 
     173cd ${TRUST_TEST_DIR} 
    159174 
    160175get_inputs 
    161176 
    162 cp   ${TRUST_DIR_NEMOGCM}/CONFIG/${TRUST_CFG_NEW}/cpp_* . 
    163 find ${TRUST_DIR_NEMOGCM}/CONFIG/${TRUST_CFG_NEW}/EXP00   \ 
     177cp   ${TRUST_SVN_NEMOGCM}/CONFIG/${TRUST_CFG_NEW}/cpp_* . 
     178find ${TRUST_SVN_NEMOGCM}/CONFIG/${TRUST_CFG_NEW}/EXP00   \ 
    164179    -regex '.*\(_cfg\|.in\|opa\|_ref\|.xml\)' \ 
    165180    -exec  cp {} . \; 
     
    167182 
    168183## Check inputs 
    169 ##--------------------------------------------------- 
     184##-------------------------------------------------------------------------------- 
     185 
    170186print_step 'Compare inputs' 
    171187 
     
    174190 
    175191## Job submission & computation 
    176 ##--------------------------------------------------- 
     192##-------------------------------------------------------------------------------- 
     193 
    177194print_step 'Submit job' 
    178195 
    179196## Copy the submitting script to testing folder 
    180 cp ${TRUST_JOB_SCRIPT} ${TRUST_DIR_SCRATCH} 
     197cp ${TRUST_JOB_SCRIPT} ${TRUST_TEST_DIR} 
    181198TRUST_JOB_ID=$( eval ${TRUST_JOB_SUBMIT} ) 
    182199 
     
    191208 
    192209## Check job state & get computation performances if succeeded 
    193 ##--------------------------------------------------- 
     210##-------------------------------------------------------------------------------- 
     211 
    194212print_step 'Test job state' 
    195213 
     
    208226 
    209227## Check outputs 
    210 ##--------------------------------------------------- 
     228##-------------------------------------------------------------------------------- 
     229 
    211230TRUST_FLAG_RESULT='OK' ## 'OK' by default 
    212231 
     
    223242 
    224243## End, at least nothing major has changed ;-) 
    225 ##--------------------------------------------------- 
     244##-------------------------------------------------------------------------------- 
     245 
    226246get_out 0 
Note: See TracChangeset for help on using the changeset viewer.