Commit 108325d3 authored by Hejing Li's avatar Hejing Li
Browse files

put signal handler at the beginning

parent 2c165196
......@@ -41,9 +41,9 @@ k_end=199680
k_step=8320
#mtus="1500 4000 9000"
mtus="4000"
# link latency corresponds to RTT latency 1us 10us 100us 200us
#latencies="167ns 1670ns 16us 33us"
latencies="167ns 1670ns"
# link latency corresponds to RTT latency 1us 10us 20us 100us 200us
#latencies="167ns 1670ns 3300ns 16us 33us"
latencies="16us"
cores=$1
echo $cores
......@@ -51,7 +51,28 @@ echo $cores
proc=0
pids=""
cleanup() {
echo Cleaning up
for p in $pids ; do
kill $p &>/dev/null
done
sleep 1
for p in $pids ; do
kill -KILL $p &>/dev/null
done
}
sighandler() {
echo "Caught Interrupt, aborting...."
cleanup
exit 1
}
trap "sighandler" SIGINT
#for k in $(seq $k_start $k_step $k_end)
for lat in $latencies
do
......@@ -83,23 +104,3 @@ for p in $pids; do
wait $p
done
cleanup() {
echo Cleaning up
for p in $pids ; do
kill $p &>/dev/null
done
sleep 1
for p in $pids ; do
kill -KILL $p &>/dev/null
done
}
sighandler() {
echo "Caught Interrupt, aborting...."
cleanup
exit 1
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment