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

Last change on this file since 2192 was 2036, checked in by yushan, 3 years ago

XIOS_COUPLING : update unit test files

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