Skip to content

Commit da4a32f

Browse files
committedMar 24, 2020
Add a test performance shell script (for Macs)
1 parent d1cb589 commit da4a32f

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed
 

‎.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,7 @@ documentation/*.out
3131

3232
# R-related files
3333
.Rhistory
34+
35+
# performance related
36+
performance/*.trace
37+
performance/*.dtps

‎performance/test_performance.sh

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
##########################################################################################
2+
# File: test_performance.sh
3+
# Description: Run model and profile speed of memory
4+
##########################################################################################
5+
6+
#!/bin/bash
7+
PARAM_DIR="../tests/data/baseline_parameters.csv"
8+
EXE="../src/covid19ibm.exe"
9+
PROFILE=1 # 0=no profile; 1=time; 2=memory
10+
11+
START=`date +%s`
12+
if [ $PROFILE == 1 ]
13+
then
14+
$EXE $PARAM_DIR 1 & PID=$!
15+
instruments -l 60000 -t Time\ Profiler -p $PID
16+
fi
17+
if [ $PROFILE == 2 ]
18+
then
19+
iprofiler -allocations -T 20s $EXE $PARAM_DIR 1
20+
fi
21+
if [ $PROFILE == 0 ]
22+
then
23+
$EXE $PARAM_DIR 1
24+
fi
25+
26+
27+
END=`date +%s`
28+
RUNTIME=$((END-START))
29+
echo "execution time was" $RUNTIME "seconds"
30+
if [ $RUNTIME \> 40 ]
31+
then
32+
printf "\n*********************************\n** FAILURE - TOO SLOW\n*********************************\n\n"
33+
fi
34+

0 commit comments

Comments
 (0)
Please sign in to comment.