4 Star 6 Fork 7

mathlib/exprAuto

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
detectErrorMultiPure.sh 1.96 KB
一键复制 编辑 原始数据 按行查看 历史
#!/bin/bash
# Description: error detecting with multi dimension
# Usage: ./detectErrorMulti.sh ${uniqueLabel} ${intervals[*]} ${prefix} ${middle} ${suffix}
# Example: ./detectErrorMulti.sh 20221127132126 12 42 53 64 75 8 expr_20221127132126 12_42_53_64_75_8 origin
# set -x
# ------initial
echo "start init ${uniqueLabel}"
path=$(pwd)
cd ${path}
# CC=gcc
PARACC=mpicc
let TESTNUM=2**19
let PARALLEL=8
# let TESTNUM_LOCAL=${TESTNUM}/${PARALLEL}
uniqueLabel=${1} # unique number
declare -a intervals
declare -a components
let NUM_BEFORE=1 # the first one is uniqueLabel
let NUM_AFTER=3 # 3 means prefix middle suffix
let NUM_INTERVALS=$#-${NUM_BEFORE}-${NUM_AFTER}
idx=0
idx_components=0
for i in "$@"; do
if [ $idx -ge ${NUM_BEFORE} ]; then
if [ $idx -le ${NUM_INTERVALS} ]; then
intervals[$idx - ${NUM_BEFORE}]=${i}
else
components[idx_components]=${i}
let idx_components++
fi
fi
let idx++
done
prefix=${components[0]}
middle=${components[1]}
suffix=${components[2]}
echo "end init ${uniqueLabel}"
# for ((i = 0; i < ${#intervals[*]}; i++)); do
# echo intervals[$i] = "${intervals[$i]}"
# done
# for ((i = 0; i < ${#components[*]}; i++)); do
# echo components[$i] = "${components[$i]}"
# done
# echo ./geneDataMulti.exe ${uniqueLabel} ${intervals[*]}
# ------error detecting
echo "start detecting ${uniqueLabel}"
# compile error detecting function
let PARA_NUM=2
testFileName=testMultiParallel
directory="./srcTest/"${uniqueLabel}
${PARACC} ./srcTest/${testFileName}.c ./srcTest/computeULP.c ./srcTest/expressionMulti.c ${directory}/${prefix}_${suffix}.c ${directory}/${prefix}_mpfr.c -DEXPRESSION=${prefix} -DSUFFIX=_${suffix} -DPARA_NUM=${PARA_NUM} -IincludeTEST -lmpfr -lm -o ${testFileName}.exe
# parallel run
OUTPUTFILE=${prefix}__${middle}_${suffix}
mpirun -n ${PARALLEL} ${testFileName}.exe ${OUTPUTFILE} ${TESTNUM}
# end everything
# rm inputData*txt
rm ${testFileName}.exe
echo "end detecting ${uniqueLabel}"
echo
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/mathlib/expr-auto.git
git@gitee.com:mathlib/expr-auto.git
mathlib
expr-auto
exprAuto
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385