[5156] | 1 | #!/bin/bash |
---|
| 2 | |
---|
| 3 | set -eu |
---|
| 4 | |
---|
| 5 | dim="32x32x39" |
---|
| 6 | base_args="-name LMDZ -netcdf 0 -arch_dir /home/abarral/PycharmProjects/installLMDZ/script_install/arch_local -arch local-gfortran-parallel_ -d $dim" # those don't appear in the folder name (except dim) |
---|
| 7 | file_to_check="LMDZ/modipsl/modeles/LMDZ/BENCH$dim/restart.nc" |
---|
| 8 | base_path="/tmp/comp_bench/" |
---|
| 9 | local=$(pwd) |
---|
| 10 | |
---|
| 11 | function do_bench() { |
---|
| 12 | local rev=$1 |
---|
| 13 | local path=$2 |
---|
| 14 | local install_args=$3 |
---|
| 15 | if [[ -f "$path/$file_to_check" ]]; then return; fi |
---|
| 16 | |
---|
| 17 | rm -rf "$path" |
---|
| 18 | mkdir -p "$path" && cd "$path" |
---|
| 19 | |
---|
| 20 | cp "$local/install_lmdz.sh" . |
---|
| 21 | |
---|
| 22 | local logf="comp.log" |
---|
| 23 | local install_cmd="./install_lmdz.sh $base_args $install_args -r $rev" |
---|
| 24 | echo "Running <$install_cmd> [log: $(pwd)/$logf]" |
---|
| 25 | $install_cmd &> $logf |
---|
| 26 | } |
---|
| 27 | |
---|
| 28 | function comp_bench() { |
---|
| 29 | local rev1=$1 |
---|
| 30 | local rev2=$2 |
---|
| 31 | local install_args=$3 |
---|
| 32 | local path1="$base_path/r${rev1}_d${dim}_${install_args// /_}" |
---|
| 33 | local path2="$base_path/r${rev2}_d${dim}_${install_args// /_}" |
---|
| 34 | |
---|
| 35 | do_bench "$rev1" "$path1" "$install_args" |
---|
| 36 | do_bench "$rev2" "$path2" "$install_args" |
---|
| 37 | |
---|
| 38 | if cmp "$path1/$file_to_check" "$path2/$file_to_check" &>/dev/null; then |
---|
| 39 | echo "All good ! for r$rev1/r$rev2=$install_args" |
---|
| 40 | else |
---|
| 41 | echo ":( nope for r$rev1/r$rev2=$install_args" |
---|
| 42 | fi |
---|
| 43 | } |
---|
| 44 | |
---|
| 45 | function comp_full() { |
---|
| 46 | local rev1=$1 |
---|
| 47 | local rev2=$2 |
---|
| 48 | |
---|
| 49 | # Check all combinations |
---|
| 50 | for rad in "oldrad" "rrtm" "ecrad"; do |
---|
| 51 | for veget in "none" "CMIP6"; do |
---|
| 52 | for para in "none" "mpi_omp"; do |
---|
| 53 | comp_bench "$rev1" "$rev2" "-rad $rad -parallel $para -veget $veget -compilephysiq lmd" |
---|
| 54 | done; done; done |
---|
| 55 | |
---|
| 56 | # Check some additional params on sparse configs |
---|
[5180] | 57 | # comp_bench "$rev1" "$rev2" "-xios -rad oldrad -parallel $para -veget none -compilephysiq lmd" # xios broken for 5017 |
---|
[5156] | 58 | for para in "none" "mpi_omp"; do |
---|
| 59 | comp_bench "$rev1" "$rev2" "-cosp v1 -rad oldrad -parallel $para -veget none -compilephysiq lmd" # cosp v1 (no v2 because broken atm) |
---|
| 60 | comp_bench "$rev1" "$rev2" "-debug -rad oldrad -parallel $para -veget none -compilephysiq lmd" # debug |
---|
| 61 | done |
---|
| 62 | |
---|
[5180] | 63 | local origdim="$dim" |
---|
[5156] | 64 | # 1D |
---|
| 65 | dim="79" |
---|
| 66 | file_to_check="LMDZ/modipsl/modeles/LMDZ/BENCH$dim/restartphy.nc" |
---|
| 67 | comp_bench "$rev1" "$rev2" "-rad oldrad -parallel none -veget none -compilephysiq lmd -d $dim" |
---|
| 68 | |
---|
| 69 | # Iso |
---|
| 70 | dim="48x36x39" |
---|
| 71 | file_to_check="LMDZ/modipsl/modeles/LMDZ/BENCH$dim/restart.nc" |
---|
[5180] | 72 | comp_bench "$rev1" "$rev2" "-rad oldrad -parallel none -veget none -compilephysiq lmdiso -d $dim" |
---|
| 73 | |
---|
| 74 | dim="$origdim" |
---|
| 75 | file_to_check="LMDZ/modipsl/modeles/LMDZ/BENCH$dim/restart.nc" |
---|
[5156] | 76 | } |
---|
| 77 | |
---|
[5180] | 78 | comp_full 5159 5017 |
---|
| 79 | comp_bench 5159 5150 "-xios -rad oldrad -parallel mpi_omp -veget none -compilephysiq lmd" # xios broken for 5017 |
---|
[5156] | 80 | |
---|
| 81 | |
---|
| 82 | |
---|
| 83 | |
---|
| 84 | |
---|