Skip to content

Commit 1c1b424

Browse files
committed
Allow explicitly specifying nosync on the command line to run only that baseline test in benchmark-cdeque.sh
1 parent 9664a68 commit 1c1b424

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

libworkstream_df/benchmark-cdeque.sh

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,16 @@ if [ $# -eq 0 ]; then
3333
tests='test-cdeque test-cdeque-nofences test-cdeque-c11 test-cdeque-dumbc11'
3434
else
3535
for t; do
36-
tests="$tests ${t#./}"
36+
if [ ${t%-nosync} = $t ]; then
37+
tests="$tests ${t#./}"
38+
else
39+
nosync=1
40+
fi
3741
done
3842
fi
3943
testargs="-b $b -d $d -n $nthread"
4044

41-
if [ -z "$randfile" ]; then
42-
randfile=rand.$$
43-
awk -v ni=$niter -v mu=$mu '
44-
BEGIN {
45-
for (i = 1; i <= ni; ++i)
46-
print -log(rand()) * mu
47-
}
48-
' >"$randfile"
49-
45+
if [ "$nosync" ] || [ -z "$randfile" ]; then
5046
t=test-cdeque-nosync
5147
echo $t prerun >&2
5248
for i in $(seq 1 10); do
@@ -58,6 +54,15 @@ if [ -z "$randfile" ]; then
5854
[ $dry ] || ./$t $testargs -f 0 | tail -n 1 >$log
5955
done
6056
fi
57+
if [ -z "$randfile" ]; then
58+
randfile=rand.$$
59+
awk -v ni=$niter -v mu=$mu '
60+
BEGIN {
61+
for (i = 1; i <= ni; ++i)
62+
print -log(rand()) * mu
63+
}
64+
' >"$randfile"
65+
fi
6166

6267
for t in $tests; do
6368
echo $t prerun >&2

0 commit comments

Comments
 (0)