- Timestamp:
- 2015-06-18T23:02:31+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting.sh
r5432 r5438 11 11 #--------------------------------------------------- 12 12 NEMO_TRUS=$( pwd $( dirname $0 ) ) 13 SVN_ CMD='svnstatus'13 SVN_OPT='status' 14 14 DEBUG=0; PUBLISH=0; status='OK' 15 15 … … 27 27 esac 28 28 done 29 30 #export DEBUG PUBLISH31 32 29 33 30 # Initialization (super-computer & user environment) … … 47 44 fi 48 45 49 # If -v|--version option has been set, modify svn command50 [ $( echo ${NEMO_VERS} | grep "up\|update" ) ] && SVN_CMD='svn update'51 [ $( echo ${NEMO_VERS} | tr -d '[:alpha:][:punct:]' ) ] && SVN_CMD='svn update -r '$( echo ${NEMO_VERS} | tr -d '[:alpha:][:punct:]' )52 53 46 . ./trusting_func.sh 54 55 47 56 48 # … … 59 51 echo ${TEST_DIR} && cd ${TEST_DIR} 60 52 datestr1=$( LC_ALL=C date -d"${DATE_STR}" +%Y-%m-%dT%H:%M ) 61 printf "Date\n %s\n" $datestr1> mesg_01_date_${CFG_USER}_${CFG_ARCH}.txt53 printf "Date\n$datestr1\n" > mesg_01_date_${CFG_USER}_${CFG_ARCH}.txt 62 54 # Only at end status will change to OK 63 printf "Status\nFAILED\n" > mesg_03_status_${CFG_USER}_${CFG_ARCH}.txt 55 status='FAILED' 64 56 65 66 # Check softwares versions 57 # Check softwares versions (source arch environment) 67 58 #--------------------------------------------------- 68 p rintf "Step......................\nGet softwares release\n" | tee mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt69 . ${ARCH_ENV} > /dev/null # Sourcing architecture environment59 pstep 'Get softwares release' 60 . ${ARCH_ENV} > /dev/null 70 61 get_soft_rel 71 sed -n 2p model.log | sed 'i\Fortran compiler' | tee mesg_05_compiler_${CFG_USER}_${CFG_ARCH}.txt72 sed -n 3p model.log | sed 'i\MPI libraries ' | tee mesg_06_mpi_${CFG_USER}_${CFG_ARCH}.txt73 sed -n 4p model.log | sed 'i\NetCDF libraries' | tee mesg_07_netcdf_${CFG_USER}_${CFG_ARCH}.txt74 75 62 76 63 # SVN action on XIOS & NEMO essentials directories 77 64 #--------------------------------------------------- 78 p rintf "Step......................\nGet NEMO SVN revision with: ${SVN_CMD}\n" | tee mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt65 pstep "Get NEMO SVN state with: ${SVN_OPT}" 79 66 get_nemo_rev 80 sed -n 6p model.log | sed 'i\NEMO revision' | tee mesg_02_nemo_${CFG_USER}_${CFG_ARCH}.txt 81 82 67 exit 0 83 68 # NEMO config compiled from scratch 84 69 #--------------------------------------------------- 85 p rintf "Step......................\nCompiling ${CONF_REF} configuration\n" | tee mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt70 pstep "Compiling ${CONF_REF} configuration" 86 71 cd ${NEMO_CONF} 87 72 #[ -d ${TEST_CONF} ] && ./makenemo -n ${TEST_CONF} clean 88 73 ./makenemo -n ${TEST_CONF} -r ${REFE_CONF} -m $ARCH -j $NPROC >& /dev/null 89 [ ! -e ${TEST_CONF}/BLD/bin/nemo.exe ] && get_out 90 74 [ ! -e ${TEST_CONF}/BLD/bin/nemo.exe ] && get_out $step $status 91 75 92 76 # Get namelists, xml & forced files for running 93 77 #--------------------------------------------------- 94 cd ${TEST_DIR} 95 printf "Step......................\nPreparing job\n" | tee mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt 78 pstep 'Preparing job' 96 79 find ${NEMO_CONF}/${TEST_CONF}/EXP00 -regex '.*\(cfg\|opa\|ref\|xml\)' -exec cp {} . \; 97 80 … … 103 86 104 87 ${cmd_iol} > inputs_list.txt && ${cmd_iof} > /dev/null 105 [ $? -ne 0 ] && get_out 88 [ $? -ne 0 ] && get_out $step $status 106 89 [ $( find . -name '*.gz' -print -quit ) ] && gunzip *.gz 107 exit 0 90 91 # Check input files in all cases 92 #--------------------------------------------------- 93 pstep 'Test input files difference' 94 diff_inputs 108 95 109 96 # Job submission & computing 110 97 #--------------------------------------------------- 111 p rintf "Step......................\nRunning\n" | tee mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt; echo ${JOB_SUBM}98 pstep 'Running' 112 99 job_num=$( ${JOB_SUBM} | awk '{print $NF}' ) 113 [ $? -ne 0 ] && get_out 100 [ $? -ne 0 ] && get_out $step $status 114 101 115 102 time_elapsed=0; time_increment=30 … … 125 112 # Eventual crash during computing 126 113 #--------------------------------------------------- 127 printf "Step......................\nTest if ASCII output files exist\n" | tee mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt 128 if [ ! -f ocean.output ]; then 129 printf "Step......................\nOpa crashed at initialization\n" | tee mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt 114 pstep 'Test if ASCII output files exist' 115 if [[ ! -f ocean.output || $( grep 'E R R O R' ocean.output ) ]]; then 116 ${JOB_DELE} ${job_num} &> /dev/null 117 [ ! -f ocean.output ] && step='nemo.exe crashed at initialization' 118 [ $( grep 'E R R O R' ocean.output ) ] && step='nemo.exe crashed' 119 comments('E R R O R') 130 120 ${JOB_DELE} ${job_num} >/dev/null 2>&1 131 121 status='FAILED' 132 elif [ $( grep 'E R R O R' ocean.output ) ]; then 133 printf "Step......................\nOpa crashed\n" | tee mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt 134 grep 'E R R O R' ocean.output | tee mesg_10_comments_${CFG_USER}_${CFG_ARCH}.txt 135 sed 's/^/Time step :/' time.step | tee -a mesg_10_comments_${CFG_USER}_${CFG_ARCH}.txt 136 ${JOB_DELE} ${job_num} >/dev/null 2>&1 137 status='FAILED' 122 get_out $step $status 123 else 124 status='OK' 125 126 # Inspect output text files 127 #--------------------------------------------------- 128 pstep 'Test ASCII output files diff' 129 for file in ocean.output solver.stat tracer.stat; do 130 diff $file ${REFE_DIR}/$file 131 [ $? -ne 0 ] && status='FAILED' 132 done 133 134 # Inspect output NetCDF files 135 #--------------------------------------------------- 136 pstep 'Test last restart NetCDF files diff' 137 diff_restart #2> /dev/null 138 [ $? -ne 0 ] && status='FAILED' 139 140 # Get computation duration 141 #--------------------------------------------------- 142 pstep 'Get real CPU time' 143 get_cpu_time 144 145 comments('W A R N I N G') 138 146 fi 139 140 141 # Inspect output text files142 #---------------------------------------------------143 printf "Step......................\nTest ASCII output files difference\n" | tee mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt144 for file in ocean.output solver.stat tracer.stat; do145 diff $file ${REFE_DIR}/$file146 [ $? -ne 0 ] && status='FAILED'147 done148 149 150 # Inspect output NetCDF files151 #---------------------------------------------------152 printf "Step......................\nTest last restart NetCDF files difference\n" | tee mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt153 diff_restart 2>/dev/null154 [ $? -ne 0 ] && status='FAILED'155 156 157 # Finals tests158 #---------------------------------------------------159 if [ $status != 'FAILED' ]; then160 161 # Comments162 #---------------------------------------------------163 echo 'Comments' | tee mesg_10_comments_${CFG_USER}_${CFG_ARCH}.txt164 grep 'W A R N I N G:' ocean.output | tee -a mesg_10_comments_${CFG_USER}_${CFG_ARCH}.txt165 166 # Portability !167 printf "Step......................\nGet real CPU time\n" | tee mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt168 real_cpu_time=$( ${JOB_VIEW} ${job_num} | awk 'END{print $9}' )169 printf "Real CPU time\n%s\n" ${real_cpu_time} | tee mesg_08_realcputime_${CFG_USER}_${CFG_ARCH}.txt170 printf "Input files\nNA" | tee mesg_09_inputfiles_${CFG_USER}_${CFG_ARCH}.txt171 else172 printf "Step......................\nTest input files difference\n" | tee mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt173 diff_inputs174 get_out175 fi176 177 178 # So far, everything is good179 #---------------------------------------------------180 printf "Status\nOK\n" > mesg_03_status_${CFG_USER}_${CFG_ARCH}.txt181 printf "Step......................\nCode is reliable\n" | tee mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt182 183 147 184 148 # End 185 149 #--------------------------------------------------- 186 get_out 150 if [ $status == 'FAILED' ]; then step='Test outputs difference'; else step='Code is reliable'; fi 151 get_out $step $status
Note: See TracChangeset
for help on using the changeset viewer.