From: Augustin Degomme Date: Fri, 20 Jun 2014 09:04:42 +0000 (+0200) Subject: don't do the call if an error is caught before X-Git-Tag: v3_12~964^2~23 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/6235ffa5e7a5c3157228910d606b62971c57c1c5?ds=inline don't do the call if an error is caught before --- 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; }