From c90bddbfc94367fa26d806ea18b0c7314b870e52 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 11 Jul 2020 21:18:16 +0200 Subject: mg2d: add logging to some error paths --- mg2d.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/mg2d.c b/mg2d.c index 08a91df..e7ae350 100644 --- a/mg2d.c +++ b/mg2d.c @@ -1096,8 +1096,11 @@ int mg2d_solve(MG2DContext *ctx) if (!priv->root) { ret = mg_levels_alloc(ctx); - if (ret < 0) + if (ret < 0) { + mg2di_log(&priv->logger, MG2D_LOG_ERROR, + "Error allocating the levels\n"); return ret; + } } if (!priv->tp) { @@ -1491,8 +1494,10 @@ static int mg_levels_alloc(MG2DContext *ctx) /* compute the levels geometries/partitioning */ ret = mg_dh_init(&priv->dh, priv->dg, ctx->step, ctx->max_levels); - if (ret < 0) + if (ret < 0) { + mg2di_log(&priv->logger, MG2D_LOG_ERROR, "Error partitioning the domain\n"); return ret; + } /* allocate the solver for each level */ comm_parent = priv->mpi_comm; @@ -1526,8 +1531,11 @@ static int mg_levels_alloc(MG2DContext *ctx) break; level = mg_level_alloc(dg, priv->local_component, comm_cur); - if (!level) + if (!level) { + mg2di_log(&priv->logger, MG2D_LOG_ERROR, + "Error allocating level %d", depth); return -ENOMEM; + } level->depth = depth; level->priv = priv; @@ -1550,8 +1558,11 @@ static int mg_levels_alloc(MG2DContext *ctx) break; ret = mg_interdomain_setup(ctx, cur); - if (ret < 0) + if (ret < 0) { + mg2di_log(&priv->logger, MG2D_LOG_ERROR, + "Error setting up inter-level transfers\n"); return ret; + } } return ret; -- cgit v1.2.3