Skip to content

Commit 4989f73

Browse files
authored
Update run.bat
1 parent c6e8019 commit 4989f73

File tree

1 file changed

+1
-167
lines changed

1 file changed

+1
-167
lines changed

scripts/run.bat

Lines changed: 1 addition & 167 deletions
Original file line numberDiff line numberDiff line change
@@ -1,204 +1,38 @@
11
@echo off
2-
Setlocal EnableDelayedExpansion
32

43
for /r "." %%a in (build\bin\*_seq.exe) do (
54
echo -------------------------------------
65
echo %%~na
76
echo -------------------------------------
8-
set start=!time!
97
%%~fa --gtest_repeat=10
10-
set end=!time!
11-
12-
set options="tokens=1-4 delims=:.,"
13-
for /f %options% %%a in ("!start!") do (
14-
set start_h=%%a
15-
set /a start_m=100%%b %% 100
16-
set /a start_s=100%%c %% 100
17-
set /a start_ms=100%%d %% 100
18-
)
19-
for /f %options% %%a in ("!end!") do (
20-
set end_h=%%a
21-
set /a end_m=100%%b %% 100
22-
set /a end_s=100%%c %% 100
23-
set /a end_ms=100%%d %% 100
24-
)
25-
26-
set /a hours=!end_h!-!start_h!
27-
set /a mins=!end_m!-!start_m!
28-
set /a secs=!end_s!-!start_s!
29-
set /a ms=!end_ms!-!start_ms!
30-
31-
if !ms! lss 0 set /a secs = !secs! - 1 & set /a ms = 100!ms!
32-
if !secs! lss 0 set /a mins = !mins! - 1 & set /a secs = 60!secs!
33-
if !mins! lss 0 set /a hours = !hours! - 1 & set /a mins = 60!mins!
34-
if !hours! lss 0 set /a hours = 24!hours!
35-
if 1!ms! lss 100 set ms=0!ms!
36-
set /a totalsecs = !hours!*3600 + !mins!*60 + !secs!
37-
if !totalsecs! gtr 5 (
38-
echo Alert: runtime greater then 5 sec.
39-
echo runtime = !totalsecs! sec.
40-
exit /b 1
41-
)
428
)
439

4410
for /r "." %%a in (build\bin\*_omp.exe) do (
4511
echo -------------------------------------
4612
echo %%~na
4713
echo -------------------------------------
48-
set start=!time!
4914
%%~fa --gtest_repeat=10
50-
set end=!time!
51-
52-
set options="tokens=1-4 delims=:.,"
53-
for /f %options% %%a in ("!start!") do (
54-
set start_h=%%a
55-
set /a start_m=100%%b %% 100
56-
set /a start_s=100%%c %% 100
57-
set /a start_ms=100%%d %% 100
58-
)
59-
for /f %options% %%a in ("!end!") do (
60-
set end_h=%%a
61-
set /a end_m=100%%b %% 100
62-
set /a end_s=100%%c %% 100
63-
set /a end_ms=100%%d %% 100
64-
)
65-
66-
set /a hours=!end_h!-!start_h!
67-
set /a mins=!end_m!-!start_m!
68-
set /a secs=!end_s!-!start_s!
69-
set /a ms=!end_ms!-!start_ms!
70-
71-
if !ms! lss 0 set /a secs = !secs! - 1 & set /a ms = 100!ms!
72-
if !secs! lss 0 set /a mins = !mins! - 1 & set /a secs = 60!secs!
73-
if !mins! lss 0 set /a hours = !hours! - 1 & set /a mins = 60!mins!
74-
if !hours! lss 0 set /a hours = 24!hours!
75-
if 1!ms! lss 100 set ms=0!ms!
76-
set /a totalsecs = !hours!*3600 + !mins!*60 + !secs!
77-
if !totalsecs! gtr 5 (
78-
echo Alert: runtime greater then 5 sec.
79-
echo runtime = !totalsecs! sec.
80-
exit /b 1
81-
)
8215
)
8316

