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

Last change on this file since 2292 was 2292, checked in by jderouillat, 2 years ago

Fix in the test suite to launch generic_testcase only if compile succeed. + Minor fix for ccc_mpp

  • Property svn:executable set to *
File size: 3.8 KB
Line 
1#!/bin/bash
2
3export build_dir=xios_test_suite/RUN_TEST_SUITE/build_${arch}_${mode}
4export svnR=$(svn info --show-item revision ../../)
5if [[ -v enable_mem_track ]]; then
6  echo "enable_mem_track is set to '$enable_mem_track'"
7fi
8
9echo "Start Building XIOS ... "
10
11if [[ ${xios_machine_name} == "jeanzay" ]]; then
12
13  rm -f compile.sh
14  echo "#!/bin/bash" >> compile.sh
15  echo "#SBATCH --ntasks=1 ">> compile.sh
16  echo "#SBATCH --cpus-per-task=16 ">> compile.sh
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
22  echo "#SBATCH --job-name=XIOS_rev"$svnR >> compile.sh
23  echo "#SBATCH --exclusive " >> compile.sh
24  echo "cd \${SLURM_SUBMIT_DIR}">> compile.sh
25  echo "ulimit -c 0">> compile.sh
26  echo "cd ../.. ">> compile.sh
27  echo "./make_xios --arch_path `pwd`/../ARCH --arch ${arch} --${mode} --use_tv --build_dir ${build_dir} --job 16" >> compile.sh
28  cmd=$(sbatch compile.sh)
29  sleep 10
30  jobid="${cmd//[!0-9]/}"
31  i=0
32  output=$(squeue -u uim55ri | grep ${jobid})
33  while [ ! -z "$output" ]
34  do
35    echo "compiling job " $jobid "pending/running for about" ${i} seconds
36    sleep 30
37    ((i+=30))
38    output=$(squeue -u uim55ri | grep ${jobid})
39  done
40
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
50  echo "#MSUB -c 16" >> compile.sh
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
58  echo "#MSUB -r XIOS_rev"$svnR >> compile.sh
59  echo "#MSUB -m work,scratch" >> compile.sh
60  echo "cd ../.. ">> compile.sh
61  echo "./make_xios --arch_path `pwd`/../ARCH --arch ${arch} --${mode} --use_tv ${enable_mem_track} --build_dir ${build_dir} --job 16" >> compile.sh
62  cmd=$(ccc_msub compile.sh)
63  sleep 10
64  jobid="${cmd//[!0-9]/}"
65  i=0
66  output=$(ccc_mpp -n -u ${USER} | grep ${jobid})
67  while [ ! -z "$output" ]
68  do
69    echo "compiling job " $jobid "pending/running for about" ${i} seconds
70    sleep 30
71    ((i+=30))
72    output=$(ccc_mpp -n -u ${USER} | grep ${jobid})
73  done
74
75fi
76
77#build_info=$(sacct -j $jobid -o State)
78#if [[ $build_info == *"COMPLETED"* ]]; then
79exec=${build_dir}/bin/generic_testcase.exe
80if [[ -f "$exec" ]]; then
81  build_ok=true
82else
83  build_ok=false
84fi
85
86
87if [ "$build_ok" = true ]
88then
89  echo "XIOS Build Finished. Start Unit Tests"
90  bash ./my_run.sh
91 
92  if [ "$COPY_TO_SERVER" = true ]
93  then
94    echo "with files copy"
95    rundir=${xios_test_suite_repository}/RUN
96    mkdir -p $rundir ; CHMOD  $rundir
97    mkdir -p ${rundir}/test_${xios_machine_name} ; CHMOD ${rundir}/test_${xios_machine_name}
98
99    cp report_${svnR}_${arch}_${mode}.txt ${rundir}/test_${xios_machine_name}/test_${svnR}_${xios_machine_name}_${arch}_${mode}.txt
100
101    CHMOD ${rundir}/test_${xios_machine_name}/test_${svnR}_${xios_machine_name}_${arch}_${mode}.txt
102
103    mkdir -p ${rundir}/def_files ;  CHMOD ${rundir}/def_files
104    mkdir -p ${rundir}/def_files/${svnR} ;  CHMOD ${rundir}/def_files/${svnR}
105
106    for i in $(ls -d test_*/)
107    do
108      mkdir -p ${rundir}/def_files/${svnR}/${i%%} ; CHMOD ${rundir}/def_files/${svnR}/${i%%}
109      cp ${i%%}/user_param_*.json ${rundir}/def_files/${svnR}/${i%%}
110      for j in $(ls -d ${i%%/}/CONFIG_*)
111      do
112        mkdir -p ${rundir}/def_files/${svnR}/${j%%} ; CHMOD ${rundir}/def_files/${svnR}/${j%%}
113        cp ${j%%}/all_param.def ${rundir}/def_files/${svnR}/${j%%}
114      done
115    done
116  else
117    echo "without files copy"
118  fi
119
120else
121  echo "XIOS Build Failed. Skip Unit Tests"
122fi
123
124
125
Note: See TracBrowser for help on using the repository browser.