50{
51
58
59 size_t nEle;
60 if (argc < 2)
61 {
62 nEle = 10;
63 }
64 else
65 {
66 nEle = std::stoi(argv[1]);
67 }
68
69 std::cout << "number of faces\t" << nEle
70 << "\t(assuming 4*4 nodes per face)\n";
71
72
74
76 riemannSolver.SetParam("gamma",
77 [&gamma]() ->
NekDouble & {
return gamma; });
78
79 size_t spaceDim = 3;
80 size_t npts = 4 * 4 * nEle;
81
82
85 for (size_t i = 0; i < spaceDim; ++i)
86 {
87 vecLocs[0][i] = 1 + i;
88 }
89 riemannSolver.SetAuxVec(
90 "vecLocs",
92 return vecLocs;
93 });
94
95
97 for (size_t i = 0; i < spaceDim; ++i)
98 {
100 }
101 riemannSolver.SetVector(
103 return normals;
104 });
105
106 size_t nFields = spaceDim + 2;
108 flx(nFields), flxRef(nFields);
109 for (size_t i = 0; i < nFields; ++i)
110 {
115 }
116
117
118
119
120 for (size_t i = 0; i < npts; ++i)
121 {
122
124 fwd[0][i] = rho;
125 bwd[0][i] = rho;
126
128 fwd[1][i] = rhou;
129 bwd[1][i] = rhou;
130
132 fwd[2][i] = rhov;
133 bwd[2][i] = rhov;
134
136 fwd[3][i] = rhow;
137 bwd[3][i] = rhow;
138
142 rhoe + 0.5 * (rhou * rhou + rhov * rhov + rhow * rhow) / rho;
143 fwd[nFields - 1][i] = E;
144 bwd[nFields - 1][i] = E;
145
146 normals[0][i] = 1.0;
147
148 flxRef[0][i] = rhou;
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;
153 }
154
155
156 constexpr size_t experiments = 1 << 12;
157
159 for (size_t j = 0; j < experiments; ++j)
160 {
161
162 riemannSolver.Solve(spaceDim, fwd, bwd, flx);
163 }
165
166 constexpr short CPU_CLK_UNHALTED_REF_id = 2;
167 int nevents{20};
168 std::vector<double> events(nevents);
169 [[maybe_unused]] double time;
170 [[maybe_unused]] int count;
171
173
174 double cpeRiemann = events[CPU_CLK_UNHALTED_REF_id] / npts / experiments;
175 std::cout << "Riemann likwid CPE\t" << cpeRiemann << '\n';
176
178
179 double cpeRotationTo = events[CPU_CLK_UNHALTED_REF_id] / npts / experiments;
180 std::cout << "RotationTo likwid CPE\t" << cpeRotationTo << '\n';
181
183
184 double cpev_Solve = events[CPU_CLK_UNHALTED_REF_id] / npts / experiments;
185 std::cout << "v_Solve likwid CPE\t" << cpev_Solve << '\n';
186
188
189 double cpeRotationFrom =
190 events[CPU_CLK_UNHALTED_REF_id] / npts / experiments;
191 std::cout << "RotationFrom likwid CPE\t" << cpeRotationFrom << '\n';
192
193 std::cout << flx[0][0] << std::endl;
194
196}
#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)