From 6235ffa5e7a5c3157228910d606b62971c57c1c5 Mon Sep 17 00:00:00 2001 From: Augustin Degomme Date: Fri, 20 Jun 2014 11:04:42 +0200 Subject: [PATCH] don't do the call if an error is caught before --- src/smpi/smpi_pmpi.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/smpi/smpi_pmpi.c b/src/smpi/smpi_pmpi.c index 22858c3f3f..4a9a8d22dd 100644 --- a/src/smpi/smpi_pmpi.c +++ b/src/smpi/smpi_pmpi.c @@ -2588,15 +2588,15 @@ int PMPI_Initialized(int* flag) { int PMPI_Cart_create(MPI_Comm comm_old, int ndims, int* dims, int* periodic, int reorder, MPI_Comm* comm_cart) { int retval = 0; if (comm_old == MPI_COMM_NULL){ - retval = MPI_ERR_COMM; - } - else if (ndims < 0 || + retval = MPI_ERR_COMM; + } else if (ndims < 0 || (ndims > 0 && (dims == NULL || periodic == NULL)) || comm_cart == NULL) { - retval = MPI_ERR_ARG; + retval = MPI_ERR_ARG; + } else{ + retval = smpi_mpi_cart_create(comm_old, ndims, dims, periodic, reorder, comm_cart); } - retval = smpi_mpi_cart_create(comm_old, ndims, dims, periodic, reorder, comm_cart); return retval; } -- 2.20.1