aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;