Skip to content

Commit ad7f3f9

Browse files
committed
mpi: support MPI_Dims_create(..., ndims=0, ...)
this is a bozo case, but it should not fail with MPI_ERR_DIMS Signed-off-by: Gilles Gouaillardet <[email protected]>
1 parent 2b18044 commit ad7f3f9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ompi/mpi/c/dims_create.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* reserved.
1414
* Copyright (c) 2014 Intel, Inc. All rights reserved
1515
* Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
16-
* Copyright (c) 2015 Research Organization for Information Science
16+
* Copyright (c) 2015-2016 Research Organization for Information Science
1717
* and Technology (RIST). All rights reserved.
1818
* $COPYRIGHT$
1919
*
@@ -65,14 +65,14 @@ int MPI_Dims_create(int nnodes, int ndims, int dims[])
6565
if (MPI_PARAM_CHECK) {
6666
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
6767

68-
if (NULL == dims) {
68+
if (0 > ndims) {
6969
return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD,
70-
MPI_ERR_ARG, FUNC_NAME);
70+
MPI_ERR_DIMS, FUNC_NAME);
7171
}
7272

73-
if (1 > ndims) {
73+
if ((0 != ndims) && (NULL == dims)) {
7474
return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD,
75-
MPI_ERR_DIMS, FUNC_NAME);
75+
MPI_ERR_ARG, FUNC_NAME);
7676
}
7777

7878
if (1 > nnodes) {

0 commit comments

Comments
 (0)