diff --git a/ompi/mca/pml/bfo/pml_bfo_start.c b/ompi/mca/pml/bfo/pml_bfo_start.c index f9c166d6a4..ed6b4897a6 100644 --- a/ompi/mca/pml/bfo/pml_bfo_start.c +++ b/ompi/mca/pml/bfo/pml_bfo_start.c @@ -11,6 +11,8 @@ * All rights reserved. * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -37,6 +39,20 @@ int mca_pml_bfo_start(size_t count, ompi_request_t** requests) if(NULL == pml_request) { continue; } + if (OMPI_REQUEST_NOOP == requests[i]->req_type) { + /** + * We deal with a MPI_PROC_NULL request. If the request is + * already active, return OMPI_ERR_REQUEST err. + * Otherwise, mark it active so we can correctly handle it in + * the wait*. + */ + if( OMPI_REQUEST_INACTIVE == requests[i]->req_state ) { + requests[i]->req_state = OMPI_REQUEST_ACTIVE; + continue; + } else { + return OMPI_ERR_REQUEST; + } + } if (OMPI_REQUEST_PML != requests[i]->req_type) { continue; } diff --git a/ompi/mca/pml/cm/pml_cm_start.c b/ompi/mca/pml/cm/pml_cm_start.c index b86891043d..85094de420 100644 --- a/ompi/mca/pml/cm/pml_cm_start.c +++ b/ompi/mca/pml/cm/pml_cm_start.c @@ -10,6 +10,8 @@ * Copyright (c) 2004-2006 The Regents of the University of California. * All rights reserved. * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2014 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -36,10 +38,24 @@ mca_pml_cm_start(size_t count, ompi_request_t** requests) for (i = 0 ; i < count ; i++) { mca_pml_cm_request_t *pml_request = (mca_pml_cm_request_t*)requests[i]; - if (OMPI_REQUEST_PML != requests[i]->req_type) { + if (NULL == pml_request) { continue; } - if (NULL == pml_request) { + if (OMPI_REQUEST_NOOP == requests[i]->req_type) { + /** + * We deal with a MPI_PROC_NULL request. If the request is + * already active, return OMPI_ERR_REQUEST err. + * Otherwise, mark it active so we can correctly handle it in + * the wait*. + */ + if( OMPI_REQUEST_INACTIVE == requests[i]->req_state ) { + requests[i]->req_state = OMPI_REQUEST_ACTIVE; + continue; + } else { + return OMPI_ERR_REQUEST; + } + } + if (OMPI_REQUEST_PML != requests[i]->req_type) { continue; } /* If the persistent request is currebtly active - obtain the diff --git a/ompi/mca/pml/ob1/pml_ob1_start.c b/ompi/mca/pml/ob1/pml_ob1_start.c index 2203a6b545..adc6f920fa 100644 --- a/ompi/mca/pml/ob1/pml_ob1_start.c +++ b/ompi/mca/pml/ob1/pml_ob1_start.c @@ -11,6 +11,8 @@ * All rights reserved. * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -37,6 +39,20 @@ int mca_pml_ob1_start(size_t count, ompi_request_t** requests) if(NULL == pml_request) { continue; } + if (OMPI_REQUEST_NOOP == requests[i]->req_type) { + /** + * We deal with a MPI_PROC_NULL request. If the request is + * already active, return OMPI_ERR_REQUEST err. + * Otherwise, mark it active so we can correctly handle it in + * the wait*. + */ + if( OMPI_REQUEST_INACTIVE == requests[i]->req_state ) { + requests[i]->req_state = OMPI_REQUEST_ACTIVE; + continue; + } else { + return OMPI_ERR_REQUEST; + } + } if (OMPI_REQUEST_PML != requests[i]->req_type) { continue; } diff --git a/ompi/mpi/c/start.c b/ompi/mpi/c/start.c index 34040d12ae..da78f79607 100644 --- a/ompi/mpi/c/start.c +++ b/ompi/mpi/c/start.c @@ -10,6 +10,8 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2014 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -65,6 +67,7 @@ int MPI_Start(MPI_Request *request) switch((*request)->req_type) { case OMPI_REQUEST_PML: + case OMPI_REQUEST_NOOP: OPAL_CR_ENTER_LIBRARY(); ret = MCA_PML_CALL(start(1, request)); @@ -72,6 +75,7 @@ int MPI_Start(MPI_Request *request) OPAL_CR_EXIT_LIBRARY(); return ret; +#if 0 case OMPI_REQUEST_NOOP: /** * We deal with a MPI_PROC_NULL request. If the request is @@ -83,6 +87,7 @@ int MPI_Start(MPI_Request *request) (*request)->req_state = OMPI_REQUEST_ACTIVE; return MPI_SUCCESS; } +#endif default: return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_REQUEST, FUNC_NAME);