If MPI_ALLOC_MEM is invoked with a 0 sized request, return NULL. If
MPI_FREE_MEM is invoked with NULL, return success. Fixes trac:1101. This commit was SVN r15593. The following Trac tickets were found above: Ticket 1101 --> https://svn.open-mpi.org/trac/ompi/ticket/1101
Этот коммит содержится в:
родитель
e6345aeac6
Коммит
e80b7e9dde
@ -9,6 +9,7 @@
|
|||||||
* University of Stuttgart. All rights reserved.
|
* University of Stuttgart. All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
|
* Copyright (c) 2007 Cisco, Inc. All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
@ -52,6 +53,19 @@ int MPI_Alloc_mem(MPI_Aint size, MPI_Info info, void *baseptr)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Per these threads:
|
||||||
|
|
||||||
|
http://www.open-mpi.org/community/lists/devel/2007/07/1977.php
|
||||||
|
http://www.open-mpi.org/community/lists/devel/2007/07/1979.php
|
||||||
|
|
||||||
|
If you call MPI_ALLOC_MEM with a size of 0, you get NULL
|
||||||
|
back .*/
|
||||||
|
if (0 == size) {
|
||||||
|
*((void **) baseptr) = NULL;
|
||||||
|
printf("0 size mem_alloc\n");
|
||||||
|
return MPI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
*((void **) baseptr) = mca_mpool_base_alloc((size_t) size, info);
|
*((void **) baseptr) = mca_mpool_base_alloc((size_t) size, info);
|
||||||
if (NULL == *((void **) baseptr)) {
|
if (NULL == *((void **) baseptr)) {
|
||||||
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_NO_MEM,
|
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_NO_MEM,
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
* University of Stuttgart. All rights reserved.
|
* University of Stuttgart. All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
|
* Copyright (c) 2007 Cisco, Inc. All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
@ -39,15 +40,14 @@ int MPI_Free_mem(void *baseptr)
|
|||||||
{
|
{
|
||||||
OPAL_CR_TEST_CHECKPOINT_READY();
|
OPAL_CR_TEST_CHECKPOINT_READY();
|
||||||
|
|
||||||
if (MPI_PARAM_CHECK) {
|
/* Per these threads:
|
||||||
if (NULL == baseptr) {
|
|
||||||
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
|
|
||||||
FUNC_NAME);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(OMPI_SUCCESS != mca_mpool_base_free(baseptr))
|
http://www.open-mpi.org/community/lists/devel/2007/07/1977.php
|
||||||
{
|
http://www.open-mpi.org/community/lists/devel/2007/07/1979.php
|
||||||
|
|
||||||
|
If you call MPI_ALLOC_MEM with a size of 0, you get NULL
|
||||||
|
back. So don't consider a NULL==baseptr an error. */
|
||||||
|
if (NULL != baseptr && OMPI_SUCCESS != mca_mpool_base_free(baseptr)) {
|
||||||
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_NO_MEM, FUNC_NAME);
|
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_NO_MEM, FUNC_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user