Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
las3_pub
/
predictable_parallel_patterns
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
e3f8205e
authored
Jun 09, 2020
by
FritzFlorian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add memory measures to benchmarks.
parent
8f47876d
Pipeline
#1503
passed with stages
in 4 minutes 26 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
32 additions
and
1 deletions
+32
-1
app/benchmark_fft/main.cpp
+1
-0
app/benchmark_fib/main.cpp
+1
-0
app/benchmark_matrix/main.cpp
+1
-0
app/benchmark_matrix_div_conquer/main.cpp
+1
-0
app/benchmark_unbalanced/main.cpp
+1
-0
extern/benchmark_runner/benchmark_runner.h
+27
-1
No files found.
app/benchmark_fft/main.cpp
View file @
e3f8205e
...
...
@@ -38,6 +38,7 @@ int main(int argc, char **argv) {
string
test_name
=
to_string
(
num_threads
)
+
".csv"
;
string
full_directory
=
directory
+
"/PLS_v3/"
;
benchmark_runner
runner
{
full_directory
,
test_name
};
runner
.
enable_memory_stats
();
fft
::
complex_vector
data
(
fft
::
SIZE
);
fft
::
complex_vector
swap_array
(
fft
::
SIZE
);
...
...
app/benchmark_fib/main.cpp
View file @
e3f8205e
...
...
@@ -36,6 +36,7 @@ int main(int argc, char **argv) {
string
test_name
=
to_string
(
num_threads
)
+
".csv"
;
string
full_directory
=
directory
+
"/PLS_v3/"
;
benchmark_runner
runner
{
full_directory
,
test_name
};
runner
.
enable_memory_stats
();
pls
::
scheduler
scheduler
{(
unsigned
)
num_threads
,
MAX_NUM_TASKS
,
MAX_STACK_SIZE
};
...
...
app/benchmark_matrix/main.cpp
View file @
e3f8205e
...
...
@@ -31,6 +31,7 @@ int main(int argc, char **argv) {
string
test_name
=
to_string
(
num_threads
)
+
".csv"
;
string
full_directory
=
directory
+
"/PLS_v3/"
;
benchmark_runner
runner
{
full_directory
,
test_name
};
runner
.
enable_memory_stats
();
pls_matrix
<
double
,
matrix
::
MATRIX_SIZE
>
a
;
pls_matrix
<
double
,
matrix
::
MATRIX_SIZE
>
b
;
...
...
app/benchmark_matrix_div_conquer/main.cpp
View file @
e3f8205e
...
...
@@ -112,6 +112,7 @@ int main(int argc, char **argv) {
string
test_name
=
to_string
(
num_threads
)
+
".csv"
;
string
full_directory
=
directory
+
"/PLS_v3/"
;
benchmark_runner
runner
{
full_directory
,
test_name
};
runner
.
enable_memory_stats
();
// Only run on one version to avoid copy
std
::
unique_ptr
<
double
[]
>
result_data
{
new
double
[
size
*
size
]};
...
...
app/benchmark_unbalanced/main.cpp
View file @
e3f8205e
...
...
@@ -42,6 +42,7 @@ int main(int argc, char **argv) {
string
test_name
=
to_string
(
num_threads
)
+
".csv"
;
string
full_directory
=
directory
+
"/PLS_v3/"
;
benchmark_runner
runner
{
full_directory
,
test_name
};
runner
.
enable_memory_stats
();
scheduler
scheduler
{(
unsigned
)
num_threads
,
MAX_NUM_TASKS
,
MAX_STACK_SIZE
};
...
...
extern/benchmark_runner/benchmark_runner.h
View file @
e3f8205e
...
...
@@ -29,6 +29,12 @@ class benchmark_runner {
chrono
::
steady_clock
::
time_point
last_start_time_
;
vector
<
long
>
times_
;
bool
memory_stats_enabled_
{
false
};
const
string
MEMORY_PRE_RUN
=
"memory_pages_pre_run"
;
const
string
MEMORY_POST_RUN
=
"memory_pages_post_run"
;
unsigned
long
memory_pre_run_
;
unsigned
long
memory_post_run_
;
map
<
string
,
vector
<
long
>>
custom_stats_
;
void
print_statistics
()
{
...
...
@@ -96,6 +102,12 @@ class benchmark_runner {
custom_stats_
.
insert
({
name
,
{}});
}
void
enable_memory_stats
()
{
memory_stats_enabled_
=
true
;
add_custom_stats_field
(
MEMORY_PRE_RUN
);
add_custom_stats_field
(
MEMORY_POST_RUN
);
}
static
void
read_args
(
int
argc
,
char
**
argv
,
int
&
num_threads
,
string
&
path
)
{
if
(
argc
<
3
)
{
cout
<<
"Must Specifiy concurrency and output directory! (usage: `benchmark <output_directory> <num_threads>`)"
...
...
@@ -109,17 +121,31 @@ class benchmark_runner {
}
void
start_iteration
()
{
if
(
memory_stats_enabled_
)
{
auto
memory_stats
=
query_process_memory_pages
();
memory_pre_run_
=
memory_stats
.
first
;
}
last_start_time_
=
chrono
::
steady_clock
::
now
();
}
void
end_iteration
()
{
size_t
iteration_index
=
times_
.
size
();
auto
end_time
=
chrono
::
steady_clock
::
now
();
long
time
=
chrono
::
duration_cast
<
chrono
::
microseconds
>
(
end_time
-
last_start_time_
).
count
();
times_
.
emplace_back
(
time
);
times_
.
emplace_back
(
time
);
for
(
auto
&
iter
:
custom_stats_
)
{
iter
.
second
.
emplace_back
(
0
);
}
if
(
memory_stats_enabled_
)
{
auto
memory_stats
=
query_process_memory_pages
();
memory_post_run_
=
memory_stats
.
first
;
custom_stats_
[
MEMORY_PRE_RUN
][
iteration_index
]
=
memory_pre_run_
;
custom_stats_
[
MEMORY_POST_RUN
][
iteration_index
]
=
memory_post_run_
;
}
}
void
store_custom_stat
(
const
string
&
name
,
long
value
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment