Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
42b6ed40fe | ||
|
|
fac2c07a3e | ||
|
|
dc9962a6d6 | ||
|
|
5b7e062e68 | ||
|
|
a7c192c808 | ||
|
|
462c3d4716 | ||
|
|
20c2917606 | ||
|
|
4692a246d5 |
Binary file not shown.
@ -111,7 +111,7 @@ benchmark.
|
||||
\end{figure}
|
||||
|
||||
|
||||
This benchmarks runs in $\sim$11~s on 8 CPUs on my desktop.
|
||||
This benchmarks runs in $\sim$ 1.8~s on 18 CPUs on a System @ PERFACCT.
|
||||
|
||||
\clearpage
|
||||
|
||||
@ -181,7 +181,7 @@ record. The non-rounded values are read from file
|
||||
\texttt{barite\_200} benchmark\label{fig:blarge}}
|
||||
\end{figure}
|
||||
|
||||
This benchmark runs in $\sim$30~s on my desktop using 8 CPUs.
|
||||
This benchmark runs in $\sim$6.4~s on my desktop using 18 CPUs.
|
||||
|
||||
\clearpage
|
||||
|
||||
@ -260,7 +260,7 @@ boundaries are set to constant \textbf{BC} values. \textbf{Initial
|
||||
benchmark\label{fig:bsurf}}
|
||||
\end{figure}
|
||||
|
||||
This benchmark runs in $\sim$7~s on my desktop using 8 CPUs.
|
||||
This benchmark runs in $\sim$1.1~s on my desktop using 18 CPUs.
|
||||
|
||||
\clearpage
|
||||
|
||||
|
||||
25
src/run.cpp
25
src/run.cpp
@ -15,26 +15,6 @@
|
||||
|
||||
#include <Eigen/Eigen>
|
||||
|
||||
using TugType = double;
|
||||
|
||||
using RowMajorMat =
|
||||
Eigen::Matrix<TugType, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>;
|
||||
|
||||
static inline std::vector<TugType>
|
||||
eigenMatrix_to_vector(const Eigen::MatrixX<TugType> &mat) {
|
||||
if (mat.IsRowMajor) {
|
||||
return std::vector<TugType>(mat.data(), mat.data() + mat.size());
|
||||
} else {
|
||||
std::vector<TugType> out_vec(mat.size());
|
||||
for (int i = 0; i < mat.rows(); i++) {
|
||||
for (int j = 0; j < mat.cols(); j++) {
|
||||
out_vec[i * mat.cols() + j] = mat(i, j);
|
||||
}
|
||||
}
|
||||
return out_vec;
|
||||
}
|
||||
}
|
||||
|
||||
double 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);
|
||||
@ -85,6 +65,11 @@ double run_bench(const bench_input &input, const std::string &output_file) {
|
||||
|
||||
tug::Simulation<TugType> sim(grid, boundary);
|
||||
|
||||
if (const char *out = std::getenv("OMP_NUM_THREADS")) {
|
||||
int ompNumThreads = std::stoi(out, NULL);
|
||||
sim.setNumberThreads(ompNumThreads);
|
||||
}
|
||||
|
||||
sim.setTimestep(input.timestep);
|
||||
sim.setIterations(input.iterations);
|
||||
|
||||
|
||||
21
src/run.hpp
21
src/run.hpp
@ -1,8 +1,29 @@
|
||||
#ifndef _RUN_HPP
|
||||
#define _RUN_HPP
|
||||
|
||||
#include <Eigen/Eigen>
|
||||
#include <bench_defs.hpp>
|
||||
|
||||
using TugType = double;
|
||||
|
||||
using RowMajorMat =
|
||||
Eigen::Matrix<TugType, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>;
|
||||
|
||||
double run_bench(const bench_input &input, const std::string &output_file = "");
|
||||
|
||||
static inline std::vector<TugType>
|
||||
eigenMatrix_to_vector(const Eigen::MatrixX<TugType> &mat) {
|
||||
if (mat.IsRowMajor) {
|
||||
return std::vector<TugType>(mat.data(), mat.data() + mat.size());
|
||||
} else {
|
||||
std::vector<TugType> out_vec(mat.size());
|
||||
for (int i = 0; i < mat.rows(); i++) {
|
||||
for (int j = 0; j < mat.cols(); j++) {
|
||||
out_vec[i * mat.cols() + j] = mat(i, j);
|
||||
}
|
||||
}
|
||||
return out_vec;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // _RUN_HPP
|
||||
Loading…
x
Reference in New Issue
Block a user