1
1

- Fix the return codes -- not OMPI, but MPI..

- Use the datatype-checks of bindings.h within recv.
   However, for the time being disable the check for overlapped,
   as it is not correctly set.

This commit was SVN r9298.
Этот коммит содержится в:
Rainer Keller 2006-03-16 09:42:46 +00:00
родитель a3e2d2442b
Коммит a8144cca8d
12 изменённых файлов: 48 добавлений и 72 удалений

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

@ -65,7 +65,7 @@ int MPI_Alltoall(void *sendbuf, int sendcount, MPI_Datatype sendtype,
we don't need to do anything */
if (0 == sendcount) {
return OMPI_SUCCESS;
return MPI_SUCCESS;
}
/* Invoke the coll component to perform the back-end operation */

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

@ -22,6 +22,7 @@
#include "ompi_config.h"
#include "mpi.h"
#include "ompi/communicator/communicator.h"
#include "ompi/datatype/datatype.h"
#if defined(c_plusplus) || defined(__cplusplus)
extern "C" {
@ -57,7 +58,7 @@ OMPI_DECLSPEC extern bool ompi_mpi_param_check;
if( NULL == (DDT) || MPI_DATATYPE_NULL == (DDT) ) (RC) = MPI_ERR_TYPE; \
else if( (COUNT) < 0 ) (RC) = MPI_ERR_COUNT; \
else if( !ompi_ddt_is_committed((DDT)) ) (RC) = MPI_ERR_TYPE; \
else if( ompi_ddt_is_overlapped((DDT)) ) (RC) = MPI_ERR_TYPE; \
/* XXX Fix flags else if( ompi_ddt_is_overlapped((DDT)) ) (RC) = MPI_ERR_TYPE; */ \
else if( !ompi_ddt_is_valid((DDT)) ) (RC) = MPI_ERR_TYPE; \
} while (0)

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

@ -144,9 +144,9 @@ static int ompi_socket_send (int fd, char *buf, int len )
#endif
else {
/* Another error occured */
fprintf (stderr,"read_socket: error while reading from socket"
fprintf (stderr,"ompi_socket_send: error while writing to socket"
" error:%s", strerror (errno) );
return ( OMPI_ERROR);
return MPI_ERR_OTHER;
}
}
num -= a;
@ -155,8 +155,8 @@ static int ompi_socket_send (int fd, char *buf, int len )
if ( num < 0 ) {
fprintf (stderr, "read_socket: more data read then available");
ret = OMPI_ERROR;
fprintf (stderr, "ompi_socket_send: more data written then available");
ret = MPI_ERR_INTERN;
}
return ret;
@ -168,7 +168,7 @@ static int ompi_socket_recv (int fd, char *buf, int len )
size_t s_num;
ssize_t a;
char *c_ptr;
int ret = OMPI_SUCCESS;
int ret = MPI_SUCCESS;
num = len;
c_ptr = buf;
@ -193,21 +193,19 @@ static int ompi_socket_recv (int fd, char *buf, int len )
#endif
else {
/* Another error occured */
fprintf (stderr,"read_socket: error while reading from socket"
fprintf (stderr,"ompi_socket_recv: error while reading from socket"
" error:%s", strerror (errno) );
return ( OMPI_ERROR);
return MPI_ERR_OTHER;
}
}
num -= a;
c_ptr += a;
} while ( num > 0 );
if ( num < 0 ) {
fprintf (stderr, "read_socket: more data read then available");
ret = OMPI_ERROR;
fprintf (stderr, "ompi_socket_recv: more data read then available");
ret = MPI_ERR_INTERN;
}
return ret;
}

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

@ -15,7 +15,6 @@
*
* $HEADER$
*/
#include "ompi_config.h"
#include "ompi/mpi/c/bindings.h"
@ -34,28 +33,24 @@ static const char FUNC_NAME[] = "MPI_Irecv";
int MPI_Irecv(void *buf, int count, MPI_Datatype type, int source,
int tag, MPI_Comm comm, MPI_Request *request)
int tag, MPI_Comm comm, MPI_Request *request)
{
int rc;
if (source == MPI_PROC_NULL) {
*request = &ompi_request_empty;
return OMPI_SUCCESS;
return MPI_SUCCESS;
}
if ( MPI_PARAM_CHECK ) {
rc = MPI_SUCCESS;
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
OMPI_CHECK_DATATYPE_FOR_RECV(rc, type, count);
if (ompi_comm_invalid(comm)) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, FUNC_NAME);
} else if (count < 0) {
rc = MPI_ERR_COUNT;
} else if (type == MPI_DATATYPE_NULL) {
rc = MPI_ERR_TYPE;
} else if (((tag < 0) && (tag != MPI_ANY_TAG)) || (tag > mca_pml.pml_max_tag)) {
rc = MPI_ERR_TAG;
} else if (source != MPI_ANY_SOURCE &&
source != MPI_PROC_NULL &&
ompi_comm_peer_invalid(comm, source)) {
} else if (source != MPI_ANY_SOURCE && ompi_comm_peer_invalid(comm, source)) {
rc = MPI_ERR_RANK;
}
OMPI_ERRHANDLER_CHECK(rc, comm, rc, FUNC_NAME);
@ -64,4 +59,3 @@ int MPI_Irecv(void *buf, int count, MPI_Datatype type, int source,
rc = MCA_PML_CALL(irecv(buf,count,type,source,tag,comm,request));
OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME);
}

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

