diff options
author | Anton Khirnov <anton@khirnov.net> | 2020-07-11 21:18:16 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2020-07-11 21:18:16 +0200 |
commit | c90bddbfc94367fa26d806ea18b0c7314b870e52 (patch) | |
tree | 092cedafb9c59442b1210f17cce006d42c9b5f8e | |
parent | ab72ad7bb19f08d78218d3558545f9f58e5b36e7 (diff) |
mg2d: add logging to some error paths
-rw-r--r-- | mg2d.c | 19 |
1 files changed, 15 insertions, 4 deletions
@@ -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; |