source: XIOS/dev/dev_ym/XIOS_COUPLING/xios_test_suite/TEST_SUITE/run_test @ 2210

Last change on this file since 2210 was 2210, checked in by jderouillat, 3 years ago

Setting XIOS_COULING test suite for Jean-Zay (validated in OpenMPI)

  • Property svn:executable set to *
File size: 3.6 KB
RevLine 
[1806]1#!/bin/bash
2
[1824]3export build_dir=xios_test_suite/RUN_TEST_SUITE/build_${arch}_${mode}
[1899]4export svnR=$(svn info --show-item revision ../../)
[1806]5
[1899]6echo "Start Building XIOS ... "
[1806]7
[1945]8if [[ ${xios_machine_name} == "jeanzay" ]]; then
9
10  rm -f compile.sh
11  echo "#!/bin/bash" >> compile.sh
[1947]12  echo "#SBATCH --ntasks=1 ">> compile.sh
13  echo "#SBATCH --cpus-per-task=16 ">> compile.sh
[1945]14  echo "#SBATCH --hint=nomultithread ">> compile.sh
15  echo "#SBATCH -t 00:30:00  " >> compile.sh
16  echo "#SBATCH -o compile.out ">> compile.sh
17  echo "#SBATCH -e compile.err ">> compile.sh
18  echo "#SBATCH --account="$user_account  >> compile.sh
[1948]19  echo "#SBATCH --job-name=XIOS_rev"$svnR >> compile.sh
[2210]20  echo "#SBATCH --exclusive " >> compile.sh
[1945]21  echo "cd \${SLURM_SUBMIT_DIR}">> compile.sh
22  echo "ulimit -c 0">> compile.sh
23  echo "cd ../.. ">> compile.sh
[2036]24  echo "./make_xios --arch_path `pwd`/../ARCH --arch ${arch} --${mode} --use_tv --build_dir ${build_dir} --job 16" >> compile.sh
[1947]25  cmd=$(sbatch compile.sh)
26  jobid="${cmd//[!0-9]/}"
[2210]27  output=$(squeue -u uim55ri | grep ${jobid})
[1947]28  while [ ! -z "$output" ]
29  do
30    echo "compiling job " $jobid "pending/running for about" ${i} seconds
31    sleep 30
32    ((i+=30))
[2210]33    output=$(squeue -u uim55ri | grep ${jobid})
[1947]34  done
35
[1945]36fi
37
38if [[ ${xios_machine_name} == "irene" ]]; then
39
40  rm -f compile.sh
41  echo "#!/bin/bash" >> compile.sh
42  echo "#MSUB -o compile.out" >> compile.sh
43  echo "#MSUB -e compile.err" >> compile.sh
44  echo "#MSUB -eo" >> compile.sh
[1947]45  echo "#MSUB -c 16" >> compile.sh
[1945]46  echo "#MSUB -n 1" >> compile.sh
47  echo "#MSUB -X" >> compile.sh
48  echo "#MSUB -x" >> compile.sh
49  echo "#MSUB -T 1800" >> compile.sh
50  echo "#MSUB -q skylake" >> compile.sh
51  echo "#MSUB -A "$user_account >> compile.sh
52  echo "#MSUB -Q test" >> compile.sh
[1948]53  echo "#MSUB -r XIOS_rev"$svnR >> compile.sh
[1945]54  echo "#MSUB -m work,scratch" >> compile.sh
55  echo "cd ../.. ">> compile.sh
[2036]56  echo "./make_xios --arch_path `pwd`/../ARCH --arch ${arch} --${mode} --use_tv --build_dir ${build_dir} --job 16" >> compile.sh
[1947]57  cmd=$(ccc_msub compile.sh)
[1948]58  jobid="${cmd//[!0-9]/}"
[1947]59  output=$(ccc_mpp | grep ${jobid})
60  while [ ! -z "$output" ]
61  do
62    echo "compiling job " $jobid "pending/running for about" ${i} seconds
63    sleep 30
64    ((i+=30))
65    output=$(ccc_mpp | grep ${jobid})
66  done
67
[1945]68fi
69
[1947]70build_info=$(sacct -j $jobid -o State)
71if [[ $build_info == *"COMPLETED"* ]]; then
[1945]72  build_ok=true
73else
74  build_ok=false
75fi
76
77
78if [ "$build_ok" = true ]
[1827]79then
80  echo "XIOS Build Finished. Start Unit Tests"
[1901]81  bash ./my_run.sh
[1913]82 
83  if [ "$COPY_TO_SERVER" = true ]
84  then
85    echo "with files copy"
86    rundir=${xios_test_suite_repository}/RUN
87    mkdir -p $rundir ; CHMOD  $rundir
88    mkdir -p ${rundir}/test_${xios_machine_name} ; CHMOD ${rundir}/test_${xios_machine_name}
[1806]89
[1913]90    cp report_${svnR}_${arch}_${mode}.txt ${rundir}/test_${xios_machine_name}/test_${svnR}_${xios_machine_name}_${arch}_${mode}.txt
[1806]91
[1913]92    CHMOD ${rundir}/test_${xios_machine_name}/test_${svnR}_${xios_machine_name}_${arch}_${mode}.txt
[1806]93
[1913]94    mkdir -p ${rundir}/def_files ;  CHMOD ${rundir}/def_files
95    mkdir -p ${rundir}/def_files/${svnR} ;  CHMOD ${rundir}/def_files/${svnR}
[1886]96
[1913]97    for i in $(ls -d test_*/)
[1886]98    do
[1913]99      mkdir -p ${rundir}/def_files/${svnR}/${i%%} ; CHMOD ${rundir}/def_files/${svnR}/${i%%}
100      cp ${i%%}/user_param.json ${rundir}/def_files/${svnR}/${i%%}
101      for j in $(ls -d ${i%%/}/CONFIG_*)
102      do
103        mkdir -p ${rundir}/def_files/${svnR}/${j%%} ; CHMOD ${rundir}/def_files/${svnR}/${j%%}
104        cp ${j%%}/all_param.def ${rundir}/def_files/${svnR}/${j%%}
105      done
[1886]106    done
[1913]107  else
108    echo "without files copy"
109  fi
[1806]110
[1899]111else
112  echo "XIOS Build Failed. Skip Unit Tests"
[1824]113fi
114
[1899]115
116
Note: See TracBrowser for help on using the repository browser.