[4624] | 1 | #!/bin/bash |
---|
| 2 | # |
---|
| 3 | # Lancement d'un install_lmdz.sh immédiatement apres un commit |
---|
| 4 | # pour tester la compilation et l'execution. Retour d'un code erreur adequat |
---|
| 5 | # au serveur svn pour notifier qui de droit |
---|
| 6 | |
---|
| 7 | set -vx |
---|
| 8 | |
---|
| 9 | REV="$1" |
---|
| 10 | |
---|
| 11 | TMP_OUT=/u/lmdz/WWW/Distrib/OUT |
---|
| 12 | TMP_D=/tmp/lmdz/test_rev_${REV}_$$ ; mkdir -p $TMP_D |
---|
| 13 | |
---|
| 14 | resolution=48x36x39 |
---|
| 15 | physiq=NPv6.0.14splith |
---|
| 16 | # Changed on 15/03/2023 r4473 |
---|
| 17 | physiq=NPv6.3 |
---|
| 18 | |
---|
| 19 | cd $TMP_D |
---|
| 20 | cp /u/lmdz/WWW/pub/install_lmdz.sh . |
---|
| 21 | #chmod 755 /u/lmdz/WWW/pub/install_lmdz.sh |
---|
| 22 | chmod +x install_lmdz.sh |
---|
| 23 | #./install_lmdz.sh -SCM -unstable -debug -d $resolution -r $REV -physiq $physiq > ${TMP_OUT}/post-commit-lmdz-cq-${REV}_$$ 2>&1 |
---|
| 24 | ./install_lmdz.sh -SCM -unstable -debug -d $resolution -r $REV -netcdf /u/lmdz/Netcdf/lmdz-cq_gcc_8.3.0/ -rad oldrad -parallel mpi_omp -physiq $physiq \ |
---|
| 25 | > ${TMP_OUT}/post-commit-lmdz-cq-${REV}_$$ 2>&1 |
---|
| 26 | # |
---|
| 27 | # menage: si ca a marche on efface le repertoire dans /tmp/lmdz |
---|
| 28 | # |
---|
| 29 | grep 'Everything is cool' ${TMP_OUT}/post-commit-lmdz-cq-${REV}_$$ |
---|
| 30 | RET=$? |
---|
| 31 | # checking 1D results |
---|
[4635] | 32 | cd LMDZ*${REV}*/1D/EXEC/6AL79/ |
---|
[4624] | 33 | listecas="ARMCU/REF RICO/SHORT SANDU/REF" |
---|
| 34 | ((ret1d=0)) |
---|
| 35 | for cas in $listecas ; do |
---|
| 36 | ((ret1d=$ret1d*10)) |
---|
| 37 | gunzip -dc "$cas"/listing.gz |grep -i cool |
---|
| 38 | retcas=$? |
---|
| 39 | ((ret1d=$ret1d+$retcas)) |
---|
| 40 | done |
---|
| 41 | # checking isotope compilation |
---|
| 42 | cd $TMP_D |
---|
[4635] | 43 | cd LMDZ*${REV}*/modipsl/modeles/LMDZ/ |
---|
[4624] | 44 | ./makelmdz_fcm -debug -arch local -j 8 -rad rrtm -d $resolution -v false -p lmdiso -isotopes true -isoverif true gcm > ./compile_iso.out 2>&1 |
---|
| 45 | ls bin/*iso* |
---|
| 46 | retiso=$? |
---|
| 47 | |
---|
| 48 | if [ ${RET} -eq 0 ] && [ ${ret1d} -eq 0 ] && [ ${retiso} -eq 0 ] ; then |
---|
| 49 | echo "Everything is cool for revision ${REV}" >> ${TMP_OUT}/post-commit-lmdz-cq-${REV}_$$ |
---|
| 50 | echo "Cleaning up /tmp/lmdz/test_rev_${REV}_$$" >> ${TMP_OUT}/post-commit-lmdz-cq-${REV}_$$ |
---|
| 51 | \rm -rf /tmp/lmdz/test_rev_${REV}_$$ |
---|
| 52 | fi |
---|
| 53 | # |
---|
| 54 | # sorties retour nécessaires pour envoyer le message a la liste |
---|
| 55 | # |
---|
| 56 | echo "Sortie dans" ${TMP_OUT}/post-commit-lmdz-cq-${REV}_$$ |
---|
| 57 | if [ ${RET} -eq 0 ] ; then |
---|
| 58 | echo "Bench 3D ok" |
---|
| 59 | fi |
---|
| 60 | if [ ${ret1d} -eq 0 ] ; then |
---|
| 61 | echo "Bench 1D ok" |
---|
| 62 | fi |
---|
| 63 | if [ ${retiso} -eq 0 ] ; then |
---|
| 64 | echo "Compilation iso ok" |
---|
| 65 | fi |
---|
| 66 | |
---|
| 67 | #grep 'Everything is cool' ${TMP_OUT}/post-commit-lmdz-cq-${REV}_$$ |
---|
| 68 | exit |
---|