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

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

trunk : modif for check job status

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