Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HPC Benchmark Game
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dorian Stoll
HPC Benchmark Game
Commits
4749dc25
Verified
Commit
4749dc25
authored
7 months ago
by
Dorian Stoll
Browse files
Options
Downloads
Patches
Plain Diff
tug: cpp: Remove time measurement
parent
343d1042
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/benchmarks/tug/cpp/src/main.cpp
+6
-12
6 additions, 12 deletions
src/benchmarks/tug/cpp/src/main.cpp
src/benchmarks/tug/cpp/src/run.cpp
+2
-10
2 additions, 10 deletions
src/benchmarks/tug/cpp/src/run.cpp
src/benchmarks/tug/cpp/src/run.hpp
+1
-1
1 addition, 1 deletion
src/benchmarks/tug/cpp/src/run.hpp
with
9 additions
and
23 deletions
src/benchmarks/tug/cpp/src/main.cpp
+
6
−
12
View file @
4749dc25
...
...
@@ -5,24 +5,18 @@
#include
<iostream>
#include
<string>
#include
<tug/Simulation.hpp>
#include
<vector>
using
TugType
=
double
;
int
main
(
int
argc
,
char
**
argv
)
{
double
timings
[
3
];
std
::
cout
<<
"BARITE_200 started..."
;
run_bench
(
barite_200_input
,
"barite_200_output.csv"
);
std
::
cout
<<
"BARITE_200 started with output... "
;
timings
[
0
]
=
run_bench
(
barite_200_input
,
"barite_200_output.csv"
);
std
::
cout
<<
"Runtime: "
<<
timings
[
0
]
<<
" [ms]
\n
"
;
std
::
cout
<<
"BARITE_LARGE started..."
;
run_bench
(
barite_large_input
,
"barite_large_output.csv"
);
std
::
cout
<<
"BARITE_LARGE started with output... "
;
timings
[
1
]
=
run_bench
(
barite_large_input
,
"barite_large_output.csv"
);
std
::
cout
<<
"Runtime: "
<<
timings
[
1
]
<<
" [ms]
\n
"
;
std
::
cout
<<
"SURFEX started with output... "
;
timings
[
2
]
=
run_bench
(
surfex_input
,
"surfex_output.csv"
);
std
::
cout
<<
"Runtime: "
<<
timings
[
2
]
<<
" [ms]
\n
"
;
std
::
cout
<<
"SURFEX started..."
;
run_bench
(
surfex_input
,
"surfex_output.csv"
);
return
EXIT_SUCCESS
;
}
This diff is collapsed.
Click to expand it.
src/benchmarks/tug/cpp/src/run.cpp
+
2
−
10
View file @
4749dc25
...
...
@@ -7,8 +7,6 @@
#include
<Eigen/src/Core/Map.h>
#include
<Eigen/src/Core/Matrix.h>
#include
<Eigen/src/Core/util/Constants.h>
#include
<chrono>
#include
<ratio>
#include
<vector>
#include
<tug/Simulation.hpp>
...
...
@@ -35,7 +33,7 @@ eigenMatrix_to_vector(const Eigen::MatrixX<TugType> &mat) {
}
}
double
run_bench
(
const
bench_input
&
input
,
const
std
::
string
&
output_file
)
{
void
run_bench
(
const
bench_input
&
input
,
const
std
::
string
&
output_file
)
{
std
::
vector
<
std
::
vector
<
double
>>
raw_data
=
read_conc_csv
<
double
>
(
input
.
csv_file_init
,
input
.
ncols
,
input
.
nrows
);
...
...
@@ -45,8 +43,6 @@ double run_bench(const bench_input &input, const std::string &output_file) {
Eigen
::
Map
<
RowMajorMat
>
alpha_x
(
raw_alpha_x
.
data
(),
input
.
nrows
,
input
.
ncols
);
Eigen
::
Map
<
RowMajorMat
>
alpha_y
(
raw_alpha_y
.
data
(),
input
.
nrows
,
input
.
ncols
);
const
auto
start_t
=
std
::
chrono
::
high_resolution_clock
::
now
();
// create tug grids and boundary conditions
for
(
int
i
=
0
;
i
<
raw_data
.
size
();
i
++
)
{
...
...
@@ -89,7 +85,7 @@ double run_bench(const bench_input &input, const std::string &output_file) {
int
ompNumThreads
=
std
::
stoi
(
out
,
NULL
);
sim
.
setNumberThreads
(
ompNumThreads
);
}
sim
.
setTimestep
(
input
.
timestep
);
sim
.
setIterations
(
input
.
iterations
);
...
...
@@ -100,12 +96,8 @@ double run_bench(const bench_input &input, const std::string &output_file) {
raw_data
[
i
]
=
eigenMatrix_to_vector
(
result
);
}
const
auto
end_t
=
std
::
chrono
::
high_resolution_clock
::
now
();
// write results to file
if
(
!
output_file
.
empty
())
{
write_conc_csv
(
output_file
,
raw_data
);
}
return
std
::
chrono
::
duration
<
double
,
std
::
milli
>
(
end_t
-
start_t
).
count
();
}
This diff is collapsed.
Click to expand it.
src/benchmarks/tug/cpp/src/run.hpp
+
1
−
1
View file @
4749dc25
...
...
@@ -3,6 +3,6 @@
#include
<bench_defs.hpp>
double
run_bench
(
const
bench_input
&
input
,
const
std
::
string
&
output_file
);
void
run_bench
(
const
bench_input
&
input
,
const
std
::
string
&
output_file
);
#endif // _RUN_HPP
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment