Compare commits

...

8 Commits

Author SHA1 Message Date
Max Lübke
42b6ed40fe chore: Move content from source to header 2024-08-30 10:13:33 +00:00
Danny Puhan
fac2c07a3e Fix submodules 2024-08-09 17:42:48 +02:00
DannyPuhan
dc9962a6d6 Undo https url in .gitmodules 2024-07-09 11:33:39 +02:00
DannyPuhan
5b7e062e68 Fix URL in .gitmodules. 2024-07-09 11:27:05 +02:00
DannyPuhan
a7c192c808 Fix URL in .gitmodules. 2024-07-09 11:15:34 +02:00
Max Lübke
462c3d4716 Update benchmark runtimes according to timings from PERFACCT 2024-07-04 12:01:59 +02:00
Max Lübke
20c2917606 Merge branch 'feat-set-num-threads-via-env-variable' into 'master'
[feat] Set number of threads via env variable `OMP_NUM_THREADS`.

See merge request naaice/naaice_tug_input!1
2024-06-06 11:55:12 +02:00
DannyPuhan
4692a246d5 [feat] Set number of threads via env variable OMP_NUM_THREADS. 2024-06-06 09:45:42 +02:00
4 changed files with 77 additions and 71 deletions

Binary file not shown.

View File

@ -87,7 +87,7 @@ for $\alpha_x$ and $\alpha_y$ respectively:
\begin{equation*}
\begin{cases}
\displaystyle \alpha_x & \displaystyle = 10^{-7} + 10^{-6} \frac{\mathcal{F}-\min{(\mathcal{F})}}{\max{(\mathcal{F})}}\\
\displaystyle \alpha_x & \displaystyle = 10^{-7} + 10^{-6} \frac{\mathcal{F}-\min{(\mathcal{F})}}{\max{(\mathcal{F})}} \\
\alpha_y & \displaystyle = 10^{-7} + 10^{-7} \frac{\mathcal{F}-\min{(\mathcal{F})}}{\max{(\mathcal{F})}}
\end{cases}
\end{equation*}
@ -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

View File

@ -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);

View File

@ -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