1
1

Minor fixes to match standard -- and run strict test of mpi_test_suite:

- bsend_init: use *request after error-checking
 - Always reset the status->cancelled
 - cancel, wait: need to check *request for MPI_REQUEST_NULL, not
   NULL...
   (actually ompi_request_wait handles MPI_PROC_NULL, so no need
   to check&set of status_empty in wait.c)

This commit was SVN r10972.
Этот коммит содержится в:
Rainer Keller 2006-07-24 16:59:01 +00:00
родитель 215542ad38
Коммит 31c66d92aa
7 изменённых файлов: 25 добавлений и 20 удалений

Просмотреть файл

@ -5,7 +5,7 @@
* Copyright (c) 2004-2005 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* Copyright (c) 2004-2006 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
@ -34,14 +34,10 @@ static const char FUNC_NAME[] = "MPI_Bsend_init";
int MPI_Bsend_init(void *buf, int count, MPI_Datatype type,
int dest, int tag, MPI_Comm comm, MPI_Request *request)
int dest, int tag, MPI_Comm comm, MPI_Request *request)
{
int rc;
if (dest == MPI_PROC_NULL) {
*request = &ompi_request_empty;
return MPI_SUCCESS;
}
if ( MPI_PARAM_CHECK ) {
rc = MPI_SUCCESS;
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
@ -61,6 +57,11 @@ int MPI_Bsend_init(void *buf, int count, MPI_Datatype type,
OMPI_ERRHANDLER_CHECK(rc, comm, rc, FUNC_NAME);
}
if (MPI_PROC_NULL == dest) {
*request = &ompi_request_empty;
return MPI_SUCCESS;
}
rc = MCA_PML_CALL(isend_init(buf,count,type,dest,tag,MCA_PML_BASE_SEND_BUFFERED,comm,request));
OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME);
}

Просмотреть файл

@ -5,7 +5,7 @@
* Copyright (c) 2004-2005 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* Copyright (c) 2004-2006 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
*
* Copyright (c) 2004-2005 The Regents of the University of California.
@ -43,7 +43,7 @@ int MPI_Cancel(MPI_Request *request)
if ( MPI_PARAM_CHECK ) {
rc = MPI_SUCCESS;
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
if (request == NULL) {
if (NULL == request) {
rc = MPI_ERR_REQUEST;
}
/* JMS: Tim will fix to invoke on the communicator/window/file
@ -52,7 +52,7 @@ int MPI_Cancel(MPI_Request *request)
OMPI_ERRHANDLER_CHECK(rc, MPI_COMM_WORLD, rc, "MPI_Cancel");
}
if (NULL == *request) {
if (MPI_REQUEST_NULL == *request) {
return MPI_SUCCESS;
}
rc = ompi_request_cancel(*request);

Просмотреть файл

@ -5,7 +5,7 @@
* Copyright (c) 2004-2005 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* Copyright (c) 2004-2006 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
@ -41,6 +41,7 @@ int MPI_Iprobe(int source, int tag, MPI_Comm comm, int *flag, MPI_Status *status
status->MPI_TAG = MPI_ANY_TAG;
status->MPI_ERROR = MPI_SUCCESS;
status->_count = 0;
status->_cancelled = 0;
}
return MPI_SUCCESS;
}

Просмотреть файл

@ -5,7 +5,7 @@
* Copyright (c) 2004-2005 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* Copyright (c) 2004-2006 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
@ -41,6 +41,7 @@ int MPI_Probe(int source, int tag, MPI_Comm comm, MPI_Status *status)
status->MPI_TAG = MPI_ANY_TAG;
status->MPI_ERROR = MPI_SUCCESS;
status->_count = 0;
status->_cancelled = 0;
}
return MPI_SUCCESS;
}

Просмотреть файл

@ -5,7 +5,7 @@
* Copyright (c) 2004-2005 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* Copyright (c) 2004-2006 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
@ -43,6 +43,7 @@ int MPI_Recv(void *buf, int count, MPI_Datatype type, int source,
status->MPI_TAG = MPI_ANY_TAG;
status->MPI_ERROR = MPI_SUCCESS;
status->_count = 0;
status->_cancelled = 0;
}
return MPI_SUCCESS;
}

Просмотреть файл

@ -5,7 +5,7 @@
* Copyright (c) 2004-2005 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* Copyright (c) 2004-2006 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
@ -77,10 +77,11 @@ int MPI_Sendrecv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
rc = ompi_request_wait(&req, status);
} else {
if (MPI_STATUS_IGNORE != status) {
status->MPI_ERROR = MPI_SUCCESS;
status->MPI_SOURCE = MPI_PROC_NULL;
status->MPI_TAG = MPI_ANY_TAG;
status->MPI_ERROR = MPI_SUCCESS;
status->_count = 0;
status->_cancelled = 0;
}
rc = MPI_SUCCESS;
}

Просмотреть файл

@ -5,7 +5,7 @@
* Copyright (c) 2004-2005 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* Copyright (c) 2004-2006 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
@ -33,7 +33,7 @@
static const char FUNC_NAME[] = "MPI_Wait";
int MPI_Wait(MPI_Request *request, MPI_Status *status)
int MPI_Wait(MPI_Request *request, MPI_Status *status)
{
int rc;
if ( MPI_PARAM_CHECK ) {
@ -45,12 +45,13 @@ int MPI_Wait(MPI_Request *request, MPI_Status *status)
OMPI_ERRHANDLER_CHECK(rc, MPI_COMM_WORLD, rc, FUNC_NAME);
}
if (NULL == *request) {
if (NULL != status) {
if (MPI_REQUEST_NULL == *request) {
if (MPI_STATUS_IGNORE != status) {
status->MPI_SOURCE = MPI_PROC_NULL;
status->MPI_TAG = MPI_ANY_TAG;
status->MPI_ERROR = MPI_SUCCESS;
status->_count = 0;
status->_cancelled = 0;
}
return MPI_SUCCESS;
}
@ -58,4 +59,3 @@ int MPI_Wait(MPI_Request *request, MPI_Status *status)
rc = ompi_request_wait(request, status);
OMPI_ERRHANDLER_RETURN(rc, MPI_COMM_WORLD, rc, FUNC_NAME);
}