Changeset 4997
- Timestamp:
- Jun 27, 2024, 11:43:01 AM (6 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BOL/script_install_amaury/install_lmdz.sh
r4994 r4997 95 95 arch="local-gfortran" 96 96 arch_dir="" 97 98 jobcmd="" 97 99 } 98 100 … … 148 150 149 151 -make_j number of processes to parallelize installations (default <$make_j>) 152 153 -jobcmd command prepended to fcm compile jobs, e.g. "srun" (default <$jobcmd>) 150 154 151 155 -noclean will only download necessary files (but no thorough check is made on the integrity of existing files), and will recompile everything (very quick if it's already been compiled before) … … 187 191 "-inlandsis") inlandsis=1; shift;; 188 192 "-make_j") make_j=$2; shift; shift;; 193 "-jobcmd") jobcmd=$2; shift; shift;; 189 194 "-noclean") clean_install=0; shift;; 190 195 *) bash install_lmdz.sh -h; exit 1 … … 319 324 getlog="$(pwd)/get.log" 320 325 echo "logfile : $getlog" 321 myget "src_archives/$trusting/modipsl.$version.tar.gz" >> get.log 2>&1326 myget "src_archives/$trusting/modipsl.$version.tar.gz" &>> get.log 322 327 echo "install_lmdz.sh wget_OK $(date)" 323 gunzip "modipsl.$version.tar.gz" >> get.log 2>&1324 tar xf "modipsl.$version.tar" >> get.log 2>&1328 gunzip "modipsl.$version.tar.gz" &>> get.log 329 tar xf "modipsl.$version.tar" &>> get.log 325 330 \rm "modipsl.$version.tar" 326 331 fi … … 447 452 echo "----------------------------------------------------------" 448 453 echo "log file : $netcdflog" 449 myget script_install/$script_install_netcdf >> "$netcdflog" 2>&1454 myget script_install/$script_install_netcdf &>> "$netcdflog" 450 455 chmod u=rwx $script_install_netcdf 451 456 # shellcheck disable=SC2086 452 ./$script_install_netcdf -prefix "$ncdfdir" $opt_ >> "$netcdflog" 2>&1457 ./$script_install_netcdf -prefix "$ncdfdir" $opt_ &>> "$netcdflog" 453 458 fi 454 459 … … 506 511 echo "Compiling IOIPSL, the interface library with Netcdf $(date) (log: $ioipsllog)" 507 512 508 if ! ./makeioipsl_fcm -arch "$arch" -job 8 > "$ioipsllog" 2>&1; then 509 echo "IOIPSL compile failed, exiting"; exit 1 513 echo "$jobcmd ./makeioipsl_fcm -j $make_j -arch $arch" > compile.sh 514 chmod +x compile.sh 515 echo "Compiling IOIPSL using $(\cat compile.sh)" 516 if ! ./compile.sh &> "$ioipsllog"; then 517 echo "STOP: IOIPSL compile failed, exiting"; exit 1 510 518 fi 511 519 … … 536 544 537 545 echo "Starting XIOS compilation" 538 if ! ./make_xios --arch "$arch" --job 8 > "$xioslog" 2>&1; then539 echo " XIOS compilation failed, exiting"; exit 1546 if ! ./make_xios --arch "$arch" --job 8 &> "$xioslog"; then 547 echo "STOP: XIOS compilation failed, exiting"; exit 1 540 548 fi 541 549 … … 550 558 "none") fcm_veget_version="false";; 551 559 "orch2.0" | "CMIP6") fcm_veget_version=orchidee2.0; fetch_rev=7906;; # in previous tar we used 6592 but with some modifications to xios_orchidee.f90, which got integrated in 7906 552 "orch2.2") fcm_veget_version=orchidee2.1; orcbranch=" ORCHIDEE_2_2" ;; # the bundled version560 "orch2.2") fcm_veget_version=orchidee2.1; orcbranch="/branches/ORCHIDEE_2_2/ORCHIDEE" ;; # the bundled version 553 561 *) fetch_rev=$veget; fcm_veget_version=orchidee2.1;; # /!\ arbitary rev only works for orch>=2.1 554 562 esac … … 597 605 fi 598 606 599 if [[ $parallel = "none" ]]; then 600 echo "./makeorchidee_fcm $xios_orchid $opt_orc -parallel none -arch $arch -j $make_j" > compile.sh 601 else 602 if [[ ! -d src_parallel ]]; then 603 echo "Orchidee version too old for parallel support"; exit 1 604 fi 605 { 606 echo "./makeorchidee_fcm -j $make_j $xios_orchid $opt_orc -parallel $parallel -arch $arch" 607 } > compile.sh 608 fi 607 if [[ $parallel != "none" && ! -d src_parallel ]]; then 608 echo "STOP: Orchidee version too old for parallel support"; exit 1 609 fi 610 echo "$jobcmd ./makeorchidee_fcm -j $make_j $xios_orchid $opt_orc -parallel $parallel -arch $arch" > compile.sh 609 611 chmod +x compile.sh 610 612 echo "Compiling ORCHIDEE using $(\cat compile.sh)" 611 if ! ./compile.sh > "$orchideelog" 2>&1; then612 echo " ORCHIDEE compilation failed, exiting"; exit 1613 if ! ./compile.sh &> "$orchideelog"; then 614 echo "STOP: ORCHIDEE compilation failed, exiting"; exit 1 613 615 fi 614 616 echo "Compiled ORCHIDEE $(date)" … … 622 624 623 625 if [[ -n $svn_lmdz ]]; then 624 local curr_rev 625 curr_rev=$(svn info "$MODEL/modipsl/modeles/LMD"* | grep Revision: | cut -d ":" -f 2) 626 if [[ $svn_lmdz != "$curr_rev" ]]; then 627 local lmdzbranch 628 echo "Fetching LMDZ $svn_lmdz from the repository" 629 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}') 630 cd "$MODEL/modipsl/modeles" 631 rm -rf LMD* 632 svn co -r "$svn_lmdz" "https://svn.lmd.jussieu.fr/LMDZ$lmdzbranch" LMDZ 633 cd - > /dev/null 634 fi 626 local curr_rev 627 curr_rev=$(svn info "$MODEL/modipsl/modeles/LMD"* | grep Revision: | cut -d ":" -f 2) 628 if [[ $svn_lmdz != "$curr_rev" ]]; then 629 local lmdzbranch 630 echo "Fetching LMDZ $svn_lmdz from the repository" 631 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}') 632 cd "$MODEL/modipsl/modeles" 633 rm -rf LMD* 634 svn co -r "$svn_lmdz" "https://svn.lmd.jussieu.fr/LMDZ$lmdzbranch" LMDZ 635 cd - > /dev/null 636 fi 637 used_lmdz_rev=$svn_lmdz 635 638 else # get svn from info 636 637 639 set +e; used_lmdz_rev=$(svn info | grep "Last Changed Rev" | cut -c 19-); set -e 640 if [[ -z $used_lmdz_rev ]]; then # svn info failed 638 641 used_lmdz_rev=$(grep 'Revision: [0-9]' "$MODEL"/Read*.md | awk ' { print $2 } ' 2>/dev/null) 639 642 if [[ -z $used_lmdz_rev ]]; then echo "Could not determine lmdz version. This is likely an issue with the .tar itself, please report to LMDZ team."; exit 1; fi 640 643 fi 641 644 fi 642 645 } … … 671 674 makelmdz="makelmdz_fcm $optim_debug -arch $arch -j $make_j" 672 675 local para_compile_opt="-mem -parallel $parallel"; if [[ $parallel = "none" ]]; then para_compile_opt=""; fi 673 echo " ./$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.sh676 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.sh 674 677 echo "Compiling lmdz using $(\cat compile.sh) (log: $lmdzlog) $(date)" 675 678 chmod +x ./compile.sh 676 if ! ./compile.sh > "$lmdzlog" 2>&1; then677 echo " LMDZ compilation failed, exiting"; exit 1679 if ! ./compile.sh &> "$lmdzlog"; then 680 echo "STOP: LMDZ compilation failed, exiting"; exit 1 678 681 fi 679 682 echo "Finished LMDZ compilation $(date)" … … 681 684 # Check executable 682 685 if [[ ! -f $exe_name ]]; then 683 echo " Compilation failed, can't find the executable"; exit 1686 echo "STOP: Compilation failed, can't find the executable"; exit 1 684 687 else 685 688 echo "Compilation successfull, the executable is $exe_name $(date)" … … 809 812 echo "ulimit -s unlimited" >> bench.sh 810 813 fi 811 if which mpirun > /dev/null 2>&1; then812 echo "mpirun -np 2 gcm.e > listing 2>&1" >> bench.sh814 if which mpirun &> /dev/null; then 815 echo "mpirun -np 2 gcm.e &> listing" >> bench.sh 813 816 elif grep -q "Adastra" /etc/motd; then 814 817 local account 815 818 account=$(/usr/sbin/my_project.py -l 2>&1 | head -1 | cut -d " " -f 3- | cut -c 5-) 816 819 bench_cmd="srun --nodes=1 --ntasks=1 --cpus-per-task=2 --threads-per-core=2 --time=0:10:00 --constraint=GENOA --account=$account bash bench.sh" 817 echo "./gcm.e > listing 2>&1" >> bench.sh820 echo "./gcm.e &> listing" >> bench.sh 818 821 else 819 822 echo "Error: No command found to run parallel bench"; exit 1 … … 831 834 EOF 832 835 else 833 echo "./gcm.e > listing 2>&1" > bench.sh836 echo "./gcm.e &> listing" > bench.sh 834 837 fi 835 838 # Getting orchidee stuff … … 877 880 echo "EXECUTION DU BENCH" 878 881 date 879 if (! $bench_cmd > out.bench 2>&1) || ! (tail -n 1 listing | grep "Everything is cool"); then882 if (! $bench_cmd &> out.bench) || ! (tail -n 1 listing | grep "Everything is cool"); then 880 883 tail listing 881 884 echo "Bench FAILED, exiting"; exit 1 … … 899 902 fi 900 903 echo "Running 1D/run.sh, log in $(pwd)/run1d.log" 901 ./run.sh > "$(pwd)/run1d.log" 2>&1904 ./run.sh &> "$(pwd)/run1d.log" 902 905 fi 903 906 }
Note: See TracChangeset
for help on using the changeset viewer.