Move parameter check into appropriate code section at the begin.
Freeprocs variable was obtained from nnodes, so check the value of nnodes at the begin in the MPI_PARAM_CHECK code section instead as discussed at the developer list. cmr=v1.7.5:reviewer=jsquyres:subject=move parameter check to begin jsquyres, please review this CMR. Thanks. This commit was SVN r30694.
Этот коммит содержится в:
родитель
1473dde6ea
Коммит
85dce869c8
@ -71,6 +71,11 @@ int MPI_Dims_create(int nnodes, int ndims, int dims[])
|
|||||||
return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD,
|
return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD,
|
||||||
MPI_ERR_DIMS, FUNC_NAME);
|
MPI_ERR_DIMS, FUNC_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (1 > nnodes) {
|
||||||
|
return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD,
|
||||||
|
MPI_ERR_DIMS, FUNC_NAME);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get # of free-to-be-assigned processes and # of free dimensions */
|
/* Get # of free-to-be-assigned processes and # of free dimensions */
|
||||||
@ -95,11 +100,7 @@ int MPI_Dims_create(int nnodes, int ndims, int dims[])
|
|||||||
FUNC_NAME);
|
FUNC_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (freeprocs < 1) {
|
if (freeprocs == 1) {
|
||||||
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_DIMS,
|
|
||||||
FUNC_NAME);
|
|
||||||
}
|
|
||||||
else if (freeprocs == 1) {
|
|
||||||
for (i = 0; i < ndims; ++i, ++dims) {
|
for (i = 0; i < ndims; ++i, ++dims) {
|
||||||
if (*dims == 0) {
|
if (*dims == 0) {
|
||||||
*dims = 1;
|
*dims = 1;
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user