source: XIOS/trunk/xios_test_suite/TEST_SUITE/run_test @ 1945

Last change on this file since 1945 was 1945, checked in by yushan, 4 years ago

trunk : modif related to compilation before unit tests. No longer compile on login node.

  • Property svn:executable set to *
File size: 2.9 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 ../../)
5
6echo "Start Building XIOS ... "
7
8if [[ ${xios_machine_name} == "jeanzay" ]]; then
9
10  rm -f compile.sh
11  echo "#!/bin/bash" >> compile.sh
12  echo "#SBATCH --ntasks=4 ">> compile.sh
13  echo "#SBATCH --hint=nomultithread ">> compile.sh
14  echo "#SBATCH -t 00:30:00  " >> compile.sh
15  echo "#SBATCH -o compile.out ">> compile.sh
16  echo "#SBATCH -e compile.err ">> compile.sh
17  echo "#SBATCH --account="$user_account  >> compile.sh
18  echo "cd \${SLURM_SUBMIT_DIR}">> compile.sh
19  echo "ulimit -c 0">> compile.sh
20  echo "cd ../.. ">> compile.sh
21  echo "./make_xios --arch_path `pwd`/../ARCH --arch ${arch} --${mode} --build_dir ${build_dir} --job 4" >> compile.sh
22  sbatch --wait compile.sh
23fi
24
25if [[ ${xios_machine_name} == "irene" ]]; then
26
27  rm -f compile.sh
28  echo "#!/bin/bash" >> compile.sh
29  echo "#MSUB -o compile.out" >> compile.sh
30  echo "#MSUB -e compile.err" >> compile.sh
31  echo "#MSUB -eo" >> compile.sh
32  echo "#MSUB -c 4" >> compile.sh
33  echo "#MSUB -n 1" >> compile.sh
34  echo "#MSUB -X" >> compile.sh
35  echo "#MSUB -x" >> compile.sh
36  echo "#MSUB -T 1800" >> compile.sh
37  echo "#MSUB -q skylake" >> compile.sh
38  echo "#MSUB -A "$user_account >> compile.sh
39  echo "#MSUB -Q test" >> compile.sh
40  echo "#MSUB -m work,scratch" >> compile.sh
41  echo "cd ../.. ">> compile.sh
42  echo "./make_xios --arch_path `pwd`/../ARCH --arch ${arch} --${mode} --build_dir ${build_dir} --job 4" >> compile.sh
43  ccc_msub -E "--wait" compile.sh
44fi
45
46export build_info=$(tail -n 1 compile.out)
47if [[ $build_info == *"Build command finished"* ]]; then
48  build_ok=true
49else
50  build_ok=false
51fi
52
53
54if [ "$build_ok" = true ]
55then
56  echo "XIOS Build Finished. Start Unit Tests"
57  bash ./my_run.sh
58 
59  if [ "$COPY_TO_SERVER" = true ]
60  then
61    echo "with files copy"
62    rundir=${xios_test_suite_repository}/RUN
63    mkdir -p $rundir ; CHMOD  $rundir
64    mkdir -p ${rundir}/test_${xios_machine_name} ; CHMOD ${rundir}/test_${xios_machine_name}
65
66    cp report_${svnR}_${arch}_${mode}.txt ${rundir}/test_${xios_machine_name}/test_${svnR}_${xios_machine_name}_${arch}_${mode}.txt
67
68    CHMOD ${rundir}/test_${xios_machine_name}/test_${svnR}_${xios_machine_name}_${arch}_${mode}.txt
69
70    mkdir -p ${rundir}/def_files ;  CHMOD ${rundir}/def_files
71    mkdir -p ${rundir}/def_files/${svnR} ;  CHMOD ${rundir}/def_files/${svnR}
72
73    for i in $(ls -d test_*/)
74    do
75      mkdir -p ${rundir}/def_files/${svnR}/${i%%} ; CHMOD ${rundir}/def_files/${svnR}/${i%%}
76      cp ${i%%}/user_param.json ${rundir}/def_files/${svnR}/${i%%}
77      for j in $(ls -d ${i%%/}/CONFIG_*)
78      do
79        mkdir -p ${rundir}/def_files/${svnR}/${j%%} ; CHMOD ${rundir}/def_files/${svnR}/${j%%}
80        cp ${j%%}/all_param.def ${rundir}/def_files/${svnR}/${j%%}
81      done
82    done
83  else
84    echo "without files copy"
85  fi
86
87else
88  echo "XIOS Build Failed. Skip Unit Tests"
89fi
90
91
92
Note: See TracBrowser for help on using the repository browser.