aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2020-07-11 21:18:16 +0200
committerAnton Khirnov <anton@khirnov.net>2020-07-11 21:18:16 +0200
commitc90bddbfc94367fa26d806ea18b0c7314b870e52 (patch)
tree092cedafb9c59442b1210f17cce006d42c9b5f8e
parentab72ad7bb19f08d78218d3558545f9f58e5b36e7 (diff)
mg2d: add logging to some error paths
-rw-r--r--mg2d.c19
1 files 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;