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

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

Add tracking of the memory consumption in the test suite

  • Property svn:executable set to *
File size: 3.7 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  jobid="${cmd//[!0-9]/}"
30  output=$(squeue -u uim55ri | grep ${jobid})
31  while [ ! -z "$output" ]
32  do
33    echo "compiling job " $jobid "pending/running for about" ${i} seconds
34    sleep 30
35    ((i+=30))
36    output=$(squeue -u uim55ri | grep ${jobid})
37  done
38
39fi
40
41if [[ ${xios_machine_name} == "irene" ]]; then
42
43  rm -f compile.sh
44  echo "#!/bin/bash" >> compile.sh
45  echo "#MSUB -o compile.out" >> compile.sh
46  echo "#MSUB -e compile.err" >> compile.sh
47  echo "#MSUB -eo" >> compile.sh
48  echo "#MSUB -c 16" >> compile.sh
49  echo "#MSUB -n 1" >> compile.sh
50  echo "#MSUB -X" >> compile.sh
51  echo "#MSUB -x" >> compile.sh
52  echo "#MSUB -T 1800" >> compile.sh
53  echo "#MSUB -q skylake" >> compile.sh
54  echo "#MSUB -A "$user_account >> compile.sh
55  echo "#MSUB -Q test" >> compile.sh
56  echo "#MSUB -r XIOS_rev"$svnR >> compile.sh
57  echo "#MSUB -m work,scratch" >> compile.sh
58  echo "cd ../.. ">> compile.sh
59  echo "./make_xios --arch_path `pwd`/../ARCH --arch ${arch} --${mode} --use_tv ${enable_mem_track} --build_dir ${build_dir} --job 16" >> compile.sh
60  cmd=$(ccc_msub compile.sh)
61  jobid="${cmd//[!0-9]/}"
62  output=$(ccc_mpp | grep ${jobid})
63  while [ ! -z "$output" ]
64  do
65    echo "compiling job " $jobid "pending/running for about" ${i} seconds
66    sleep 30
67    ((i+=30))
68    output=$(ccc_mpp | grep ${jobid})
69  done
70
71fi
72
73build_info=$(sacct -j $jobid -o State)
74if [[ $build_info == *"COMPLETED"* ]]; then
75  build_ok=true
76else
77  build_ok=false
78fi
79
80
81if [ "$build_ok" = true ]
82then
83  echo "XIOS Build Finished. Start Unit Tests"
84  bash ./my_run.sh
85 
86  if [ "$COPY_TO_SERVER" = true ]
87  then
88    echo "with files copy"
89    rundir=${xios_test_suite_repository}/RUN
90    mkdir -p $rundir ; CHMOD  $rundir
91    mkdir -p ${rundir}/test_${xios_machine_name} ; CHMOD ${rundir}/test_${xios_machine_name}
92
93    cp report_${svnR}_${arch}_${mode}.txt ${rundir}/test_${xios_machine_name}/test_${svnR}_${xios_machine_name}_${arch}_${mode}.txt
94
95    CHMOD ${rundir}/test_${xios_machine_name}/test_${svnR}_${xios_machine_name}_${arch}_${mode}.txt
96
97    mkdir -p ${rundir}/def_files ;  CHMOD ${rundir}/def_files
98    mkdir -p ${rundir}/def_files/${svnR} ;  CHMOD ${rundir}/def_files/${svnR}
99
100    for i in $(ls -d test_*/)
101    do
102      mkdir -p ${rundir}/def_files/${svnR}/${i%%} ; CHMOD ${rundir}/def_files/${svnR}/${i%%}
103      cp ${i%%}/user_param_*.json ${rundir}/def_files/${svnR}/${i%%}
104      for j in $(ls -d ${i%%/}/CONFIG_*)
105      do
106        mkdir -p ${rundir}/def_files/${svnR}/${j%%} ; CHMOD ${rundir}/def_files/${svnR}/${j%%}
107        cp ${j%%}/all_param.def ${rundir}/def_files/${svnR}/${j%%}
108      done
109    done
110  else
111    echo "without files copy"
112  fi
113
114else
115  echo "XIOS Build Failed. Skip Unit Tests"
116fi
117
118
119
Note: See TracBrowser for help on using the repository browser.