summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2018-12-28 10:08:26 +0100
committerAnton Khirnov <anton@khirnov.net>2018-12-28 10:08:26 +0100
commit47eb01846991ea22e023fdca5e9c0d0068e714ea (patch)
tree9a902117bb2574165e158d55e2e514a16fed67af
parenta1d2fadd1a9d2d0f93778fc72d8693234ae7772e (diff)
mg2d: print the overhead time in stats
-rw-r--r--mg2d.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/mg2d.c b/mg2d.c
index fd775e4..e77c3d1 100644
--- a/mg2d.c
+++ b/mg2d.c
@@ -662,22 +662,26 @@ void mg2d_print_stats(MG2DContext *ctx, const char *prefix)
{
MG2DInternal *priv = ctx->priv;
MG2DLevel *level = priv->root;
+ int64_t other, levels_total = 0;
if (!prefix)
prefix = "";
- mg2di_log(&priv->logger, MG2D_LOG_VERBOSE, "%s%ld solves; %g s total time; %g ms avg per call\n",
- prefix, priv->count_solve, priv->time_solve / 1e6, priv->time_solve / 1e3 / priv->count_solve);
+ mg2di_log(&priv->logger, MG2D_LOG_VERBOSE, "%s%ld solves; %g s total time; %g ms avg per call %g s findmax\n",
+ prefix, priv->count_solve, priv->time_solve / 1e6, priv->time_solve / 1e3 / priv->count_solve, priv->time_findmax / 1e6);
while (level) {
int64_t level_total = level->time_relax + level->time_prolong + level->time_restrict +
level->time_correct + level->time_reinit;
int64_t relax_total = level->solver->time_correct + level->solver->time_res_calc + level->solver->time_boundaries;
+ levels_total += level_total;
+
mg2di_log(&priv->logger, MG2D_LOG_VERBOSE,
"%s%2.2f%% level %d: %ld cycles %g s total time %g ms avg per call || "
"%2.2f%% relax %2.2f%% prolong %2.2f%% restrict %2.2f%% correct %2.2f%% reinit || "
- "%2.2f%% residual %2.2f%% correct %2.2f%% boundaries\n",
+ "%2.2f%% residual %2.2f%% correct %2.2f%% boundaries ||"
+ "\n",
prefix, level_total * 100.0 / priv->time_solve, level->depth, level->count_cycles,
level_total / 1e6, level_total / 1e3 / level->count_cycles,
level->time_relax * 100.0 / level_total,
@@ -692,4 +696,11 @@ void mg2d_print_stats(MG2DContext *ctx, const char *prefix)
level = level->child;
}
+
+ other = priv->time_solve - levels_total;
+ mg2di_log(&priv->logger, MG2D_LOG_VERBOSE,
+ "%s%2.2f%% other %g s total time %g ms avg per call\n",
+ prefix, other * 100.0 / priv->time_solve,
+ other / 1e6, other / 1e3 / priv->count_solve);
+
}