8417
for /r "." %%a in (build\bin\*_tbb.exe) do (
8518
echo -------------------------------------
8619
echo %%~na
8720
echo -------------------------------------
88-
set start=!time!
8921
%%~fa --gtest_repeat=10
90-
set end=!time!
91-
92-
set options="tokens=1-4 delims=:.,"
93-
for /f %options% %%a in ("!start!") do (
94-
set start_h=%%a
95-
set /a start_m=100%%b %% 100
96-
set /a start_s=100%%c %% 100
97-
set /a start_ms=100%%d %% 100
98-
)
99-
for /f %options% %%a in ("!end!") do (
100-
set end_h=%%a
101-
set /a end_m=100%%b %% 100
102-
set /a end_s=100%%c %% 100
103-
set /a end_ms=100%%d %% 100
104-
)
105-
106-
set /a hours=!end_h!-!start_h!
107-
set /a mins=!end_m!-!start_m!
108-
set /a secs=!end_s!-!start_s!
109-
set /a ms=!end_ms!-!start_ms!
110-
111-
if !ms! lss 0 set /a secs = !secs! - 1 & set /a ms = 100!ms!
112-
if !secs! lss 0 set /a mins = !mins! - 1 & set /a secs = 60!secs!
113-
if !mins! lss 0 set /a hours = !hours! - 1 & set /a mins = 60!mins!
114-
if !hours! lss 0 set /a hours = 24!hours!
115-
if 1!ms! lss 100 set ms=0!ms!
116-
set /a totalsecs = !hours!*3600 + !mins!*60 + !secs!
117-
if !totalsecs! gtr 5 (
118-
echo Alert: runtime greater then 5 sec.
119-
echo runtime = !totalsecs! sec.
120-
exit /b 1
121-
)
12222
)
12323

12424
for /r "." %%a in (build\bin\*_std.exe) do (
12525
echo -------------------------------------
12626
echo %%~na
12727
echo -------------------------------------
128-
set start=!time!
12928
%%~fa --gtest_repeat=10
130-
set end=!time!
131-
132-
set options="tokens=1-4 delims=:.,"
133-
for /f %options% %%a in ("!start!") do (
134-
set start_h=%%a
135-
set /a start_m=100%%b %% 100
136-
set /a start_s=100%%c %% 100
137-
set /a start_ms=100%%d %% 100
138-
)
139-
for /f %options% %%a in ("!end!") do (
140-
set end_h=%%a
141-
set /a end_m=100%%b %% 100
142-
set /a end_s=100%%c %% 100
143-
set /a end_ms=100%%d %% 100
144-
)
145-
146-
set /a hours=!end_h!-!start_h!
147-
set /a mins=!end_m!-!start_m!
148-
set /a secs=!end_s!-!start_s!
149-
set /a ms=!end_ms!-!start_ms!
150-
151-
if !ms! lss 0 set /a secs = !secs! - 1 & set /a ms = 100!ms!
152-
if !secs! lss 0 set /a mins = !mins! - 1 & set /a secs = 60!secs!
153-
if !mins! lss 0 set /a hours = !hours! - 1 & set /a mins = 60!mins!
154-
if !hours! lss 0 set /a hours = 24!hours!
155-
if 1!ms! lss 100 set ms=0!ms!
156-
set /a totalsecs = !hours!*3600 + !mins!*60 + !secs!
157-
if !totalsecs! gtr 5 (
158-
echo Alert: runtime greater then 5 sec.
159-
echo runtime = !totalsecs! sec.
160-
exit /b 1
161-
)
16229
)
16330

16431
for /r "." %%a in (build\bin\*_mpi.exe) do (
16532
echo -------------------------------------
16633
echo %%~na
16734
echo -------------------------------------
168-
set start=!time!
169-
for /l %%x in (1, 1, 10) do (
35+
for /l %%x in (1, 1, 1) do (
17036
mpiexec -np 4 %%~fa || exit /b 1
17137
)
172-
set end=!time!
173-
174-
set options="tokens=1-4 delims=:.,"
175-
for /f %options% %%a in ("!start!") do (
176-
set start_h=%%a
177-
set /a start_m=100%%b %% 100
178-
set /a start_s=100%%c %% 100
179-
set /a start_ms=100%%d %% 100
180-
)
181-
for /f %options% %%a in ("!end!") do (
182-
set end_h=%%a
183-
set /a end_m=100%%b %% 100
184-
set /a end_s=100%%c %% 100
185-
set /a end_ms=100%%d %% 100
186-
)
187-
188-
set /a hours=!end_h!-!start_h!
189-
set /a mins=!end_m!-!start_m!
190-
set /a secs=!end_s!-!start_s!
191-
set /a ms=!end_ms!-!start_ms!
192-
193-
if !ms! lss 0 set /a secs = !secs! - 1 & set /a ms = 100!ms!
194-
if !secs! lss 0 set /a mins = !mins! - 1 & set /a secs = 60!secs!
195-
if !mins! lss 0 set /a hours = !hours! - 1 & set /a mins = 60!mins!
196-
if !hours! lss 0 set /a hours = 24!hours!
197-
if 1!ms! lss 100 set ms=0!ms!
198-
set /a totalsecs = !hours!*3600 + !mins!*60 + !secs!
199-
if !totalsecs! gtr 5 (
200-
echo Alert: runtime greater then 5 sec.
201-
echo runtime = !totalsecs! sec.
202-
exit /b 1
203-
)
20438
)

0 commit comments

Comments
 (0)