-
Notifications
You must be signed in to change notification settings - Fork 0
/
benchmark.bat
78 lines (64 loc) · 1.87 KB
/
benchmark.bat
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
@echo off
if "%1" == "" goto :help
if "%2" == "" goto :help
if "%3" == "" goto :help
echo Started %time% %date%.
call git checkout origin/parallel-stable
:: Sequential
call :benchmark %1 %2 0 %3\seq -n
:: Parallel
call :benchmark %1 %2 2 %3\par
call :benchmark %1 %2 4 %3\par
call :benchmark %1 %2 8 %3\par
call :benchmark %1 %2 12 %3\par
call :benchmark %1 %2 16 %3\par
call :benchmark %1 %2 32 %3\par
call :benchmark %1 %2 48 %3\par
:: Parallel with thread local
call :benchmark %1 %2 2 %3\par-local -l
call :benchmark %1 %2 4 %3\par-local -l
call :benchmark %1 %2 8 %3\par-local -l
call :benchmark %1 %2 12 %3\par-local -l
call :benchmark %1 %2 16 %3\par-local -l
call :benchmark %1 %2 32 %3\par-local -l
call :benchmark %1 %2 48 %3\par-local -l
echo Finished %time% %date%.
exit /b
:help
echo Script to run Puncalc benchmarks. It will automatically benchmark each sheet
echo - sequentially, as a baseline;
echo - in parallel up to 48 cores; and
echo - in parallel with thread-local optimizations up to 48 cores.
echo.
echo Usage:
echo benchmark.bat path\to\sheets iterations path\to\logs
echo.
echo path\to\sheets - Path to a folder that contains XML spreadsheets.
echo iterations - Number of iterations to repeat.
echo path\to\logs - Path to a folder where log files will be stored.
echo.
:: Done
exit /b
:benchmark
setlocal
set files=%1
set n=%2
set cores=%3
set log=%4
shift /4
set flags=%*
mkdir %log%\%cores%
:: Log build events
echo Building...
git show -q > %log%\git.log
call build -c > %log%\build.log 2>&1
call build -r %flags% >> %log%\build.log 2>&1
echo Running %n% iterations on %cores% cores, logging to %log%:
:: Benchmark Funcalc for each sheet.
for /r %files% %%I in (*.xml) do (
echo Benchmarking %%I
call funcalc -r roots %n% %cores% "%%I" 1> "%log%\%cores%\%%~nxI.out" 2> "%log%\%cores%\%%~nxI.err"
)
echo Done!
endlocal
exit /b