1
1

* followup to r10972... Even if MPI_PROC_NULL is given, we should do the

full argument checking (allowing that MPI_PROC_NULL is legal, of course).
  Only after the argument checking do we shortcut.  Fixes trac:237, which
  was caused by moving the MPI_PROC_NULL test in MPI_Bsend_init, 
  but not allowing for MPI_PROC_NULL when checking rank.

This commit was SVN r11108.

The following SVN revision numbers were found above:
  r10972 --> open-mpi/ompi@31c66d92aa

The following Trac tickets were found above:
  Ticket 237 --> https://svn.open-mpi.org/trac/ompi/ticket/237
Этот коммит содержится в:
Brian Barrett 2006-08-03 04:44:03 +00:00
родитель 2371c4fe4d
Коммит 65fedbe3be
20 изменённых файлов: 155 добавлений и 123 удалений

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

@ -43,8 +43,6 @@ int MPI_Accumulate(void *origin_addr, int origin_count, MPI_Datatype origin_data
int rc;
ompi_win_t *ompi_win = (ompi_win_t*) win;
if (target_rank == MPI_PROC_NULL) return MPI_SUCCESS;
if (MPI_PARAM_CHECK) {
rc = OMPI_SUCCESS;
@ -54,7 +52,8 @@ int MPI_Accumulate(void *origin_addr, int origin_count, MPI_Datatype origin_data
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_WIN, FUNC_NAME);
} else if (origin_count < 0 || target_count < 0) {
rc = MPI_ERR_COUNT;
} else if (ompi_win_peer_invalid(win, target_rank)) {
} else if (ompi_win_peer_invalid(win, target_rank) &&
(MPI_PROC_NULL != target_rank)) {
rc = MPI_ERR_RANK;
} else if (MPI_OP_NULL == op) {
rc = MPI_ERR_OP;
@ -118,6 +117,8 @@ int MPI_Accumulate(void *origin_addr, int origin_count, MPI_Datatype origin_data
}
}
if (MPI_PROC_NULL == target_rank) return MPI_SUCCESS;
rc = ompi_win->w_osc_module->osc_accumulate(origin_addr,
origin_count,
origin_datatype,

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

@ -36,10 +36,6 @@ static const char FUNC_NAME[] = "MPI_Bsend";
int MPI_Bsend(void *buf, int count, MPI_Datatype type, int dest, int tag, MPI_Comm comm)
{
int rc = MPI_SUCCESS;
if (dest == MPI_PROC_NULL) {
return MPI_SUCCESS;
}
if ( MPI_PARAM_CHECK ) {
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
@ -51,7 +47,8 @@ int MPI_Bsend(void *buf, int count, MPI_Datatype type, int dest, int tag, MPI_Co
rc = MPI_ERR_TYPE;
} else if (tag < 0 || tag > mca_pml.pml_max_tag) {
rc = MPI_ERR_TAG;
} else if (ompi_comm_peer_invalid(comm, dest)) {
} else if (ompi_comm_peer_invalid(comm, dest) &&
(MPI_PROC_NULL != dest)) {
rc = MPI_ERR_RANK;
} else {
OMPI_CHECK_DATATYPE_FOR_SEND(rc, type, count);
@ -60,6 +57,10 @@ int MPI_Bsend(void *buf, int count, MPI_Datatype type, int dest, int tag, MPI_Co
OMPI_ERRHANDLER_CHECK(rc, comm, rc, FUNC_NAME);
}
if (MPI_PROC_NULL == dest) {
return MPI_SUCCESS;
}
rc = MCA_PML_CALL(send(buf, count, type, dest, tag, MCA_PML_BASE_SEND_BUFFERED, comm));
OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME);
}

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

@ -49,7 +49,8 @@ int MPI_Bsend_init(void *buf, int count, MPI_Datatype type,
rc = MPI_ERR_TYPE;
} else if (tag < 0 || tag > mca_pml.pml_max_tag) {
rc = MPI_ERR_TAG;
} else if (ompi_comm_peer_invalid(comm, dest)) {
} else if (ompi_comm_peer_invalid(comm, dest) &&
(MPI_PROC_NULL != dest)) {
rc = MPI_ERR_RANK;
} else if (request == NULL) {
rc = MPI_ERR_REQUEST;

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

@ -40,7 +40,6 @@ int MPI_Get(void *origin_addr, int origin_count,
MPI_Datatype target_datatype, MPI_Win win)
{
int rc;
if (target_rank == MPI_PROC_NULL) return MPI_SUCCESS;
if (MPI_PARAM_CHECK) {
rc = OMPI_SUCCESS;
@ -51,7 +50,8 @@ int MPI_Get(void *origin_addr, int origin_count,
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_WIN, FUNC_NAME);
} else if (origin_count < 0 || target_count < 0) {
rc = MPI_ERR_COUNT;
} else if (ompi_win_peer_invalid(win, target_rank)) {
} else if (ompi_win_peer_invalid(win, target_rank) &&
(MPI_PROC_NULL != target_rank)) {
rc = MPI_ERR_RANK;
} else if (!ompi_win_comm_allowed(win)) {
rc = MPI_ERR_RMA_CONFLICT;
@ -61,6 +61,8 @@ int MPI_Get(void *origin_addr, int origin_count,
OMPI_ERRHANDLER_CHECK(rc, win, rc, FUNC_NAME);
}
if (MPI_PROC_NULL == target_rank) return MPI_SUCCESS;
rc = win->w_osc_module->osc_get(origin_addr, origin_count, origin_datatype,
target_rank, target_disp, target_count,
target_datatype, win);

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

@ -38,11 +38,6 @@ int MPI_Ibsend(void *buf, int count, MPI_Datatype type, int dest,
{
int rc = MPI_SUCCESS;
if (dest == MPI_PROC_NULL) {
*request = &ompi_request_empty;
return MPI_SUCCESS;
}
if ( MPI_PARAM_CHECK ) {
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
if (ompi_comm_invalid(comm)) {
@ -53,7 +48,8 @@ int MPI_Ibsend(void *buf, int count, MPI_Datatype type, int dest,
rc = MPI_ERR_TYPE;
} else if (tag < 0 || tag > mca_pml.pml_max_tag) {
rc = MPI_ERR_TAG;
} else if (ompi_comm_peer_invalid(comm, dest)) {
} else if (ompi_comm_peer_invalid(comm, dest) &&
(MPI_PROC_NULL != dest)) {
rc = MPI_ERR_RANK;
} else if (request == NULL) {
rc = MPI_ERR_REQUEST;
@ -64,6 +60,11 @@ int MPI_Ibsend(void *buf, int count, MPI_Datatype type, int dest,
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(buf, count, type, dest, tag, MCA_PML_BASE_SEND_BUFFERED, comm, request));
OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME);
}

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

@ -35,7 +35,23 @@ static const char FUNC_NAME[] = "MPI_Iprobe";
int MPI_Iprobe(int source, int tag, MPI_Comm comm, int *flag, MPI_Status *status)
{
int rc;
if (source == MPI_PROC_NULL) {
if ( MPI_PARAM_CHECK ) {
rc = MPI_SUCCESS;
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
if (((tag < 0) && (tag != MPI_ANY_TAG)) || (tag > mca_pml.pml_max_tag)) {
rc = MPI_ERR_TAG;
} else if (ompi_comm_invalid(comm)) {
rc = MPI_ERR_COMM;
} else if ((source != MPI_ANY_SOURCE) &&
(MPI_PROC_NULL != source) &&
ompi_comm_peer_invalid(comm, source)) {
rc = MPI_ERR_RANK;
}
OMPI_ERRHANDLER_CHECK(rc, comm, rc, FUNC_NAME);
}
if (MPI_PROC_NULL == source) {
if (status) {
status->MPI_SOURCE = MPI_PROC_NULL;
status->MPI_TAG = MPI_ANY_TAG;
@ -46,19 +62,6 @@ int MPI_Iprobe(int source, int tag, MPI_Comm comm, int *flag, MPI_Status *status
return MPI_SUCCESS;
}
if ( MPI_PARAM_CHECK ) {
rc = MPI_SUCCESS;
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
if (((tag < 0) && (tag != MPI_ANY_TAG)) || (tag > mca_pml.pml_max_tag)) {
rc = MPI_ERR_TAG;
} else if (ompi_comm_invalid(comm)) {
rc = MPI_ERR_COMM;
} else if (source != MPI_ANY_SOURCE && ompi_comm_peer_invalid(comm, source)) {
rc = MPI_ERR_RANK;
}
OMPI_ERRHANDLER_CHECK(rc, comm, rc, FUNC_NAME);
}
rc = MCA_PML_CALL(iprobe(source, tag, comm, flag, status));
OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME);
}

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

@ -37,11 +37,6 @@ int MPI_Irecv(void *buf, int count, MPI_Datatype type, int source,
{
int rc = MPI_SUCCESS;
if (source == MPI_PROC_NULL) {
*request = &ompi_request_empty;
return MPI_SUCCESS;
}
if ( MPI_PARAM_CHECK ) {
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
OMPI_CHECK_DATATYPE_FOR_RECV(rc, type, count);
@ -51,12 +46,19 @@ int MPI_Irecv(void *buf, int count, MPI_Datatype type, int source,
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, FUNC_NAME);
} 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)) {
} else if ((MPI_ANY_SOURCE != source) &&
(MPI_PROC_NULL != source) &&
ompi_comm_peer_invalid(comm, source)) {
rc = MPI_ERR_RANK;
}
OMPI_ERRHANDLER_CHECK(rc, comm, rc, FUNC_NAME);
}
if (source == MPI_PROC_NULL) {
*request = &ompi_request_empty;
return MPI_SUCCESS;
}
rc = MCA_PML_CALL(irecv(buf,count,type,source,tag,comm,request));
OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME);
}

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

@ -37,10 +37,6 @@ int MPI_Irsend(void *buf, int count, MPI_Datatype type, 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;
@ -53,7 +49,8 @@ int MPI_Irsend(void *buf, int count, MPI_Datatype type, int dest,
rc = MPI_ERR_TYPE;
} else if (tag < 0 || tag > mca_pml.pml_max_tag) {
rc = MPI_ERR_TAG;
} else if (ompi_comm_peer_invalid(comm, dest)) {
} else if (ompi_comm_peer_invalid(comm, dest) &&
(MPI_PROC_NULL != dest)) {
rc = MPI_ERR_RANK;
} else if (request == NULL) {
rc = MPI_ERR_REQUEST;
@ -61,6 +58,11 @@ int MPI_Irsend(void *buf, int count, MPI_Datatype type, int dest,
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(buf,count,type,dest,tag,
MCA_PML_BASE_SEND_READY,comm,request));
OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME);

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

@ -38,11 +38,6 @@ int MPI_Isend(void *buf, int count, MPI_Datatype type, int dest,
{
int rc = MPI_SUCCESS;
if (dest == MPI_PROC_NULL) {
*request = &ompi_request_empty;
return MPI_SUCCESS;
}
if ( MPI_PARAM_CHECK ) {
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
if (ompi_comm_invalid(comm)) {
@ -53,7 +48,8 @@ int MPI_Isend(void *buf, int count, MPI_Datatype type, int dest,
rc = MPI_ERR_TYPE;
} else if (tag < 0 || tag > mca_pml.pml_max_tag) {
rc = MPI_ERR_TAG;
} else if (ompi_comm_peer_invalid(comm, dest)) {
} else if (ompi_comm_peer_invalid(comm, dest) &&
(MPI_PROC_NULL != dest)) {
rc = MPI_ERR_RANK;
} else if (request == NULL) {
rc = MPI_ERR_REQUEST;
@ -64,6 +60,11 @@ int MPI_Isend(void *buf, int count, MPI_Datatype type, int dest,
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(buf,count,type,dest,tag,MCA_PML_BASE_SEND_STANDARD,comm,request));
OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME);
}

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

@ -38,11 +38,6 @@ int MPI_Issend(void *buf, int count, MPI_Datatype type, int dest,
{
int rc = MPI_SUCCESS;
if (dest == MPI_PROC_NULL) {
*request = &ompi_request_empty;
return MPI_SUCCESS;
}
if ( MPI_PARAM_CHECK ) {
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
if (ompi_comm_invalid(comm)) {
@ -53,7 +48,8 @@ int MPI_Issend(void *buf, int count, MPI_Datatype type, int dest,
rc = MPI_ERR_TYPE;
} else if (tag < 0 || tag > mca_pml.pml_max_tag) {
rc = MPI_ERR_TAG;
} else if (ompi_comm_peer_invalid(comm, dest)) {
} else if (ompi_comm_peer_invalid(comm, dest) &&
(MPI_PROC_NULL != dest)) {
rc = MPI_ERR_RANK;
} else if (request == NULL) {
rc = MPI_ERR_REQUEST;
@ -64,6 +60,11 @@ int MPI_Issend(void *buf, int count, MPI_Datatype type, int dest,
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(buf,count,type,dest,tag,
MCA_PML_BASE_SEND_SYNCHRONOUS,comm,request));
OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME);

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

@ -35,7 +35,23 @@ static const char FUNC_NAME[] = "MPI_Probe";
int MPI_Probe(int source, int tag, MPI_Comm comm, MPI_Status *status)
{
int rc;
if (source == MPI_PROC_NULL) {
if ( MPI_PARAM_CHECK ) {
rc = MPI_SUCCESS;
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
if (((tag < 0) && (tag != MPI_ANY_TAG)) || (tag > mca_pml.pml_max_tag)) {
rc = MPI_ERR_TAG;
} else if (ompi_comm_invalid(comm)) {
rc = MPI_ERR_COMM;
} else if ((source != MPI_ANY_SOURCE) &&
(MPI_PROC_NULL != source) &&
ompi_comm_peer_invalid(comm, source)) {
rc = MPI_ERR_RANK;
}
OMPI_ERRHANDLER_CHECK(rc, comm, rc, "MPI_Probe");
}
if (MPI_PROC_NULL == source) {
if (status) {
status->MPI_SOURCE = MPI_PROC_NULL;
status->MPI_TAG = MPI_ANY_TAG;
@ -46,19 +62,6 @@ int MPI_Probe(int source, int tag, MPI_Comm comm, MPI_Status *status)
return MPI_SUCCESS;
}
if ( MPI_PARAM_CHECK ) {
rc = MPI_SUCCESS;
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
if (((tag < 0) && (tag != MPI_ANY_TAG)) || (tag > mca_pml.pml_max_tag)) {
rc = MPI_ERR_TAG;
} else if (ompi_comm_invalid(comm)) {
rc = MPI_ERR_COMM;
} else if (source != MPI_ANY_SOURCE && ompi_comm_peer_invalid(comm, source)) {
rc = MPI_ERR_RANK;
}
OMPI_ERRHANDLER_CHECK(rc, comm, rc, "MPI_Probe");
}
rc = MCA_PML_CALL(probe(source, tag, comm, status));
OMPI_ERRHANDLER_RETURN(rc, comm, rc, "MPI_Probe");
}

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

@ -39,7 +39,6 @@ int MPI_Put(void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
MPI_Datatype target_datatype, MPI_Win win)
{
int rc;
if (target_rank == MPI_PROC_NULL) return MPI_SUCCESS;
if (MPI_PARAM_CHECK) {
rc = OMPI_SUCCESS;
@ -50,7 +49,8 @@ int MPI_Put(void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_WIN, FUNC_NAME);
} else if (origin_count < 0 || target_count < 0) {
rc = MPI_ERR_COUNT;
} else if (ompi_win_peer_invalid(win, target_rank)) {
} else if (ompi_win_peer_invalid(win, target_rank) &&
(MPI_PROC_NULL != target_rank)) {
rc = MPI_ERR_RANK;
} else if (!ompi_win_comm_allowed(win)) {
rc = MPI_ERR_RMA_CONFLICT;
@ -60,6 +60,8 @@ int MPI_Put(void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
OMPI_ERRHANDLER_CHECK(rc, win, rc, FUNC_NAME);
}
if (MPI_PROC_NULL == target_rank) return MPI_SUCCESS;
rc = win->w_osc_module->osc_put(origin_addr, origin_count, origin_datatype,
target_rank, target_disp, target_count,
target_datatype, win);

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

@ -37,6 +37,24 @@ int MPI_Recv(void *buf, int count, MPI_Datatype type, int source,
{
int rc = MPI_SUCCESS;
if ( MPI_PARAM_CHECK ) {
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
OMPI_CHECK_DATATYPE_FOR_RECV(rc, type, count);
OMPI_CHECK_USER_BUFFER(rc, buf, type, count);
if (ompi_comm_invalid(comm)) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, FUNC_NAME);
} else if (((tag < 0) && (tag != MPI_ANY_TAG)) || (tag > mca_pml.pml_max_tag)) {
rc = MPI_ERR_TAG;
} else if ((source != MPI_ANY_SOURCE) &&
(MPI_PROC_NULL != source) &&
ompi_comm_peer_invalid(comm, source)) {
rc = MPI_ERR_RANK;
}
OMPI_ERRHANDLER_CHECK(rc, comm, rc, FUNC_NAME);
}
if (MPI_PROC_NULL == source) {
if (MPI_STATUS_IGNORE != status) {
status->MPI_SOURCE = MPI_PROC_NULL;
@ -48,22 +66,6 @@ int MPI_Recv(void *buf, int count, MPI_Datatype type, int source,
return MPI_SUCCESS;
}
if ( MPI_PARAM_CHECK ) {
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
OMPI_CHECK_DATATYPE_FOR_RECV(rc, type, count);
OMPI_CHECK_USER_BUFFER(rc, buf, type, count);
if (ompi_comm_invalid(comm)) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, FUNC_NAME);
} 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)) {
rc = MPI_ERR_RANK;
}
OMPI_ERRHANDLER_CHECK(rc, comm, rc, FUNC_NAME);
}
rc = MCA_PML_CALL(recv(buf, count, type, source, tag, comm, status));
OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME);
}

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

@ -37,11 +37,6 @@ int MPI_Recv_init(void *buf, int count, MPI_Datatype type, int source,
{
int rc = MPI_SUCCESS;
if (source == MPI_PROC_NULL) {
*request = &ompi_request_empty;
return MPI_SUCCESS;
}
if ( MPI_PARAM_CHECK ) {
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
OMPI_CHECK_DATATYPE_FOR_RECV(rc, type, count);
@ -51,13 +46,20 @@ int MPI_Recv_init(void *buf, int count, MPI_Datatype type, int source,
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, FUNC_NAME);
} 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)) {
} else if ((source != MPI_ANY_SOURCE) &&
(MPI_PROC_NULL != source) &&
ompi_comm_peer_invalid(comm, source)) {
rc = MPI_ERR_RANK;
}
OMPI_ERRHANDLER_CHECK(rc, comm, rc, FUNC_NAME);
}
if (MPI_PROC_NULL == source) {
*request = &ompi_request_empty;
return MPI_SUCCESS;
}
rc = MCA_PML_CALL(irecv_init(buf,count,type,source,tag,comm,request));
OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME);
}

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

@ -37,10 +37,6 @@ int MPI_Rsend(void *buf, int count, MPI_Datatype type, int dest, int tag, MPI_Co
{
int rc = MPI_SUCCESS;
if (dest == MPI_PROC_NULL) {
return MPI_SUCCESS;
}
if ( MPI_PARAM_CHECK ) {
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
if (ompi_comm_invalid(comm)) {
@ -51,7 +47,8 @@ int MPI_Rsend(void *buf, int count, MPI_Datatype type, int dest, int tag, MPI_Co
rc = MPI_ERR_TYPE;
} else if (tag < 0 || tag > mca_pml.pml_max_tag) {
rc = MPI_ERR_TAG;
} else if (ompi_comm_peer_invalid(comm, dest)) {
} else if (ompi_comm_peer_invalid(comm, dest) &&
(MPI_PROC_NULL != dest)) {
rc = MPI_ERR_RANK;
} else {
OMPI_CHECK_DATATYPE_FOR_SEND(rc, type, count);
@ -60,6 +57,10 @@ int MPI_Rsend(void *buf, int count, MPI_Datatype type, int dest, int tag, MPI_Co
OMPI_ERRHANDLER_CHECK(rc, comm, rc, FUNC_NAME);
}
if (MPI_PROC_NULL == dest) {
return MPI_SUCCESS;
}
rc = MCA_PML_CALL(send(buf, count, type, dest, tag,
MCA_PML_BASE_SEND_READY, comm));
OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME);

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

@ -38,10 +38,6 @@ int MPI_Rsend_init(void *buf, int count, MPI_Datatype type,
MPI_Request *request)
{
int rc;
if (dest == MPI_PROC_NULL) {
*request = &ompi_request_empty;
return MPI_SUCCESS;
}
if ( MPI_PARAM_CHECK ) {
rc = MPI_SUCCESS;
@ -54,7 +50,8 @@ int MPI_Rsend_init(void *buf, int count, MPI_Datatype type,
rc = MPI_ERR_TYPE;
} else if (tag < 0 || tag > mca_pml.pml_max_tag) {
rc = MPI_ERR_TAG;
} else if (ompi_comm_peer_invalid(comm, dest)) {
} else if (ompi_comm_peer_invalid(comm, dest) &&
(MPI_PROC_NULL != dest)) {
rc = MPI_ERR_RANK;
} else if (request == NULL) {
rc = MPI_ERR_REQUEST;
@ -62,6 +59,11 @@ int MPI_Rsend_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_READY,comm,request));
OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME);

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

@ -38,10 +38,6 @@ int MPI_Send(void *buf, int count, MPI_Datatype type, int dest,
{
int rc = MPI_SUCCESS;
if (dest == MPI_PROC_NULL) {
return MPI_SUCCESS;
}
if ( MPI_PARAM_CHECK ) {
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
if (ompi_comm_invalid(comm)) {
@ -50,7 +46,8 @@ int MPI_Send(void *buf, int count, MPI_Datatype type, int dest,
rc = MPI_ERR_COUNT;
} else if (tag < 0 || tag > mca_pml.pml_max_tag) {
rc = MPI_ERR_TAG;
} else if (ompi_comm_peer_invalid(comm, dest)) {
} else if (ompi_comm_peer_invalid(comm, dest) &&
(MPI_PROC_NULL != dest)) {
rc = MPI_ERR_RANK;
} else {
OMPI_CHECK_DATATYPE_FOR_SEND(rc, type, count);
@ -59,6 +56,10 @@ int MPI_Send(void *buf, int count, MPI_Datatype type, int dest,
OMPI_ERRHANDLER_CHECK(rc, comm, rc, FUNC_NAME);
}
if (MPI_PROC_NULL == dest) {
return MPI_SUCCESS;
}
rc = MCA_PML_CALL(send(buf, count, type, dest, tag, MCA_PML_BASE_SEND_STANDARD, comm));
OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME);
}

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

@ -39,11 +39,6 @@ int MPI_Send_init(void *buf, int count, MPI_Datatype type,
{
int rc = MPI_SUCCESS;
if (dest == MPI_PROC_NULL) {
*request = &ompi_request_empty;
return MPI_SUCCESS;
}
if ( MPI_PARAM_CHECK ) {
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
if (ompi_comm_invalid(comm)) {
@ -54,7 +49,8 @@ int MPI_Send_init(void *buf, int count, MPI_Datatype type,
rc = MPI_ERR_TYPE;
} else if (tag < 0 || tag > mca_pml.pml_max_tag) {
rc = MPI_ERR_TAG;
} else if (ompi_comm_peer_invalid(comm, dest)) {
} else if (ompi_comm_peer_invalid(comm, dest) &&
(MPI_PROC_NULL != dest)) {
rc = MPI_ERR_RANK;
} else if (request == NULL) {
rc = MPI_ERR_REQUEST;
@ -65,6 +61,11 @@ int MPI_Send_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_STANDARD,comm,request));
OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME);
}

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

@ -36,10 +36,6 @@ int MPI_Ssend(void *buf, int count, MPI_Datatype type, int dest, int tag, MPI_Co
{
int rc = MPI_SUCCESS;
if (dest == MPI_PROC_NULL) {
return MPI_SUCCESS;
}
if ( MPI_PARAM_CHECK ) {
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
if (ompi_comm_invalid(comm)) {
@ -50,7 +46,8 @@ int MPI_Ssend(void *buf, int count, MPI_Datatype type, int dest, int tag, MPI_Co
rc = MPI_ERR_TYPE;
} else if (tag < 0 || tag > mca_pml.pml_max_tag) {
rc = MPI_ERR_TAG;
} else if (ompi_comm_peer_invalid(comm, dest)) {
} else if (ompi_comm_peer_invalid(comm, dest) &&
(MPI_PROC_NULL != dest)) {
rc = MPI_ERR_RANK;
} else {
OMPI_CHECK_DATATYPE_FOR_SEND(rc, type, count);
@ -59,6 +56,10 @@ int MPI_Ssend(void *buf, int count, MPI_Datatype type, int dest, int tag, MPI_Co
OMPI_ERRHANDLER_CHECK(rc, comm, rc, FUNC_NAME);
}
if (MPI_PROC_NULL == dest) {
return MPI_SUCCESS;
}
rc = MCA_PML_CALL(send(buf, count, type, dest, tag,
MCA_PML_BASE_SEND_SYNCHRONOUS, comm));
OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME);

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

@ -38,10 +38,6 @@ int MPI_Ssend_init(void *buf, int count, MPI_Datatype type,
MPI_Request *request)
{
int rc;
if (dest == MPI_PROC_NULL) {
*request = &ompi_request_empty;
return MPI_SUCCESS;
}
if ( MPI_PARAM_CHECK ) {
rc = MPI_SUCCESS;
@ -54,7 +50,8 @@ int MPI_Ssend_init(void *buf, int count, MPI_Datatype type,
rc = MPI_ERR_TYPE;
} else if (tag < 0 || tag > mca_pml.pml_max_tag) {
rc = MPI_ERR_TAG;
} else if (ompi_comm_peer_invalid(comm, dest)) {
} else if (ompi_comm_peer_invalid(comm, dest) &&
(MPI_PROC_NULL != dest)) {
rc = MPI_ERR_RANK;
} else if (request == NULL) {
rc = MPI_ERR_REQUEST;
@ -62,6 +59,11 @@ int MPI_Ssend_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_SYNCHRONOUS,comm,request));
OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME);