From 2861c43f05e9f5f2a4cbbba9aec70725a6f42eb2 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Fri, 23 Jun 2023 17:21:17 +0200 Subject: [PATCH] Update reported line --- src/heat/smp/main.c | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/src/heat/smp/main.c b/src/heat/smp/main.c index a5c3577..ff7acdb 100644 --- a/src/heat/smp/main.c +++ b/src/heat/smp/main.c @@ -25,26 +25,21 @@ int main(int argc, char **argv) double start = getTime(); double residual = solve(&conf, rows, cols, conf.timesteps, NULL); double end = getTime(); + double delta_time = end - start; - int64_t totalElements = conf.rows*conf.cols; - double throughput = (totalElements*conf.timesteps)/(end-start); + long niter = conf.convergenceTimesteps; + long iter_elem = conf.rows * conf.cols; + long total_elem = iter_elem * niter; + double throughput = total_elem / delta_time; -#ifdef _OMPSS_2 - int threads = sysconf(_SC_NPROCESSORS_ONLN); -#else - int threads = 1; -#endif - - fprintf(stderr, "%14s %14s %14s %8s %8s %8s %8s %8s %8s\n", - "time", "updates/s", "error", + fprintf(stderr, "%14s %14s %14s %8s %8s %8s %8s %8s\n", + "time", "updates/s", "rel. error", "rows", "cols", - "rbs", "cbs", "threads", - "steps"); - fprintf(stdout, "%14e %14e %14e %8ld %8ld %8d %8d %8d %8d\n", - end-start, throughput, residual, + "rbs", "cbs", "iters"); + fprintf(stdout, "%14e %14e %14e %8ld %8ld %8d %8d %8ld\n", + delta_time, throughput, residual, conf.rows, conf.cols, - conf.rbs, conf.cbs, threads, - conf.convergenceTimesteps); + conf.rbs, conf.cbs, niter); if (conf.generateImage) writeImage(conf.imageFileName, conf.matrix, rows, cols);