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

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

Replace ccc_mpp by squeue in the test suite. ccc_mpp generates in the test suite from a few days the error 'ccc_mpp[717]: printf: warning: invalid argument of type T'

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