source: XIOS3/trunk/xios_test_suite/TEST_SUITE/run_test @ 2393

Last change on this file since 2393 was 2393, checked in by jderouillat, 22 months ago

Set QoS to dev for the jeanzay test suite

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