Added a switch for generating strong and weak scaling results

This commit is contained in:
jpekkila
2020-03-30 17:56:12 +03:00
parent d4eb3e0d35
commit 850b37e8c8

View File

@@ -30,8 +30,15 @@
#include <mpi.h>
#include <algorithm>
#include <string.h>
#include <vector>
typedef enum {
TEST_STRONG_SCALING,
TEST_WEAK_SCALING,
NUM_TESTS,
} TestType;
int
main(void)
{
@@ -44,6 +51,10 @@ main(void)
AcMeshInfo info;
acLoadConfig(AC_DEFAULT_CONFIG, &info);
const TestType test = TEST_STRONG_SCALING;
if (test == TEST_WEAK_SCALING)
info.int_params[AC_nz] *= nprocs;
/*
AcMesh model, candidate;
if (pid == 0) {
@@ -109,8 +120,15 @@ main(void)
"percentile)--------------------------------------\n",
results[nth_percentile * num_iters], 100 * nth_percentile);
const char* path = "strong_scaling.csv";
FILE* fp = fopen(path, "a");
char path[4096] = "";
if (test == TEST_STRONG_SCALING)
strncpy(path, "strong_scaling.csv", sizeof(path));
else if (test == TEST_WEAK_SCALING)
strncpy(path, "weak_scaling.csv", sizeof(path));
else
ERROR("Invalid test type");
FILE* fp = fopen(path, "a");
ERRCHK_ALWAYS(fp);
// Format
// nprocs, measured (ms)