35#include "../RiemannSolvers/RoeSolver.h"
44#include "../RiemannSolvers/RoeSolver.h"
45#include "../RiemannSolvers/RoeSolverSIMD.h"
49int main(
int argc,
char const *argv[])
66 nEle = std::stoi(argv[1]);
69 std::cout <<
"number of faces\t" << nEle
70 <<
"\t(assuming 4*4 nodes per face)\n";
76 riemannSolver.SetParam(
"gamma",
77 [&gamma]() ->
NekDouble & {
return gamma; });
80 size_t npts = 4 * 4 * nEle;
85 for (
size_t i = 0; i < spaceDim; ++i)
87 vecLocs[0][i] = 1 + i;
89 riemannSolver.SetAuxVec(
97 for (
size_t i = 0; i < spaceDim; ++i)
101 riemannSolver.SetVector(
106 size_t nFields = spaceDim + 2;
108 flx(nFields), flxRef(nFields);
109 for (
size_t i = 0; i < nFields; ++i)
120 for (
size_t i = 0; i < npts; ++i)
142 rhoe + 0.5 * (rhou * rhou + rhov * rhov + rhow * rhow) / rho;
143 fwd[nFields - 1][i] = E;
144 bwd[nFields - 1][i] = E;
149 flxRef[1][i] = rhou * rhou / rho +
p;
150 flxRef[2][i] = rhou * rhov / rho;
151 flxRef[3][i] = rhou * rhow / rho;
152 flxRef[nFields - 1][i] = (E +
p) * rhou / rho;
156 constexpr size_t experiments = 1 << 12;
159 for (
size_t j = 0; j < experiments; ++j)
162 riemannSolver.Solve(spaceDim, fwd, bwd, flx);
166 constexpr short CPU_CLK_UNHALTED_REF_id = 2;
168 std::vector<double> events(nevents);
169 [[maybe_unused]]
double time;
170 [[maybe_unused]]
int count;
174 double cpeRiemann = events[CPU_CLK_UNHALTED_REF_id] / npts / experiments;
175 std::cout <<
"Riemann likwid CPE\t" << cpeRiemann <<
'\n';
179 double cpeRotationTo = events[CPU_CLK_UNHALTED_REF_id] / npts / experiments;
180 std::cout <<
"RotationTo likwid CPE\t" << cpeRotationTo <<
'\n';
184 double cpev_Solve = events[CPU_CLK_UNHALTED_REF_id] / npts / experiments;
185 std::cout <<
"v_Solve likwid CPE\t" << cpev_Solve <<
'\n';
189 double cpeRotationFrom =
190 events[CPU_CLK_UNHALTED_REF_id] / npts / experiments;
191 std::cout <<
"RotationFrom likwid CPE\t" << cpeRotationFrom <<
'\n';
193 std::cout << flx[0][0] << std::endl;
#define LIKWID_MARKER_THREADINIT
#define LIKWID_MARKER_START(regionTag)
#define LIKWID_MARKER_CLOSE
#define LIKWID_MARKER_INIT
#define LIKWID_MARKER_REGISTER(regionTag)
#define LIKWID_MARKER_STOP(regionTag)
#define LIKWID_MARKER_GET(regionTag, nevents, events, time, count)
int main(int argc, char const *argv[])