@ -15,8 +15,8 @@
*
* $HEADER$
*/
#include "ompi_config.h"
#include <stdio.h>
#include "ompi/mpi/c/bindings.h"
#include "ompi/mca/pml/pml.h"
@ -36,8 +36,8 @@ int MPI_Recv(void *buf, int count, MPI_Datatype type, int source,
int tag, MPI_Comm comm, MPI_Status *status)
{
int rc;
if (source == MPI_PROC_NULL) {
if (status) {
if (MPI_PROC_NULL == source) {
if (MPI_STATUS_IGNORE != status) {
status->MPI_SOURCE = MPI_PROC_NULL;
status->MPI_TAG = MPI_ANY_TAG;
status->MPI_ERROR = MPI_SUCCESS;
@ -49,12 +49,10 @@ int MPI_Recv(void *buf, int count, MPI_Datatype type, int source,
if ( MPI_PARAM_CHECK ) {
rc = MPI_SUCCESS;
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
OMPI_CHECK_DATATYPE_FOR_RECV(rc, type, count);
if (ompi_comm_invalid(comm)) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, FUNC_NAME);
} else if (count < 0) {
rc = MPI_ERR_COUNT;
} else if (type == MPI_DATATYPE_NULL) {
rc = MPI_ERR_TYPE;
} else if (((tag < 0) && (tag != MPI_ANY_TAG)) || (tag > mca_pml.pml_max_tag)) {
rc = MPI_ERR_TAG;
} else if (source != MPI_ANY_SOURCE && ompi_comm_peer_invalid(comm, source)) {
@ -66,4 +64,3 @@ int MPI_Recv(void *buf, int count, MPI_Datatype type, int source,
rc = MCA_PML_CALL(recv(buf, count, type, source, tag, comm, status));
OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME);
}

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

@ -16,7 +16,6 @@
* $HEADER$
*/
#include "ompi_config.h"
#include <stdio.h>
#include "ompi/mpi/c/bindings.h"
#include "ompi/mca/pml/pml.h"
@ -34,7 +33,7 @@ static const char FUNC_NAME[] = "MPI_Recv_init";
int MPI_Recv_init(void *buf, int count, MPI_Datatype type, int source,
int tag, MPI_Comm comm, MPI_Request *request)
int tag, MPI_Comm comm, MPI_Request *request)
{
int rc;
if (source == MPI_PROC_NULL) {
@ -45,17 +44,13 @@ int MPI_Recv_init(void *buf, int count, MPI_Datatype type, int source,
if ( MPI_PARAM_CHECK ) {
rc = MPI_SUCCESS;
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
OMPI_CHECK_DATATYPE_FOR_RECV(rc, type, count);
if (ompi_comm_invalid(comm)) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, FUNC_NAME);
} else if (count < 0) {
rc = MPI_ERR_COUNT;
} else if (type == MPI_DATATYPE_NULL) {
rc = MPI_ERR_TYPE;
} else if (((tag < 0) && (tag != MPI_ANY_TAG)) || (tag > mca_pml.pml_max_tag)) {
rc = MPI_ERR_TAG;
} else if (source != MPI_ANY_SOURCE &&
source != MPI_PROC_NULL &&
ompi_comm_peer_invalid(comm, source)) {
} else if (source != MPI_ANY_SOURCE && ompi_comm_peer_invalid(comm, source)) {
rc = MPI_ERR_RANK;
}
OMPI_ERRHANDLER_CHECK(rc, comm, rc, FUNC_NAME);
@ -64,4 +59,3 @@ int MPI_Recv_init(void *buf, int count, MPI_Datatype type, int source,
rc = MCA_PML_CALL(irecv_init(buf,count,type,source,tag,comm,request));
OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME);
}

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

@ -36,16 +36,17 @@ static const char FUNC_NAME[] = "MPI_Request_free";
int MPI_Request_free(MPI_Request *request)
{
int rc;
if (MPI_PARAM_CHECK) {
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
if( request == NULL ) {
rc = OMPI_ERR_BAD_PARAM;
goto error_return;
}
}
rc = ompi_request_free(request);
error_return:
if (MPI_PARAM_CHECK) {
rc = MPI_SUCCESS;
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
if (NULL == request) {
rc = MPI_ERR_REQUEST;
}
OMPI_ERRHANDLER_CHECK(rc, MPI_COMM_WORLD, rc, FUNC_NAME);
}
rc = ompi_request_free(request);
OMPI_ERRHANDLER_RETURN(rc, MPI_COMM_WORLD, rc, FUNC_NAME);
}

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

@ -16,7 +16,6 @@
* $HEADER$
*/
#include "ompi_config.h"
#include <stdio.h>
#include "ompi/mpi/c/bindings.h"
#include "ompi/mca/pml/pml.h"
@ -36,7 +35,7 @@ static const char FUNC_NAME[] = "MPI_Sendrecv";
int MPI_Sendrecv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
int dest, int sendtag, void *recvbuf, int recvcount,
MPI_Datatype recvtype, int source, int recvtag,
MPI_Comm comm, MPI_Status *status)
MPI_Comm comm, MPI_Status *status)
{
ompi_request_t* req;
int rc;
@ -44,20 +43,15 @@ int MPI_Sendrecv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
if ( MPI_PARAM_CHECK ) {
rc = MPI_SUCCESS;
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
OMPI_CHECK_DATATYPE_FOR_SEND(rc, sendtype, sendcount);
OMPI_CHECK_DATATYPE_FOR_RECV(rc, recvtype, recvcount);
if (ompi_comm_invalid(comm)) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, FUNC_NAME);
} else if (sendcount < 0) {
rc = MPI_ERR_COUNT;
} else if (sendtype == MPI_DATATYPE_NULL) {
rc = MPI_ERR_TYPE;
} else if (dest != MPI_PROC_NULL && ompi_comm_peer_invalid(comm, dest)) {
rc = MPI_ERR_RANK;
} else if (sendtag < 0 || sendtag > mca_pml.pml_max_tag) {
rc = MPI_ERR_TAG;
} else if (recvcount < 0) {
rc = MPI_ERR_COUNT;
} else if (recvtype == MPI_DATATYPE_NULL) {
rc = MPI_ERR_TYPE;
} else if (source != MPI_PROC_NULL && source != MPI_ANY_SOURCE && ompi_comm_peer_invalid(comm, source)) {
rc = MPI_ERR_RANK;
} else if (((recvtag < 0) && (recvtag != MPI_ANY_TAG)) || (recvtag > mca_pml.pml_max_tag)) {

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

@ -16,7 +16,6 @@
* $HEADER$
*/
#include "ompi_config.h"
#include <stdio.h>
#include "ompi/mpi/c/bindings.h"
#include "ompi/datatype/datatype.h"
@ -37,19 +36,18 @@ static const char FUNC_NAME[] = "MPI_Sendrecv_replace";
int MPI_Sendrecv_replace(void * buf, int count, MPI_Datatype datatype,
int dest, int sendtag, int source, int recvtag,
MPI_Comm comm, MPI_Status *status)
MPI_Comm comm, MPI_Status *status)
{
int rc;
if ( MPI_PARAM_CHECK ) {
rc = MPI_SUCCESS;
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
OMPI_CHECK_DATATYPE_FOR_RECV(rc, datatype, count);
if (ompi_comm_invalid(comm)) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, FUNC_NAME);
} else if (count < 0) {
rc = MPI_ERR_COUNT;
} else if (datatype == MPI_DATATYPE_NULL) {
rc = MPI_ERR_TYPE;
} else if (dest != MPI_PROC_NULL && ompi_comm_peer_invalid(comm, dest)) {
rc = MPI_ERR_RANK;
} else if (sendtag < 0 || sendtag > mca_pml.pml_max_tag) {
@ -125,4 +123,3 @@ int MPI_Sendrecv_replace(void * buf, int count, MPI_Datatype datatype,
return MPI_SUCCESS;
}
}

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

@ -48,7 +48,7 @@ int MPI_Start(MPI_Request *request)
case OMPI_REQUEST_PML:
return MCA_PML_CALL(start(1, request));
default:
return OMPI_SUCCESS;
return MPI_SUCCESS;
}
}

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

@ -52,5 +52,5 @@ int MPI_Status_set_elements(MPI_Status *status, MPI_Datatype datatype,
ompi_ddt_type_size( datatype, &size );
status->_count = count * size;
}
return OMPI_SUCCESS;
return MPI_SUCCESS;
}

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

@ -38,7 +38,7 @@ static const char FUNC_NAME[] = "MPI_Win_create";
int MPI_Win_create(void *base, MPI_Aint size, int disp_unit,
MPI_Info info, MPI_Comm comm, MPI_Win *win)
{
int ret = OMPI_SUCCESS;
int ret = MPI_SUCCESS;
/* argument checking */
if (MPI_PARAM_CHECK) {
@ -70,5 +70,5 @@ int MPI_Win_create(void *base, MPI_Aint size, int disp_unit,
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_WIN, FUNC_NAME);
}
return OMPI_SUCCESS;
return MPI_SUCCESS;
}