- Timestamp:
- 2015-07-29T20:33:51+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting.sh
r5637 r5644 2 2 3 3 4 cd $( dirname $0 ) 5 4 6 ## Set defaults 5 7 ##--------------------------------------------------- 6 NEMO_TRUS=$( pwd $( dirname $0 ))8 NEMO_TRUS=$( pwd ) 7 9 DEBUG=0; PUBLISH=0 8 10 I_MODULE=0 ## No 'module' command by default … … 13 15 while [ $# -ne 0 ]; do 14 16 case $1 in 15 -a|--archive) FORC_TARF=$2 ; shift 2;; -b|--branch ) NEMO_BRAN=$2 ; shift 2;;17 -a|--archive) NEMO_TARF=$2 ; shift 2;; -b|--branch ) NEMO_BRAN=$2 ; shift 2;; 16 18 -d|--debug ) set -vx; DEBUG=1 ; shift ;; -e|--email ) EMAIL=$2 ; shift 2;; 17 19 -j|--job ) NPROC=$2 ; shift 2;; -h|--help ) cat trusting_help.txt; exit 1;; 18 -m|--machine) CFG_ARCH=$2; shift 2;; -n|--newconf) TEST_CONF=$2 ; shift 2;;20 -m|--machine) NEMO_HPCC=$2 ; shift 2;; -n|--newconf) TEST_CONF=$2 ; shift 2;; 19 21 -r|--refconf) REFE_CONF=$2 ; shift 2;; -t|--time ) TIME_LIMI=$2 ; shift 2;; 20 -p|--publish) PUBLISH=1 ; shift ;; -u|--user ) CFG_USER=$2; shift 2;;22 -p|--publish) PUBLISH=1 ; shift ;; -u|--user ) NEMO_USER=$2 ; shift 2;; 21 23 -v|--version) NEMO_VERS=$2 ; shift 2;; *) cat trusting_help.txt; exit 1;; 22 24 esac … … 25 27 ## Initialization (super-computer & user environment) 26 28 ##--------------------------------------------------- 27 if [[ ! -z "${ CFG_ARCH}" && ! -z "${CFG_USER}" ]]; then29 if [[ ! -z "${NEMO_HPCC}" && ! -z "${NEMO_USER}" ]]; then 28 30 29 if [ ! $( find ${NEMO_TRUS}/config -name ${ CFG_USER}.cfg) ]; then30 echo 'No configuration file in '${NEMO_TRUS}'/config for '${CFG_USER}; exit 131 elif [ ! $( find ${NEMO_TRUS}/config -name ${ CFG_ARCH}.cfg) ]; then32 echo 'No configuration file in '${NEMO_TRUS}'/config for '${CFG_ARCH}; exit 131 if [ ! $( find ${NEMO_TRUS}/config -name ${NEMO_USER}'.cfg' ) ]; then 32 echo 'No configuration file (.cfg) in '${NEMO_TRUS}'/config for '${NEMO_USER}; exit 1 33 elif [ ! $( find ${NEMO_TRUS}/config -name ${NEMO_HPCC}'.cfg' ) ]; then 34 echo 'No configuration file (.cfg) in '${NEMO_TRUS}'/config for '${NEMO_HPCC}; exit 1 33 35 else 34 36 . ${NEMO_TRUS}/trusting.env … … 41 43 . ./trusting_func.sh 42 44 43 ## 45 ## Summary of trusting test context 44 46 ##--------------------------------------------------- 47 printf "\ 48 NEMO Trusting test:\n\ 49 -------------------\n\ 50 Testing ${TEST_CONF} based on ${REFE_CONF} from ${NEMO_BRAN}\n\ 51 Configuration files: ${NEMO_USER}.cfg & ${NEMO_HPCC}.cfg\n" 52 53 ## Making timestamped directory with messenger files 54 ##--------------------------------------------------- 55 print_step 'Time-stamp generation & testing directory creation' 45 56 mkdir -p ${TEST_DIR} ${REFE_DIR} 46 57 echo ${TEST_DIR} && cd ${TEST_DIR} 47 date_str=$( date -ud ${DATESTR} +"%F %R %Z" ) 48 printf "Date\n${date_str}\n" > mesg_01_date_${CFG_USER}_${CFG_ARCH}.txt 58 init_files && get_date 49 59 50 60 ## SVN action on XIOS & NEMO essentials directories 51 61 ##--------------------------------------------------- 52 print_step 'SVN actions on NEMO directories'62 print_step 'SVN command on NEMO directories:' 53 63 get_nemo_rev 54 64 55 65 ## Check softwares versions (source arch environment) 56 66 ##--------------------------------------------------- 57 print_step 'Get softwares release '67 print_step 'Get softwares releases' 58 68 [ -e ${ARCH_ENV} ] && . ${ARCH_ENV} > /dev/null 59 [ $? -eq 0 ] && I_MODULE=1 60 export I_MODULE 69 (( $? == 0 )) && export I_MODULE=1 61 70 get_soft_rel 62 71 cat model.log … … 64 73 ## XIOS compiling 65 74 ##--------------------------------------------------- 66 print_step 'Compil ingXIOS'75 print_step 'Compile XIOS' 67 76 cd ${DIR_XIOS} 68 77 full=''; [ $DEBUG -eq 0 ] && full='--full' 69 ./make_xios $full --arch ${ CFG_ARCH} --job $NPROC >& /dev/null78 ./make_xios $full --arch ${NEMO_HPCC} --job $NPROC >& /dev/null 70 79 [ ! -e ${DIR_XIOS}/lib/libxios.a ] && get_out 1 71 80 72 81 ## NEMO config compiled from scratch 73 82 ##--------------------------------------------------- 74 print_step "Compil ing${REFE_CONF} configuration"83 print_step "Compile ${REFE_CONF} configuration" 75 84 cd ${NEMO_CONF} 76 85 [[ -d ${TEST_CONF} && $DEBUG -eq 0 ]] && ./makenemo -n ${TEST_CONF} clean > /dev/null 77 ./makenemo -n ${TEST_CONF} -r ${REFE_CONF} -m ${ CFG_ARCH} -j $NPROC>& /dev/null86 ./makenemo -n ${TEST_CONF} -r ${REFE_CONF} -m ${NEMO_HPCC} -j $NPROC >& /dev/null 78 87 [ ! -e ${TEST_CONF}/BLD/bin/nemo.exe ] && get_out 2 79 88 80 89 ## Get namelists, xml & forcing files for running 81 90 ##--------------------------------------------------- 82 print_step "Preparing job by copying ${REFE_CONF} input files"91 print_step 'Set job (copying & extracting input files)' 83 92 cd ${TEST_DIR} 84 93 find ${NEMO_CONF}/${TEST_CONF}/EXP00 -regex '.*\(cfg\|opa\|ref\|xml\)' -exec cp {} . \; 85 94 get_inputs 86 [ $? -ne 0 ]&& get_out 395 (( $? != 0 )) && get_out 3 87 96 [ $( find . -name '*.gz' -print -quit ) ] && gunzip *.gz 88 97 89 98 ## Check input files in all cases 90 99 ##--------------------------------------------------- 91 print_step ' Difference with standard input files list'100 print_step 'Compare with standard input files list' 92 101 diff_inputs 93 102 94 103 ## Job submission & computing 95 104 ##--------------------------------------------------- 96 print_step 'Submit tingjob'105 print_step 'Submit job' 97 106 JOB_ID=$( eval ${JOB_SUBM} ) 98 [ $? -ne 0 ]&& get_out 499 print_step ' Holding/Running job'107 (( $? != 0 )) && get_out 4 108 print_step 'Pending job' 100 109 job_pending 101 110 print_step 'Job finished'
Note: See TracChangeset
for help on using the changeset viewer.