Changeset 5455
- Timestamp:
- 2015-06-19T22:57:06+02:00 (9 years ago)
- Location:
- branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting.sh
r5453 r5455 1 1 #!/bin/bash 2 #3 # Author: Patrick Brockmann4 # Contact: Patrick.Brockmann@cea.fr5 # History:6 # Modification: Nicolas-thierry.Martin@locean-ipsl.upmc.fr7 #8 2 9 3 … … 11 5 #--------------------------------------------------- 12 6 NEMO_TRUS=$( pwd $( dirname $0 ) ) 13 DEBUG=0; PUBLISH=0; STATUS='OK' 7 DEBUG=0; PUBLISH=0 8 STATUS='FAILED'; STEP=''# Only at end status will change to OK 14 9 15 10 # Get options for replacing some initials settings … … 51 46 datestr1=$( LC_ALL=C date -d"${DATE_STR}" +%Y-%m-%dT%H:%M ) 52 47 printf "Date\n$datestr1\n" > mesg_01_date_${CFG_USER}_${CFG_ARCH}.txt 53 # Only at end status will change to OK54 STATUS='FAILED'; STEP=''55 48 56 49 # SVN action on XIOS & NEMO essentials directories 57 50 #--------------------------------------------------- 58 print_step "Get NEMO SVN state with: ${SVN_OPT}"51 print_step 'Get NEMO code state / repository' 59 52 get_nemo_rev 60 53 … … 70 63 print_step 'Compiling XIOS' 71 64 cd ${DIR_XIOS} 72 #./make_xios --arch $ARCH -job $NPROC >& /dev/null 65 ./make_xios --full --arch $ARCH -job $NPROC #>& /dev/null 66 [ ! -e ${DIR_XIOS}/lib/libxios.a ] && get_out $STATUS $STEP 73 67 74 68 # NEMO config compiled from scratch … … 76 70 print_step "Compiling ${CONF_REF} configuration" 77 71 cd ${NEMO_CONF} 78 #[ -d ${TEST_CONF} ] && ./makenemo -n ${TEST_CONF} clean79 ./makenemo -n ${TEST_CONF} -r ${REFE_CONF} -m $ARCH -j $NPROC >& /dev/null72 [ -d ${TEST_CONF} ] && ./makenemo -n ${TEST_CONF} clean 73 ./makenemo -n ${TEST_CONF} -r ${REFE_CONF} -m $ARCH -j $NPROC #>& /dev/null 80 74 [ ! -e ${TEST_CONF}/BLD/bin/nemo.exe ] && get_out $STATUS $STEP 81 75 82 76 # Get namelists, xml & forced files for running 83 77 #--------------------------------------------------- 84 print_step 'Preparing job'78 print_step "Preparing job by copying ${CONF_REF} input files" 85 79 cd ${TEST_DIR} 86 80 find ${NEMO_CONF}/${TEST_CONF}/EXP00 -regex '.*\(cfg\|opa\|ref\|xml\)' -exec cp {} . \; … … 94 88 ${cmd_iol} > inputs_list.txt && ${cmd_iof} > /dev/null 95 89 [ $? -ne 0 ] && get_out $STATUS $STEP 90 96 91 [ $( find . -name '*.gz' -print -quit ) ] && gunzip *.gz 97 92 98 93 # Check input files in all cases 99 94 #--------------------------------------------------- 100 print_step ' Test input files difference'95 print_step 'Difference between input files' 101 96 diff_inputs 102 97 103 98 # Job submission & computing 104 99 #--------------------------------------------------- 105 print_step ' Running'100 print_step 'Submitting job' 106 101 JOB_ID=$( ${JOB_SUBM} | awk '{print $NF}' ) 107 export JOB_ID108 102 [ $? -ne 0 ] && get_out $STATUS $STEP 109 103 104 print_step 'Pending/Running job' 110 105 time_elapsed=0; time_increment=30 111 106 sleep ${time_increment} … … 118 113 sleep ${time_increment} 119 114 115 if (( ${time_elapsed} = ${TIME_LIMI} )); then 116 print_step 'Killing job' 117 ${JOB_DELE} ${JOB_ID} &> /dev/null 118 get_out $STATUS 'Job timeout' 119 fi 120 print_step 'Job finished' 121 120 122 # Eventual crash during computing 121 123 #--------------------------------------------------- 122 print_step 'Test if ASCII output files exist'124 print_step 'Test if job crashed' 123 125 if [[ ! -e ocean.output || $( grep 'E R R O R' ocean.output ) ]]; then 124 ${JOB_DELE} ${JOB_ID} &> /dev/null125 [ ! -e ocean.output ] && STEP='nemo.exe crashed at initialization'126 [ $( grep 'E R R O R' ocean.output ) ] && STEP='nemo.exe crashed'127 126 comments 'E R R O R' 128 ${JOB_DELE} ${JOB_ID} >/dev/null 2>&1129 127 get_out $STATUS $STEP 130 128 else … … 136 134 for file in ocean.output solver.stat tracer.stat; do 137 135 diff $file ${REFE_DIR}/$file 138 [ $? -ne 0 ] && STATUS='FAILED' && STEP='ASCII output file differ'136 [ $? -ne 0 ] && get_out 'FAILED' 'ASCII output file differ' 139 137 done 140 138 … … 142 140 #--------------------------------------------------- 143 141 print_step 'Test last restart NetCDF files diff' 144 diff_restart #2> /dev/null145 [ $? -ne 0 ] && STATUS='FAILED'142 diff_restart 143 [ $? -ne 0 ] && get_out 'FAILED' "$CDO diff failed" 146 144 147 145 # Get computation duration -
branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting_func.sh
r5453 r5455 3 3 4 4 comments() { 5 [ -e ocean.output ] && line=$( grep $1 ocean.output )5 state=$1 6 6 7 # Check environment architecture modification 8 #--------------------------------------------------- 9 [ $( diff -q env.log ${REFE_DIR}/env.log ) ] && line=$( diff env.log ${REFE_DIR}/env.log ) 7 if [ $state == 'E R R O R' ]; then 8 if [ -e ocean.output ]; then 9 last_time_step=$( cat ${TEST_DIR}/time.step | tr -d [:space:] ) 10 STEP='nemo.exe crashed at '${last_time_step} && export STEP 11 line=$( grep -m1 "$state" ocean.output | tr -d '\n' ) 12 else 13 STEP='nemo.exe crashed at initialization' && export STEP 14 return 15 fi 16 fi 17 18 if [ $( diff -q env.log ${REFE_DIR}/env.log ) ]; then 19 line=$( diff env.log ${REFE_DIR}/env.log | tr -d '\n' ) 20 fi 10 21 11 22 printf "Comments\n$line\n" | tee mesg_10_comments_${CFG_USER}_${CFG_ARCH}.txt … … 47 58 cmp ${TEST_DIR}/${base_name}_$comp.nc ${REFE_DIR}/${base_name}_$comp.nc 48 59 if [ $? -ne 0 ]; then 49 exportSTEP='Restart files different'60 STATUS='FAILED'; STEP='Restart files different' 50 61 printf "$CDO diffn\n" 51 62 $CDO diffn ${TEST_DIR}/${base_name}_$comp.nc ${REFE_DIR}/${base_name}_$comp.nc 2> /dev/null … … 58 69 59 70 else 71 STATUS='FAILED'; STEP='No restart files found at last time step' 60 72 printf "no restart files found for comparison\n" 61 73 fi 74 75 [ $STATUS == 'FAILED'] && get_out $STATUS $STEP 62 76 } 63 77 … … 93 107 # For time being, just get revision number from XIOS 94 108 if [ $dir == ${DIR_XIOS} ]; then 95 echo 'XIOS '$( svn info $dir | awk '(NR == 9) {print $NF}' ) >> env.log109 echo 'XIOS '$( svn info $dir | awk '(NR == 5) {print $NF}' ) >> env.log 96 110 continue 97 111 fi … … 119 133 120 134 # Send mail only when FAILED 121 if [[ ! -z $MAIL && "$STATUS"=='FAILED' ]]; then135 if [[ ! -z $MAIL && $STATUS == 'FAILED' ]]; then 122 136 cat << END_MAIL > trusting.mail 123 137 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX … … 144 158 145 159 # Save tested configuration if trusting failed 146 if [ "$STATUS" == 'FAILED' ]; then 160 if [ $STATUS == 'FAILED' ]; then 161 cd ${TEST_DIR} 147 162 touch mesg_08_inputfiles_${CFG_USER}_${CFG_ARCH}.txt mesg_09_realcputime_${CFG_USER}_${CFG_ARCH}.txt \ 148 163 mesg_10_comments_${CFG_USER}_${CFG_ARCH}.txt
Note: See TracChangeset
for help on using the changeset viewer.