Fix gflops in bench
This commit is contained in:
parent
2aa5b6c2e8
commit
52f17015df
@ -42,35 +42,35 @@ int main(int argc, char** argv) {
|
|||||||
MPI_Comm_rank(world.comm, &rank);
|
MPI_Comm_rank(world.comm, &rank);
|
||||||
constexpr double elem_to_gb = 8.0 / 1024.0 / 1024.0 / 1024.0;
|
constexpr double elem_to_gb = 8.0 / 1024.0 / 1024.0 / 1024.0;
|
||||||
|
|
||||||
const double doublesFlops
|
// USER PRINTING TEST BEGIN
|
||||||
= double(no)
|
const double doublesFlops = no * no * no
|
||||||
* double(no)
|
* (no + nv)
|
||||||
* double(no)
|
* 2.0
|
||||||
* (double(no) + double(nv))
|
* 6.0
|
||||||
* 2
|
/ 1.0e9
|
||||||
* 6
|
;
|
||||||
/ 1e9
|
double lastElapsedTime = 0;
|
||||||
;
|
bool firstHeaderPrinted = false;
|
||||||
|
|
||||||
bool firstHeader = true;
|
|
||||||
|
|
||||||
atrip::registerIterationDescriptor
|
atrip::registerIterationDescriptor
|
||||||
([doublesFlops, &firstHeader, rank](atrip::IterationDescription const& d) {
|
([doublesFlops, &firstHeaderPrinted, rank, &lastElapsedTime]
|
||||||
|
(atrip::IterationDescription const& d) {
|
||||||
const char
|
const char
|
||||||
*fmt_header = "%-13s%-10s%-13s",
|
*fmt_header = "%-13s%-10s%-13s",
|
||||||
*fmt_nums = "%-13.0f%-10.0f%-13.3f";
|
*fmt_nums = "%-13.0f%-10.0f%-13.3f";
|
||||||
char out[256];
|
char out[256];
|
||||||
if (firstHeader) {
|
if (!firstHeaderPrinted) {
|
||||||
sprintf(out, fmt_header, "Progress(%)", "time(s)", "GLFOP/s");
|
sprintf(out, fmt_header, "Progress(%)", "time(s)", "GFLOP/s");
|
||||||
firstHeader = false;
|
firstHeaderPrinted = true;
|
||||||
if (rank == 0) std::cout << out << "\n";
|
if (rank == 0) std::cout << out << "\n";
|
||||||
}
|
}
|
||||||
sprintf(out, fmt_nums,
|
sprintf(out, fmt_nums,
|
||||||
double(d.currentIteration) / double(d.totalIterations) * 100,
|
double(d.currentIteration) / double(d.totalIterations) * 100,
|
||||||
d.currentElapsedTime,
|
(d.currentElapsedTime - lastElapsedTime),
|
||||||
doublesFlops / d.currentElapsedTime);
|
d.currentIteration * doublesFlops / d.currentElapsedTime);
|
||||||
|
lastElapsedTime = d.currentElapsedTime;
|
||||||
if (rank == 0) std::cout << out << "\n";
|
if (rank == 0) std::cout << out << "\n";
|
||||||
});
|
});
|
||||||
|
// USER PRINTING TEST END
|
||||||
|
|
||||||
|
|
||||||
atrip::Atrip::Input::TuplesDistribution tuplesDistribution;
|
atrip::Atrip::Input::TuplesDistribution tuplesDistribution;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user