forked from abduld/libwb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunmp.sh
executable file
·58 lines (49 loc) · 1.02 KB
/
runmp.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
if [ $# -ne 1 ]
then
echo "usage: $0 <mp number>" 1>&2
exit 1
fi
MP=$1
TARGET=build/Debug/MP${MP}.exe
if [ ! -x ${TARGET} ]
then
echo "unable to find executable ${TARGET}" 1>&2
exit 1
fi
DATADIR=data/MP${MP}/data
if [ ! -x ${DATADIR} ]
then
echo "unable to find directory ${DATADIR}" 1>&2
exit 1
fi
case ${MP} in
0|1|5)
TYPE=vector
;;
2|3)
TYPE=matrix
;;
4)
TYPE=image
;;
*)
echo "unknonn type for MP${MP}" 1>&2
exit 1
;;
esac
for dataset in ${DATADIR}/*
do
echo "executing with dataset ${dataset}"
inputs=`ls ${dataset}/input* 2>/dev/null | xargs echo | sed -e "s/ */,/g"`
expected=`ls ${dataset}/output* 2>/dev/null `
if [ -z "${inputs} ]
then
inputs=none
fi
if [ -z "${expected} ]
then
expected=none
fi
echo ${TARGET} -e ${expected} -i ${inputs} -o ${dataset}/result.raw -t ${TYPE}
${TARGET} -e ${expected} -i ${inputs} -o ${dataset}/result.raw -t ${TYPE}
done