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 12422 – NEMO

Changeset 12422


Ignore:
Timestamp:
2020-02-20T15:25:47+01:00 (4 years ago)
Author:
mathiot
Message:

merge sync_mysrc and sync_expcfg into sync_config, add a clean_config function and add option in sette.sh to activate synchronisation of MY_SCR/EXPREF with CONFIG_ST/EXP00/MY_SRC (-s option) or to clean a config with makenemo clean (-c option)

Location:
utils/CI/sette_ticket2304
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • utils/CI/sette_ticket2304/all_functions.sh

    r12290 r12422  
    9191usage=" if value is a string ths is neede syntax : ./set_namelist namelist_name var_name \"new_value\" " 
    9292 
    93 # sync MYSRC files 
    94 sync_mysrc() { 
    95 lREF=cfgs/$1    # reference  
    96 lCFG=cfgs/$2    # target 
    97 if [ -d $lREF/MY_SRC ] ; then 
    98    rsync $lREF/MY_SRC/* $lCFG/MY_SRC/* 
    99 fi 
    100 } 
    101  
    102 # sync namelist files and xios related files 
    103 sync_expcfg() { 
    104 set -x 
    105 lREF=cfgs/$1 
    106 lCFG=cfgs/$2 
    107 if [ -d $lREF/EXPREF ] ; then 
    108    rsync $lREF/EXPREF/*namelist*_cfg  $lCFG/EXP00/. 
    109    rsync $lREF/EXPREF/iodef.xml       $lCFG/EXP00/. 
    110    rsync $lREF/EXPREF/context_*.xml   $lCFG/EXP00/. 
    111    rsync $lREF/EXPREF/file_def_*.xml  $lCFG/EXP00/. 
    112 fi 
    113 set +x 
     93# sync MYSRC files (input CFG and CFG_ST) 
     94sync_config() { 
     95   if [ ${SETTE_SYNC_CONFIGS} == "yes" ]; then 
     96      lREF=$3/$1    # reference  
     97      lCFG=$3/$2    # target 
     98      if [ -d $lREF/MY_SRC ] && [ -d $lCFG/MY_SRC ] ; then 
     99         rsync $lREF/MY_SRC/* $lCFG/MY_SRC/. 
     100      fi 
     101 
     102      if [ -d $lREF/EXPREF ] && [ -d $lCFG/EXP00 ] ; then 
     103         rsync $lREF/EXPREF/*namelist*_cfg  $lCFG/EXP00/. 
     104         rsync $lREF/EXPREF/iodef.xml       $lCFG/EXP00/. 
     105         rsync $lREF/EXPREF/context_*.xml   $lCFG/EXP00/. 
     106         rsync $lREF/EXPREF/file_def_*.xml  $lCFG/EXP00/. 
     107      fi 
     108   fi 
     109} 
     110 
     111# clean _ST config (input CFG CFG_ST TYPE (test or ref)) 
     112clean_config() { 
     113   if [ ${SETTE_CLEAN_CONFIGS} == "yes" ]; then 
     114      lREF=$1 
     115      lCFG=$2 
     116      lTYP=$3 
     117      if [ ${lTYP} == 'tests' ]; then 
     118         ./makenemo -n $lCFG -a $lREF clean 
     119      elif [ ${lTYP} == 'cfgs' ]; then 
     120         ./makenemo -n $lCFG -r $lREF clean 
     121      else 
     122         echo 'ERROR in the cleaning process'; exit 42 
     123      fi 
     124   fi 
    114125} 
    115126 
  • utils/CI/sette_ticket2304/param.cfg

    r12135 r12422  
    6262# add key key_nosignedzero at the compilation step 
    6363ADD_NOSIGNEDZERO=${SETTE_ADD_NOSIGNEDZERO:-"yes"} 
    64 #- only for IBM 
     64# only for IBM 
    6565#TMPDIR=${CONFIG_DIR}/${NEW_CONF}/EXP00 
     66# cleaning CFG_ST 
     67SETTE_CLEAN_CONFIGS=${SETTE_CLEAN_CONFIGS:-"no"} 
     68# synchronisation MY_SRC and EXP00 of CFG_ST with MY_SRC and EXPREF form CFG 
     69SETTE_SYNC_CONFIGS=${SETTE_SYNC_CONFIGS:-"no"} 
    6670# ------------------------------------------------------------------------------------------ 
    6771# 
  • utils/CI/sette_ticket2304/sette.sh

    r12272 r12422  
    1111 
    1212if [ $# -gt 0 ]; then 
    13   while getopts :ht: option; do  
     13  while getopts t:csh option; do  
    1414     case $option in 
     15        c) export SETTE_CLEAN_CONFIGS='yes' 
     16           echo "" 
     17           echo "Configuration $SETTE_TEST_CONFIGS will be cleaned" 
     18           echo "";; 
     19        s) export SETTE_SYNC_CONFIGS='yes' 
     20           echo "" 
     21           echo "MY_SRC and EXP00 in $SETTE_TEST_CONFIGS will be synchronised with the MY_SRC and EXPREF from the reference configuration" 
     22           echo "";; 
    1523        t) export SETTE_TEST_CONFIGS=$OPTARG 
    1624           echo "" 
    1725           echo "Configuration $SETTE_TEST_CONFIGS will be tested if they are available" 
    1826           echo "" ;; 
    19         h | *) echo 'sette.sh allow no arguments (all configuration will be tested or -t "CFG1_to_test CFG2_to_test ..."'; exit 42 ;; 
     27        h | *) echo 'sette.sh allows no arguments (in this case all configuration will be tested)' 
     28               echo '-t "CFG1_to_test CFG2_to_test ..." to test some specific configurations' 
     29               echo '-c to clean each configuration' 
     30               echo '-s to synchronise the sette MY_SRC and EXP00 with the reference MY_SRC and EXPREF'; exit 42 ;; 
    2031     esac 
    2132  done 
  • utils/CI/sette_ticket2304/sette_reference-configurations.sh

    r12290 r12422  
    165165    # syncronisation if target directory/file exist (not done by makenemo) 
    166166    . ${SETTE_DIR}/all_functions.sh 
    167     sync_mysrc  GYRE_PISCES GYRE_PISCES_ST 
    168     sync_expcfg GYRE_PISCES GYRE_PISCES_ST 
     167    sync_config  GYRE_PISCES GYRE_PISCES_ST 'cfgs' 
     168    clean_config GYRE_PISCES GYRE_PISCES_ST 'cfgs' 
    169169    # 
    170170    . ./makenemo -m ${CMP_NAM} -n GYRE_PISCES_ST -r GYRE_PISCES -j 8 add_key "${ADD_KEYS}" del_key "${DEL_KEYS}" 
     
    311311    # syncronisation if target directory/file exist (not done by makenemo) 
    312312    . ${SETTE_DIR}/all_functions.sh 
    313     sync_mysrc  ORCA2_ICE_PISCES ORCA2_ICE_PISCES_ST 
    314     sync_expcfg ORCA2_ICE_PISCES ORCA2_ICE_PISCES_ST 
     313    sync_config  ORCA2_ICE_PISCES ORCA2_ICE_PISCES_ST 'cfgs' 
     314    clean_config ORCA2_ICE_PISCES ORCA2_ICE_PISCES_ST 'cfgs' 
    315315    # 
    316316    . ./makenemo -m ${CMP_NAM} -n ORCA2_ICE_PISCES_ST -r ORCA2_ICE_PISCES -j 8 add_key "${ADD_KEYS}" del_key "${DEL_KEYS}" 
     
    558558    # syncronisation if target directory/file exist (not done by makenemo) 
    559559    . ${SETTE_DIR}/all_functions.sh 
    560     sync_mysrc  ORCA2_OFF_PISCES ORCA2_OFF_PISCES_ST 
    561     sync_expcfg ORCA2_OFF_PISCES ORCA2_OFF_PISCES_ST 
     560    sync_config  ORCA2_OFF_PISCES ORCA2_OFF_PISCES_ST 'cfgs' 
     561    clean_config ORCA2_OFF_PISCES ORCA2_OFF_PISCES_ST 'cfgs' 
    562562    # 
    563563    . ./makenemo -m ${CMP_NAM} -n ORCA2_OFF_PISCES_ST -r ORCA2_OFF_PISCES -j 8 add_key "${ADD_KEYS}" del_key "${DEL_KEYS}" 
     
    754754    # syncronisation if target directory/file exist (not done by makenemo) 
    755755    . ${SETTE_DIR}/all_functions.sh 
    756     sync_mysrc  AMM12 AMM12_ST 
    757     sync_expcfg AMM12 AMM12_ST 
     756    sync_config  AMM12 AMM12_ST 'cfgs' 
     757    clean_config AMM12 AMM12_ST 'cfgs' 
    758758    # 
    759759    . ./makenemo -m ${CMP_NAM} -n AMM12_ST -r AMM12 -j 8 add_key "${ADD_KEYS}" del_key "${DEL_KEYS}" 
     
    887887    # syncronisation if target directory/file exist (not done by makenemo) 
    888888    . ${SETTE_DIR}/all_functions.sh 
    889     sync_mysrc  ORCA2_SAS_ICE ORCA2_SAS_ICE_ST 
    890     sync_expcfg ORCA2_SAS_ICE ORCA2_SAS_ICE_ST 
     889    sync_config  ORCA2_SAS_ICE ORCA2_SAS_ICE_ST 'cfgs' 
     890    clean_config ORCA2_SAS_ICE ORCA2_SAS_ICE_ST 'cfgs' 
    891891    # 
    892892    . ./makenemo -m ${CMP_NAM} -n ORCA2_SAS_ICE_ST -r ORCA2_SAS_ICE -j 8 add_key "${ADD_KEYS}" del_key "${DEL_KEYS}" 
     
    10271027    # syncronisation if target directory/file exist (not done by makenemo) 
    10281028    . ${SETTE_DIR}/all_functions.sh 
    1029     sync_mysrc  ORCA2_ICE_PISCES ORCA2_ICE_OBS_ST 
    1030     sync_expcfg ORCA2_ICE_PISCES ORCA2_ICE_OBS_ST 
     1029    sync_config  ORCA2_ICE_PISCES ORCA2_ICE_OBS_ST 'cfgs' 
     1030    clean_config ORCA2_ICE_PISCES ORCA2_ICE_OBS_ST 'cfgs' 
    10311031    # 
    10321032    . ./makenemo -m ${CMP_NAM} -n ORCA2_ICE_OBS_ST -r ORCA2_ICE_PISCES -d "OCE ICE"  -j 8 add_key "key_asminc ${ADD_KEYS}" del_key "key_top" 
     
    11511151    # syncronisation if target directory/file exist (not done by makenemo) 
    11521152    . ${SETTE_DIR}/all_functions.sh 
    1153     sync_mysrc  AGRIF_DEMO AGRIF_DEMO_ST 
    1154     sync_expcfg AGRIF_DEMO AGRIF_DEMO_ST 
     1153    sync_config  AGRIF_DEMO AGRIF_DEMO_ST 'cfgs' 
     1154    clean_config AGRIF_DEMO AGRIF_DEMO_ST 'cfgs' 
    11551155    # 
    11561156    . ./makenemo -m ${CMP_NAM} -n AGRIF_DEMO_ST -r AGRIF_DEMO -j 8 add_key "${ADD_KEYS}" del_key "${DEL_KEYS}" 
     
    14261426    # syncronisation if target directory/file exist (not done by makenemo) 
    14271427    . ${SETTE_DIR}/all_functions.sh 
    1428     sync_mysrc  AGRIF_DEMO AGRIF_DEMO_NOAGRIF_ST 
    1429     sync_expcfg AGRIF_DEMO AGRIF_DEMO_NOAGRIF_ST 
     1428    sync_config  AGRIF_DEMO AGRIF_DEMO_NOAGRIF_ST 'cfgs' 
     1429    clean_config AGRIF_DEMO AGRIF_DEMO_NOAGRIF_ST 'cfgs' 
    14301430    # 
    14311431    . ./makenemo -m ${CMP_NAM} -n AGRIF_DEMO_NOAGRIF_ST -r AGRIF_DEMO -j 8 add_key "${ADD_KEYS}" del_key "key_agrif" 
     
    14691469    # syncronisation if target directory/file exist (not done by makenemo) 
    14701470    . ${SETTE_DIR}/all_functions.sh 
    1471     sync_mysrc  SPITZ12 SPITZ12_ST 
    1472     sync_expcfg SPITZ12 SPITZ12_ST 
     1471    sync_config  SPITZ12 SPITZ12_ST 'cfgs' 
     1472    clean_config SPITZ12 SPITZ12_ST 'cfgs' 
    14731473    # 
    14741474    . ./makenemo -m ${CMP_NAM} -n SPITZ12_ST -r SPITZ12 -j 8 add_key "${ADD_KEYS}" del_key "${DEL_KEYS}" 
  • utils/CI/sette_ticket2304/sette_test-cases.sh

    r12290 r12422  
    165165    cd ${MAIN_DIR} 
    166166    # 
    167     # syncronisation if target directory/file exist (not done by makenemo) 
    168167    . ${SETTE_DIR}/all_functions.sh 
    169     sync_mysrc  OVERFLOW OVERFLOW_ST 
    170     sync_expcfg OVERFLOW OVERFLOW_ST 
     168    # 
     169    clean_config OVERFLOW OVERFLOW_ST 'tests' 
     170    # 
     171    sync_config  OVERFLOW OVERFLOW_ST 'tests' 
    171172    # 
    172173    . ./makenemo -m ${CMP_NAM} -n OVERFLOW_ST -a OVERFLOW -j 8 add_key "${ADD_KEYS}" del_key "${DEL_KEYS}" 
     
    270271    # syncronisation if target directory/file exist (not done by makenemo) 
    271272    . ${SETTE_DIR}/all_functions.sh 
    272     sync_mysrc  LOCK_EXCHANGE LOCK_EXCHANGE_ST 
    273     sync_expcfg LOCK_EXCHANGE LOCK_EXCHANGE_ST 
     273    # 
     274    clean_config LOCK_EXCHANGE LOCK_EXCHANGE_ST 'tests' 
     275    # 
     276    sync_config  LOCK_EXCHANGE LOCK_EXCHANGE_ST 'tests' 
    274277    # 
    275278    . ./makenemo -m ${CMP_NAM} -n LOCK_EXCHANGE_ST -a LOCK_EXCHANGE -j 8 add_key "${ADD_KEYS}" del_key "${DEL_KEYS}" 
     
    374377    # syncronisation if target directory/file exist (not done by makenemo) 
    375378    . ${SETTE_DIR}/all_functions.sh 
    376     sync_mysrc  VORTEX VORTEX_ST 
    377     sync_expcfg VORTEX VORTEX_ST 
     379    # 
     380    clean_config VORTEX VORTEX_ST 'tests' 
     381    # 
     382    sync_config  VORTEX VORTEX_ST 'tests' 
    378383    # 
    379384    . ./makenemo -m ${CMP_NAM} -n VORTEX_ST -a VORTEX -j 8  add_key "${ADD_KEYS}" del_key "${DEL_KEYS}" 
     
    557562    # syncronisation if target directory/file exist (not done by makenemo) 
    558563    . ${SETTE_DIR}/all_functions.sh 
    559     sync_mysrc  ICE_AGRIF ICE_AGRIF_ST 
    560     sync_expcfg ICE_AGRIF ICE_AGRIF_ST 
     564    # 
     565    clean_config ICE_AGRIF ICE_AGRIF_ST 'tests' 
     566    # 
     567    sync_config  ICE_AGRIF ICE_AGRIF_ST 'tests' 
    561568    # 
    562569    . ./makenemo -m ${CMP_NAM} -n ICE_AGRIF_ST -a ICE_AGRIF -j 8  add_key "${ADD_KEYS}" del_key "${DEL_KEYS}" 
     
    748755    # syncronisation if target directory/file exist (not done by makenemo) 
    749756    . ${SETTE_DIR}/all_functions.sh 
    750     sync_mysrc  ISOMIP ISOMIP_ST 
    751     sync_expcfg ISOMIP ISOMIP_ST 
     757    # 
     758    clean_config ISOMIP ISOMIP_ST 'tests' 
     759    # 
     760    sync_config  ISOMIP ISOMIP_ST 'tests' 
    752761    # 
    753762    . ./makenemo -m ${CMP_NAM} -n ISOMIP_ST -a ISOMIP -j 8 add_key "${ADD_KEYS}" del_key "${DEL_KEYS}" 
Note: See TracChangeset for help on using the changeset viewer.