Changeset 5156
- Timestamp:
- Aug 1, 2024, 5:58:40 PM (5 months ago)
- Location:
- BOL/script_install_amaury
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
BOL/script_install_amaury/check_version.sh
r4676 r5156 1 1 #!/bin/bash 2 # $Id$ 3 4 #set -vx 2 3 set -eu 5 4 6 5 # AFAIRE … … 22 21 ######################################################################### 23 22 24 version_ref=latest 25 resolution=48x36x39 26 compilo=gfortran 27 parallel=mpi_omp 28 # Option pour le debug du script check_version lui meme qui consiste a ne 29 # pars reexecuter l'installation et les simulations mais a simplement 30 # refaire les diff sur des simulations existantes. 31 justcheck=0 # just compare results not writing of results in RESUBENCH 32 tmpdir=/tmp/`whoami` ; mkdir -p $tmpdir 33 tmpdir=/home/lmdz/tmp 34 rel_svn="" 35 local_d=`pwd` 36 37 install=1 38 rad=rrtm 39 check_1D=1 40 check_SP=1 41 check_1p1=1 42 check_Debug=1 43 check_isotopes=1 44 check_parallel=1 45 check_compile=1 46 check_ini=1 47 mail_address=lmdz-commit@listes.lmd.ipsl.fr 48 MODEL="" 49 branche=trunk 50 51 ######################################################################### 52 # Pour aller chercher des fichiers par wget si pas sur le cpte lmdz 53 ######################################################################### 54 55 if [ `whoami` = lmdz ] ; then 56 get="ln -sf /u/lmdz/WWW" 23 function get() { # fetch lmdz files 24 local file=$1 25 26 if [[ -f $file ]]; then return; fi 27 # TODO in the final version: \rm -f if exists 28 29 if [[ $(whoami) = "lmdz" ]]; then 30 ln -sf "/u/lmdz/WWW/$file" . 31 else 32 wget "https://www.lmd.jussieu.fr/~lmdz/$file" 33 fi 34 } 35 36 function set_default_args_val() { 37 version_ref="latest" 38 resolution="48x36x39" 39 parallel="mpi_omp" 40 # Option pour le debug du script check_version lui meme qui consiste a ne 41 # pars reexecuter l'installation et les simulations mais a simplement 42 # refaire les diff sur des simulations existantes. 43 justcheck=0 # just compare results not writing of results in RESUBENCH 44 tmpdir="/tmp/$(whoami)"; mkdir -p "$tmpdir" 45 tmpdir="/home/lmdz/tmp" 46 rel_svn="" 47 local_d=$(pwd) 48 49 install=1 50 rad=rrtm 51 check_1D=1 52 check_1p1=1 53 check_isotopes=1 54 check_parallel=1 55 check_compile=1 56 check_ini=1 57 mail_address=lmdz-commit@listes.lmd.ipsl.fr 58 MODEL="" 59 branche=trunk 60 } 61 62 function read_user_options() { 63 while (($# > 0)); do 64 case $1 in 65 "-h") cat <<fin 66 check_version.sh [-h] version [-latest version_ref] 67 version is the name of the version of LMDZ to be checked modipsl.version.tar.gz 68 version_ref is the version to be compared with. 69 Default "latest". 70 options: 71 -justcheck : just check results, do not overwrite anything 72 -r svn : revision 73 -latest latest : latest is the date of the last version tested 74 -model_dir : directory where tun run the bench if LMDZ is already installed 75 fin 76 exit 2;; 77 78 "-justcheck") justcheck=1; shift;; 79 "-r") rel_svn="$2"; shift; shift;; 80 "-latest") version_ref="$2"; shift; shift;; 81 "-model_dir") MODEL="$2"; shift; shift;; 82 *) version="$1"; shift;; 83 esac 84 done 85 } 86 87 set_default_args_val 88 read_user_options "$@" 89 90 ################################################################################ 91 # Definition des noms des repertoires à comparer 92 ################################################################################ 93 94 if [[ $MODEL = "" ]]; then 95 MODEL=$tmpdir/LMDZ$version$rel_svn 96 branche=$(echo "$version" |cut -c 10-) 97 datelmdz=$(echo "$version" | cut -d. -f1) 57 98 else 58 get="wget https://www.lmd.jussieu.fr/~lmdz"59 fi60 61 #########################################################################62 # Options du script63 #########################################################################64 65 while (($# > 0))66 do67 case $1 in68 "-h") cat <<fin69 check_version.sh [-h] version [-latest version_ref]70 version is the name of the version of LMDZ to be checked modipsl.version.tar.gz71 version_ref is the version to be compared with.72 Default "latest".73 options:74 -c compiler : sets the compiler to use75 -justcheck : just check results, do not overwrite anything76 -r svn : revision77 -latest latest : latest is the date of the last version tested78 -model_dir : directory where tun run the bench if LMDZ is already installed79 fin80 exit;;81 82 "-c") compilo="$2" ; shift ; shift ;;83 "-justcheck") justcheck=1 ; shift ;;84 "-r") rel_svn="$2" ; shift ; shift ;;85 "-latest") version_ref="$2" ; shift ; shift ;;86 "-model_dir") MODEL="$2" ; shift ; shift ;;87 *) version="$1" ; shift ;;88 esac89 done90 91 ################################################################################92 # Definition des noms des repertoires à comparer93 ################################################################################94 95 # branche=`echo $version | cut -d. -f2`96 if [ "$MODEL" = "" ] ; then97 MODEL=$tmpdir/LMDZ$version$rel_svn98 branche=`echo $version |cut -c 10-`99 datelmdz=`echo $version | cut -d. -f1`100 else101 #if [ $install = 1 ] ; then echo Use model_dir only if the model is already installed ; exit ; fi102 99 install=0 103 if [ "`echo $MODEL | cut -c1`" != "/" ] ; then MODEL=`pwd`/$MODEL; fi # MODEL transformed in absolute path if not104 datelmdz= `date +%Y%m%d`$$105 fi 106 107 echo version $version $branche $datelmdz108 RESU_D=~/WWW/RESUBENCH/$branche/ $compilo109 if [ $justcheck = 0 ]; then110 resubench= $RESU_D/$datelmdz$rel_svn111 if [ -d $resubench ] ; then mv $resubench $resubench$$; fi112 mkdir -p $resubench113 fi 114 latest= $RESU_D/$version_ref115 echo $latest100 if [[ "$(echo "$MODEL" | cut -c1)" != "/" ]]; then MODEL=$(pwd)/$MODEL; fi # MODEL transformed in absolute path if not 101 datelmdz=$(date +%Y%m%d)$$ 102 fi 103 104 echo "version $version $branche $datelmdz" 105 RESU_D=~/WWW/RESUBENCH/$branche/defaul 106 if [[ $justcheck = 0 ]]; then 107 resubench="$RESU_D/$datelmdz$rel_svn" 108 if [[ -d $resubench ]]; then mv "$resubench" "$resubench$$"; fi 109 mkdir -p "$resubench" 110 fi 111 latest="$RESU_D/$version_ref" 112 echo "$latest" 116 113 117 114 # recuperation de la version a laquelle on compare pour le message final : 118 comparea=`ls -ld $RESU_D/$version_ref | awk -F/ ' { print $NF } '` 119 echo comparea $comparea 120 121 ################################################################################ 122 echo 0. Installation du modele 123 ################################################################################ 124 125 # Edition de install.sh, install.sh avec bench 48x36x19 126 if [ $install = 1 ] ; then 127 cd $tmpdir 128 if [ "$rel_svn" = "" ] ; then opt_svn="" ; else opt_svn="-r $rel_svn" ; fi 129 \rm -f install_lmdz.sh ; $get/pub/install_lmdz.sh ; chmod +x install_lmdz.sh 130 # On install sans les bench pour que les benchs soient faits à la main 131 # ./install_lmdz.sh -v $version $opt_svn -d $resolution -SCM -parallel $parallel -veget CMIP6 132 ./install_lmdz.sh -unstable -v $version $opt_svn -d $resolution -parallel $parallel -veget CMIP6 -bench 0 133 fi 115 comparea=$(ls -ld "$RESU_D/$version_ref" | awk -F/ ' { print $NF } ') 116 echo "comparea $comparea" 117 118 function install_model() { 119 local opt_svn 120 121 echo "0. Installation du modele" 122 123 # Edition de install.sh, install.sh avec bench 48x36x19 124 if [[ $install = 1 ]]; then 125 cd $tmpdir 126 if [[ $rel_svn = "" ]]; then opt_svn=""; else opt_svn="-r $rel_svn"; fi 127 get "pub/install_lmdz.sh"; chmod +x install_lmdz.sh 128 # On install sans les bench pour que les benchs soient faits à la main 129 ./install_lmdz.sh -unstable -v "$version" "$opt_svn" -d $resolution -parallel $parallel -veget CMIP6 -bench 0 130 fi 131 } 132 133 install_model 134 134 135 135 ################################################################################ … … 137 137 ################################################################################ 138 138 139 if [ $check_1D = 1 ] 139 if [ $check_1D = 1 ]; then 140 140 cd $MODEL 141 if [ ! -d 1D ] ; then $get/pub/1D/1D.tar.gz ; tar xvf 1D.tar.gz; fi # get 1D model142 if [ ! -d 1D/EXEC ] ; then mv 1D/EXEC 1D/SAVE_EXEC$$; fi143 cd 1D ; sed -e "s:^listecas=.*$:listecas=ARMCU/REF:" run.sh; ./run.sh # run 1D model144 # Controling outputs for the ARMCU/REF test case 141 if [ ! -d 1D ]; then $get/pub/1D/1D.tar.gz; tar xvf 1D.tar.gz; fi # get 1D model 142 if [ ! -d 1D/EXEC ]; then mv 1D/EXEC 1D/SAVE_EXEC$$; fi 143 cd 1D; sed -e "s:^listecas=.*$:listecas=ARMCU/REF:" run.sh; ./run.sh # run 1D model 144 # Controling outputs for the ARMCU/REF test case -d $dim" 145 145 outf=$MODEL/1D/EXEC/6AL79/ARMCU/REF/restartphy.nc 146 if [ -f $outf ] 147 if [ $justcheck = 0 ] 146 if [ -f $outf ]; then 147 if [ $justcheck = 0 ]; then 148 148 mkdir -p $resubench/ARMCU/REF 149 149 cp $outf $resubench/ARMCU/REF/ 150 150 fi 151 151 cmp -s $outf $latest/ARMCU/REF/restartphy.nc 152 if [ $? = 0 ] ; then converge1D=U ; else converge1D=u; fi152 if [ $? = 0 ]; then converge1D=U; else converge1D=u; fi 153 153 else 154 154 converge1D=- … … 164 164 LMDZdir=`pwd` 165 165 echo LMDZdir $LMDZdir 166 if [ -d $BENCH ] ; then mkdir -p SAVE$$ ; mv BENCH$resolution SAVE$$; fi167 $get/pub/3DBenchs/bench_lmdz_$resolution.tar.gz 168 cd $BENCH ; $get/pub/3DBenchs/BENCHCMIP6.tar.gz .; tar xvf BENCHCMIP6.tar.gz166 if [ -d $BENCH ]; then mkdir -p SAVE$$; mv BENCH$resolution SAVE$$; fi 167 $get/pub/3DBenchs/bench_lmdz_$resolution.tar.gz; tar xvf bench_lmdz_$resolution.tar.gz 168 cd $BENCH; $get/pub/3DBenchs/BENCHCMIP6.tar.gz .; tar xvf BENCHCMIP6.tar.gz 169 169 sed -i'' -e "s:VEGET=n:VEGET=y:" config.def 170 ./compilegcm_fcm.sh 171 172 173 if [ -f restartphy.nc ] 174 if [ ! -f gcm.install ] ; then \cp -f gcm.e gcm.install; fi170 ./compilegcm_fcm.sh; ./bench.sh > out.bench 2>&1 171 172 173 if [ -f restartphy.nc ]; then 174 if [ ! -f gcm.install ]; then \cp -f gcm.e gcm.install; fi 175 175 176 176 ######################################################################### … … 190 190 191 191 # Ici on se contente d'analyser le bench automatique qui vient de tourner 192 if [ $justcheck = 0 ] 193 if [ -f restartphy.nc ] 194 if [ $justcheck = 0 ] 192 if [ $justcheck = 0 ]; then mkdir -p $resubench/$BENCH; fi 193 if [ -f restartphy.nc ]; then 194 if [ $justcheck = 0 ]; then 195 195 ncks -M -m -h -v ps -O restart.nc $resubench/$BENCH/ps.nc 196 196 cp restart.nc $resubench/$BENCH/restart.nc 197 197 fi 198 198 cmp -s ./restart.nc $latest/$BENCH/restart.nc 199 if [ $? = 0 ] ; then converge=S ; else converge=s; fi199 if [ $? = 0 ]; then converge=S; else converge=s; fi 200 200 else 201 201 converge=- … … 208 208 # On utilse l'executable du bench de base 209 209 210 if [ $check_1p1 = 1 ] 210 if [ $check_1p1 = 1 ]; then 211 211 \cp -f gcm.install gcm.e 212 212 suf=NPv6.0.14splith 213 213 sed -e 's/VEGET=y/VEGET=n/' config.def_oraer > config.def 214 if [ -f physiq.def_$suf ] ; then \cp -f physiq.def_$suf physiq.def; fi214 if [ -f physiq.def_$suf ]; then \cp -f physiq.def_$suf physiq.def; fi 215 215 $get/Distrib/unpun.sh 216 chmod +x unpun.sh 216 chmod +x unpun.sh; ./unpun.sh -parallel $parallel 217 217 cmp -s SIM2/ps_end.nc SIM1+1/ps_end.nc 218 if [ $? = 0 ] 218 if [ $? = 0 ]; then 219 219 unpun=OK 220 220 else … … 226 226 # 2016/06/21 : comparaison des versions nouvelles physique (dans SIM1) 227 227 cd $LMDZdir/$BENCH 228 if [ -f SIM1/restartphy.nc ] 229 if [ $justcheck = 0 ] 228 if [ -f SIM1/restartphy.nc ]; then 229 if [ $justcheck = 0 ]; then 230 230 ncks -M -m -h -v ps -O SIM1/restart.nc $resubench/$BENCH/ps$suf.nc 231 231 cp SIM1/restart.nc $resubench/$BENCH/restart$suf.nc … … 233 233 \rm sechiba_out_2.nc sechiba_history.nc sechiba_rest_out.nc 234 234 cmp -s SIM1/restart.nc $latest/$BENCH/restart$suf.nc 235 if [ $? = 0 ] ; then convergeNP=N ; else convergeNP=n; fi235 if [ $? = 0 ]; then convergeNP=N; else convergeNP=n; fi 236 236 else 237 237 convergeNP=- … … 243 243 244 244 cd $LMDZdir/$BENCH 245 if [ -f compilegcm.sh -a $check_compile = 1 ] 245 if [ -f compilegcm.sh -a $check_compile = 1 ]; then 246 246 \rm -f gcm.e 247 247 ./compilegcm.sh -debug … … 252 252 cd ../ 253 253 suf=D 254 if [ -f SIMD/restartphy.nc ] 255 if [ $justcheck = 0 ] 254 if [ -f SIMD/restartphy.nc ]; then 255 if [ $justcheck = 0 ]; then 256 256 ncks -M -m -h -v ps -O SIMD/restart.nc $resubench/$BENCH/ps$suf.nc 257 257 cp SIMD/restart.nc $resubench/$BENCH/restart$suf.nc 258 258 fi 259 259 cmp -s SIMD/restart.nc $latest/$BENCH/restart$suf.nc 260 if [ $? = 0 ] ; then convergeD=D ; else convergeD=d; fi260 if [ $? = 0 ]; then convergeD=D; else convergeD=d; fi 261 261 else 262 262 convergeD=- … … 269 269 270 270 echo CHECK $parallel $check_parallel 271 if [ "$parallel" = "mpi_omp" -a $check_parallel = 1 ] 271 if [ "$parallel" = "mpi_omp" -a $check_parallel = 1 ]; then 272 272 mkdir -p $LMDZdir/$BENCH/SIM1_41 273 273 cd $LMDZdir/$BENCH/SIM1_41 … … 277 277 echo ON EST AVANT LE CMP 278 278 cmp -s SIMD/restart.nc SIM1_41/restart.nc 279 if [ $? = 0 ] 280 if [ "$unpun" = "OK" ] 279 if [ $? = 0 ]; then 280 if [ "$unpun" = "OK" ]; then 281 281 unpun=OK2 282 282 else … … 292 292 ######################################################################### 293 293 294 if [ $check_isotopes = 1 ] 294 if [ $check_isotopes = 1 ]; then 295 295 cd $LMDZdir 296 296 pwd … … 300 300 ./compile.sh 301 301 exec=../bin/gcm_48x36x39_phylmdiso_${rad}_seq_iso_isoverif.e 302 if [ -f $exec ] 302 if [ -f $exec ]; then 303 303 $exec > listing 2>&1 304 304 suf=I 305 if [ -f restartphy.nc ] 306 if [ $justcheck = 0 ] 305 if [ -f restartphy.nc ]; then 306 if [ $justcheck = 0 ]; then 307 307 cp restart.nc $resubench/$BENCH/restart$suf.nc 308 308 fi 309 309 cmp -s restart.nc $latest/$BENCH/restart$suf.nc 310 if [ $? = 0 ] ; then convergeI=I ; else convergeI=i; fi310 if [ $? = 0 ]; then convergeI=I; else convergeI=i; fi 311 311 else 312 312 # compiled but failed the isoverif test … … 325 325 ######################################################################### 326 326 327 if [ $check_ini = 1 ] 327 if [ $check_ini = 1 ]; then 328 328 cd $LMDZdir 329 329 rm -rf INIT … … 334 334 $get/Distrib/initialisation.sh 335 335 sed -e 's/grid_resolution=48x36x39/grid_resolution='$resolution'/' initialisation.sh > ini.sh 336 chmod +x ini.sh 337 if [ -f limit.nc ] 336 chmod +x ini.sh; ./ini.sh 337 if [ -f limit.nc ]; then 338 338 var=Tsoil01srf01 339 if [ $justcheck = 0 ] 339 if [ $justcheck = 0 ]; then 340 340 mkdir -p $resubench/START$resolution 341 341 ncks -M -m -h -v $var startphy.nc -O $resubench/START$resolution/$var.nc … … 343 343 fi 344 344 cmp -s startphy.nc $latest/START$resolution/startphy.nc 345 if [ $? = 0 ] 345 if [ $? = 0 ]; then 346 346 init=OK 347 347 else … … 362 362 fi 363 363 364 if [ $justcheck = 0 ] 364 if [ $justcheck = 0 ]; then 365 365 latest=$RESU_D/latest 366 366 \rm -f $latest … … 379 379 svnrel=`svn info $LMDZ | grep 'Changed Rev' | head -1 | awk ' { print $4 } '` 380 380 #FH 20160822 381 if [ "$svnrel" = "" ] 381 if [ "$svnrel" = "" ]; then 382 382 svnrel=`svn info $LMDZ | grep vision | head -1 | awk ' { print $2 } '` 383 383 fi 384 384 385 385 ccc=$converge$convergeNP$convergeD$converge1D$convergeI 386 if [ "$ccc" = "SNDUI" ] ; then ccc="OK "; fi386 if [ "$ccc" = "SNDUI" ]; then ccc="OK "; fi 387 387 388 388 … … 425 425 cat tmp.message 426 426 427 if [ $mail_address != "" ] && [ $justcheck = 0 ] 427 if [ $mail_address != "" ] && [ $justcheck = 0 ]; then 428 428 ssh lmdz@django "mail -s 'Nouvelle version pour install_lmdz.sh' $mail_address < "$local_d"/tmp.message" 429 429 # ssh lmdz@lmdz-forge "mail -s 'Nouvelle version pour install_lmdz.sh' $mail_address < "$local_d"/tmp.message" … … 435 435 grep -q 'OK OK OK2 OK' tmp.resu 436 436 RET=$? 437 if [ ${RET} -eq 0 ] 437 if [ ${RET} -eq 0 ]; then 438 438 echo "Quality control checks out for version $version" 439 439 echo "We cleanup $tmpdir/LMDZ$version" -
BOL/script_install_amaury/install_lmdz.sh
r5083 r5156 49 49 } 50 50 51 function get_svn_branch { 52 local url=$1 53 local rev=$2 54 local res 55 56 res=$(svn log -v -q "$url" -r "$rev" -l 1 | cut -d "/" -f -4) 57 if echo "$res" | grep -q "/trunk/"; then 58 res=$(echo "$res" | grep "/trunk/" | head -1 | cut -d "/" -f 2-3) 59 elif echo "$res" | grep -q "/branches/"; then 60 res=$(echo "$res" | grep "/branches/" | head -1 | cut -d "/" -f 2-4) 61 else 62 echo "Could not determine svn branch for $url, r=$rev" 63 fi 64 echo "$res" 65 } 66 51 67 function set_default_params { 52 68 # Valeur par défaut des parametres … … 61 77 benchphysiq="" 62 78 compphysiq="lmd" 79 is_1D="n" 80 fortran_file="gcm" 63 81 64 82 parallel="none" … … 249 267 if [[ $arch_dir = "" ]]; then 250 268 arch_dir="$MODEL/modipsl/config/IPSLCM7/ARCH/"; 251 elif ! readlink -fe "$arch_dir" ; then269 elif ! readlink -fe "$arch_dir" >/dev/null; then 252 270 echo "STOP: no arch dir <$arch_dir>"; exit 1 271 fi 272 273 if ! (echo "$grid_resolution" | grep -q "x"); then 274 is_1D="y" 275 fortran_file="lmdz1d" 253 276 fi 254 277 } … … 313 336 echo "problem installing with compiler $compiler"; exit 1 314 337 fi 315 \rm tt a.out tt.f90338 rm tt a.out tt.f90 316 339 } 317 340 … … 320 343 321 344 mkdir -p "$MODEL" 322 MODEL=$(readlink -e -f "$MODEL"); echo " $MODEL" # absolute path345 MODEL=$(readlink -e -f "$MODEL"); echo "MODEL: $MODEL" # absolute path 323 346 if [[ ! -d "$MODEL/modipsl" ]]; then 324 347 echo "##########################################################" 325 echo "Download a slightly modified version ofLMDZ"348 echo "Downloading a slightly modified version of modipsl+LMDZ" 326 349 echo "##########################################################" 327 350 cd "$MODEL" … … 332 355 gunzip "modipsl.$version.tar.gz" &>> get.log 333 356 tar xf "modipsl.$version.tar" &>> get.log 334 \rm "modipsl.$version.tar"357 rm "modipsl.$version.tar" 335 358 cd - &> /dev/null 336 359 fi … … 463 486 464 487 if $ncdf_compiler -I"$ncdfdir"/include test_netcdf90.f90 -L"$ncdfdir"/lib -lnetcdff -lnetcdf -Wl,-rpath="$ncdfdir"/lib && ./a.out; then 465 \rm test_netcdf90.f90 a.out488 rm test_netcdf90.f90 a.out 466 489 else 467 490 cat <<EOF … … 615 638 local lmdzbranch 616 639 echo "Fetching LMDZ $svn_lmdz from the repository" 617 lmdzbranch=$(svn log -v -q https://svn.lmd.jussieu.fr/LMDZ -r "$svn_lmdz" | grep LMDZ | head -1 | sed -e 's:trunk/.*$:trunk:' | awk '{print $2}') 640 lmdzbranch=$(get_svn_branch "https://svn.lmd.jussieu.fr/LMDZ" "$svn_lmdz") 641 echo "branch is $lmdzbranch" 618 642 cd "$MODEL/modipsl/modeles" 619 643 rm -rf LMD* 620 svn co -r "$svn_lmdz" "https://svn.lmd.jussieu.fr/LMDZ $lmdzbranch" LMDZ644 svn co -r "$svn_lmdz" "https://svn.lmd.jussieu.fr/LMDZ/$lmdzbranch" LMDZ 621 645 cd - > /dev/null 622 646 fi … … 636 660 637 661 if [[ $used_lmdz_rev -le 4185 ]]; then 638 exe_name="bin/ gcm_${grid_resolution}_phy${compphysiq}_${suff_para}${suff_orc}${suff_aer}${suff_iso}.e"662 exe_name="bin/${fortran_file}_${grid_resolution}_phy${compphysiq}_${suff_para}${suff_orc}${suff_aer}${suff_iso}.e" 639 663 else 640 exe_name="bin/ gcm_${grid_resolution}_phy${compphysiq}_${rad}${suff_para}${suff_orc}${suff_aer}${suff_iso}.e"664 exe_name="bin/${fortran_file}_${grid_resolution}_phy${compphysiq}_${rad}${suff_para}${suff_orc}${suff_aer}${suff_iso}.e" 641 665 fi 642 666 … … 660 684 makelmdz="makelmdz_fcm $optim_flag -arch $arch -j $make_j" 661 685 local para_compile_opt="-mem -parallel $parallel"; if [[ $parallel = "none" ]]; then para_compile_opt=""; fi 662 echo "$jobcmd ./$makelmdz $opt_rad $opt_cosp $opt_makelmdz_xios $opt_aer $opt_inlandsis $opt_isotopes -p $compphysiq -d ${grid_resolution} -v $fcm_veget_version $para_compile_opt gcm" > compile.sh686 echo "$jobcmd ./$makelmdz $opt_rad $opt_cosp $opt_makelmdz_xios $opt_aer $opt_inlandsis $opt_isotopes -p $compphysiq -d ${grid_resolution} -v $fcm_veget_version $para_compile_opt $fortran_file" > compile.sh 663 687 echo "Compiling lmdz using $(\cat compile.sh) (log: $lmdzlog) $(date)" 664 688 chmod +x ./compile.sh … … 677 701 678 702 function run_bench { 703 local bench_cmd="./bench.sh" 704 679 705 cd "$MODEL/modipsl/modeles/LMDZ"* 680 706 … … 683 709 ./init.sh 684 710 elif [[ $bench = 1 ]]; then 685 \rm -rf "BENCH${grid_resolution}" 686 local bench=bench_lmdz_${grid_resolution} 711 rm -rf "BENCH${grid_resolution}" 712 local bench=bench_lmdz_${grid_resolution} 713 if [[ $compphysiq = "lmdiso" ]]; then bench=bench_lmdz_iso_${grid_resolution}; fi 714 715 if [[ $is_1D = "y" ]] ; then # 1D 716 myget "1D/1D.tar.gz" 717 mkdir -p "BENCH${grid_resolution}" 718 tar xf "1D.tar.gz" -C "BENCH${grid_resolution}" --strip-components=1 719 cd "BENCH${grid_resolution}" 720 # Below: ugly, but until we rewrite the 1D case... 721 sed -i'' -e "s:^listecas=.*$:listecas=ARMCU/REF:" -e "s:cd \$local/bin ; ./compile -L \$L:#cd \$local/bin ; ./compile -L \$L:" \ 722 -e "s:./compile -L \$llm:#./compile -L \$llm:" -e "s:ln -sf \$bin/\\\\\${main}\${suffixe}.e .:ln -sf ../../../../../$exe_name \\\\\${main}\${suffixe}.e:" -e "s:gzip listing:cp listing restartphy.nc ../../../../; exit 0:" \ 723 run.sh 724 cp "../$exe_name" bin/ 725 bench_cmd="./run.sh -rad $rad" # suppress ferret commands that launch after bench is "over" 726 else 687 727 myget "3DBenchs/$bench.tar.gz" 688 tar xf "$bench.tar.gz" 728 mkdir "BENCH${grid_resolution}" 729 tar xf "$bench.tar.gz" -C "BENCH${grid_resolution}" --strip-components=1 689 730 690 731 if [[ $cosp = "v1" || $cosp = "v2" ]]; then … … 786 827 cd "BENCH${grid_resolution}" 787 828 788 local bench_cmd="./bench.sh"789 829 if [[ ${parallel:0:3} = "mpi" ]]; then 790 830 # Lancement avec deux procs mpi et 2 openMP … … 822 862 echo "./gcm.e &> listing" > bench.sh 823 863 fi 864 chmod +x bench.sh 824 865 # Getting orchidee stuff 825 866 if [[ $veget = 'CMIP6' || $veget = "orch2.0" ]]; then # TODO once we have a 2.2 bench, add it here (or in planned separate bench script) … … 862 903 fi 863 904 905 fi 906 864 907 if [[ -f ../arch.env ]]; then source ../arch.env; fi 865 908 866 echo " EXECUTION DUBENCH"909 echo "STARTING BENCH" 867 910 date 868 911 if (! $bench_cmd &> out.bench) || ! (tail -n 1 listing | grep "Everything is cool"); then
Note: See TracChangeset
for help on using the changeset viewer.