Changeset 2579


Ignore:
Timestamp:
Oct 25, 2017 4:45:27 PM (4 years ago)
Author:
knoop
Message:

palmtest now testing for multiple cpu-setups

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SCRIPTS/palmtest

    r2515 r2579  
    5858}
    5959
     60get_core_array() {
     61   for i in 1 2 4 8 16 32; do
     62      if [[ $i -le ${1} ]]; then
     63         printf "$i "
     64      fi
     65   done
     66}
    6067
    6168configure() {
     
    93100palm_installer_test() {
    94101   hrule
    95    printf "Testing with \"${1}\"... "
    96    local input_dir=${tester_prefix}/JOBS/${1}/INPUT
    97    local monitoring_dir=${tester_prefix}/JOBS/${1}/MONITORING
    98    local test_dir=${trunk_dir}/INSTALL
    99    if [[ ! -f ${test_dir}/${1}_p3d ]] || [[ ! -f ${test_dir}/${1}_rc ]]; then
     102   local name=${1}
     103   local cores=${2}
     104   printf "Testing with \"${name}\" on ${cores} core(s)... "
     105   local job_id=${name}_${cores}
     106   local input_dir=${tester_prefix}/JOBS/${job_id}/INPUT
     107   local monitoring_dir=${tester_prefix}/JOBS/${job_id}/MONITORING
     108   if [[ ! -f ${test_dir}/${name}_p3d ]] || [[ ! -f ${test_dir}/${name}_rc ]]; then
    100109      printf " test not found\n"
    101110      return 1
     
    104113   mkdir -p ${input_dir}
    105114   mkdir -p ${monitoring_dir}
    106    cp ${test_dir}/${1}_p3d ${input_dir}/${1}_p3d
    107    cp ${test_dir}/${1}_rc ${monitoring_dir}/${1}_rc_reference
    108    [[ -f ${test_dir}/${1}_topo ]] && cp ${test_dir}/${1}_topo ${input_dir}/
    109    bash ${trunk_dir}/SCRIPTS/palmrun -d ${1} -a "d3#" -h "${configuration}" -X "$cores" -T "$cores" -v -B > ${monitoring_dir}/${1}_stdout 2>&1
    110    grep -A 99999 "Run-control output" ${monitoring_dir}/${1}_rc 1> ${monitoring_dir}/RC 2> /dev/null
    111    grep -A 99999 "Run-control output" ${monitoring_dir}/${1}_rc_reference 1> ${monitoring_dir}/RC_REF 2> /dev/null
     115   cp ${test_dir}/${name}_p3d ${input_dir}/${job_id}_p3d
     116   cp ${test_dir}/${name}_rc ${monitoring_dir}/${job_id}_rc_reference
     117   [[ -f ${test_dir}/${name}_topo ]] && cp ${test_dir}/${name}_topo ${input_dir}/${job_id}_topo
     118   bash ${trunk_dir}/SCRIPTS/palmrun -d ${job_id} -a "d3#" -h "${configuration}" -X "$cores" -T "$cores" -v -B > ${monitoring_dir}/${job_id}_stdout 2>&1
     119   grep -A 99999 "Run-control output" ${monitoring_dir}/${job_id}_rc 1> ${monitoring_dir}/RC 2> /dev/null
     120   grep -A 99999 "Run-control output" ${monitoring_dir}/${job_id}_rc_reference 1> ${monitoring_dir}/RC_REF 2> /dev/null
    112121   diff_output=$(diff ${monitoring_dir}/RC_REF ${monitoring_dir}/RC)
    113122   rm ${monitoring_dir}/RC ${monitoring_dir}/RC_REF
     
    124133palm_installer_test_suite() {
    125134   for test_path in ${fnames}; do
    126       testname_p3d=$(basename $test_path)
    127       palm_installer_test "${testname_p3d%_p3d}"
     135      for n_core in $(get_core_array $max_cores); do
     136         testname_p3d=$(basename $test_path)
     137         palm_installer_test "${testname_p3d%_p3d}" "${n_core}"
     138      done
    128139   done
    129140   hrule
     
    143154existing_trunk_dir=$(readlink -f "${SCRIPT_LOCATION}/../")
    144155
    145 cores=$(get_number_of_cpu_cores)
     156max_cores=$(get_number_of_cpu_cores)
    146157test_id=$(date +%Y-%m-%d_%H%M%S)
    147158do_plots=1
     
    156167      (N)   test_id="$OPTARG";;
    157168      (p)   do_plots=0;;
    158       (X)   cores=$OPTARG;;
     169      (X)   max_cores=$OPTARG;;
    159170      (\?)  printf "\n  +++ unknown option $OPTARG \n";
    160171            exit;;
     
    163174tester_prefix=${existing_working_dir}/tests/${test_id}
    164175trunk_dir=${tester_prefix}/trunk
     176test_dir=${trunk_dir}/INSTALL
    165177
    166178mkdir -p ${tester_prefix}
     
    169181ln -s ${existing_trunk_dir}
    170182
     183
     184
    171185configure
    172186build
Note: See TracChangeset for help on using the changeset viewer.