Benchmarks are now written into a csv-file
This commit is contained in:
@@ -22,6 +22,7 @@
|
|||||||
#include "astaroth.h"
|
#include "astaroth.h"
|
||||||
#include "astaroth_utils.h"
|
#include "astaroth_utils.h"
|
||||||
|
|
||||||
|
#include "errchk.h"
|
||||||
#include "timer_hires.h"
|
#include "timer_hires.h"
|
||||||
|
|
||||||
#if AC_MPI_ENABLED
|
#if AC_MPI_ENABLED
|
||||||
@@ -99,12 +100,24 @@ main(void)
|
|||||||
results.push_back(timer_diff_nsec(t) / 1e6);
|
results.push_back(timer_diff_nsec(t) / 1e6);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Write benchmark to file
|
||||||
|
if (!pid) {
|
||||||
std::sort(results.begin(), results.end(),
|
std::sort(results.begin(), results.end(),
|
||||||
[](const double& a, const double& b) { return a < b; });
|
[](const double& a, const double& b) { return a < b; });
|
||||||
fprintf(stdout,
|
fprintf(stdout,
|
||||||
"Integration step time %g ms (%gth percentile)--------------------------------------\n",
|
"Integration step time %g ms (%gth "
|
||||||
|
"percentile)--------------------------------------\n",
|
||||||
results[nth_percentile * num_iters], 100 * nth_percentile);
|
results[nth_percentile * num_iters], 100 * nth_percentile);
|
||||||
acGridSynchronizeStream(STREAM_ALL);
|
|
||||||
|
const char* path = "strong_scaling.csv";
|
||||||
|
FILE* fp = fopen(path, "a");
|
||||||
|
ERRCHK_ALWAYS(fp);
|
||||||
|
// Format
|
||||||
|
// nprocs, measured (ms)
|
||||||
|
fprintf(fp, "%d, %g\n", nprocs, results[nth_percentile * num_iters]);
|
||||||
|
|
||||||
|
fclose(fp);
|
||||||
|
}
|
||||||
|
|
||||||
acGridQuit();
|
acGridQuit();
|
||||||
MPI_Finalize();
|
MPI_Finalize();
|
||||||
|
Reference in New Issue
Block a user