2005-05-24 02:06:50 +04:00
|
|
|
/*
|
2005-11-05 22:57:48 +03:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2005-05-24 02:06:50 +04:00
|
|
|
* Copyright (c) 2004-2005 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.
|
2010-08-04 23:36:40 +04:00
|
|
|
* Copyright (c) 2009-2010 Oracle and/or its affiliates. All rights reserved.
|
2005-05-24 02:06:50 +04:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "ompi_config.h"
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "ompi/request/request.h"
|
2005-05-24 02:06:50 +04:00
|
|
|
#include "pml_ob1_recvreq.h"
|
|
|
|
|
|
|
|
|
|
|
|
int mca_pml_ob1_iprobe(int src,
|
|
|
|
int tag,
|
|
|
|
struct ompi_communicator_t *comm,
|
|
|
|
int *matched, ompi_status_public_t * status)
|
|
|
|
{
|
2005-07-20 10:47:10 +04:00
|
|
|
int rc = OMPI_SUCCESS;
|
2005-05-24 02:06:50 +04:00
|
|
|
mca_pml_ob1_recv_request_t recvreq;
|
|
|
|
|
|
|
|
OBJ_CONSTRUCT( &recvreq, mca_pml_ob1_recv_request_t );
|
|
|
|
recvreq.req_recv.req_base.req_ompi.req_type = OMPI_REQUEST_PML;
|
|
|
|
recvreq.req_recv.req_base.req_type = MCA_PML_REQUEST_IPROBE;
|
|
|
|
|
2009-02-24 20:17:33 +03:00
|
|
|
MCA_PML_OB1_RECV_REQUEST_INIT(&recvreq, NULL, 0, &ompi_mpi_char.dt, src, tag, comm, true);
|
2005-05-24 02:22:20 +04:00
|
|
|
MCA_PML_OB1_RECV_REQUEST_START(&recvreq);
|
2005-05-24 02:06:50 +04:00
|
|
|
|
|
|
|
if( recvreq.req_recv.req_base.req_ompi.req_complete == true ) {
|
|
|
|
if( NULL != status ) {
|
2010-08-04 23:36:40 +04:00
|
|
|
OMPI_STATUS_SET(status, &recvreq.req_recv.req_base.req_ompi.req_status);
|
2005-05-24 02:06:50 +04:00
|
|
|
}
|
2011-03-22 16:29:29 +03:00
|
|
|
rc = recvreq.req_recv.req_base.req_ompi.req_status.MPI_ERROR;
|
2005-05-24 02:06:50 +04:00
|
|
|
*matched = 1;
|
|
|
|
} else {
|
|
|
|
*matched = 0;
|
2005-07-04 01:57:43 +04:00
|
|
|
opal_progress();
|
2005-05-24 02:06:50 +04:00
|
|
|
}
|
|
|
|
MCA_PML_BASE_RECV_REQUEST_FINI( &recvreq.req_recv );
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int mca_pml_ob1_probe(int src,
|
|
|
|
int tag,
|
|
|
|
struct ompi_communicator_t *comm,
|
|
|
|
ompi_status_public_t * status)
|
|
|
|
{
|
2011-03-22 16:29:29 +03:00
|
|
|
int rc = OMPI_SUCCESS;
|
2005-05-24 02:06:50 +04:00
|
|
|
mca_pml_ob1_recv_request_t recvreq;
|
|
|
|
|
|
|
|
OBJ_CONSTRUCT( &recvreq, mca_pml_ob1_recv_request_t );
|
|
|
|
recvreq.req_recv.req_base.req_ompi.req_type = OMPI_REQUEST_PML;
|
|
|
|
recvreq.req_recv.req_base.req_type = MCA_PML_REQUEST_PROBE;
|
|
|
|
|
2009-02-24 20:17:33 +03:00
|
|
|
MCA_PML_OB1_RECV_REQUEST_INIT(&recvreq, NULL, 0, &ompi_mpi_char.dt, src, tag, comm, true);
|
2005-05-24 02:22:20 +04:00
|
|
|
MCA_PML_OB1_RECV_REQUEST_START(&recvreq);
|
2005-05-24 02:06:50 +04:00
|
|
|
|
2007-10-18 16:33:21 +04:00
|
|
|
ompi_request_wait_completion(&recvreq.req_recv.req_base.req_ompi);
|
2011-03-22 16:29:29 +03:00
|
|
|
rc = recvreq.req_recv.req_base.req_ompi.req_status.MPI_ERROR;
|
2005-05-24 02:06:50 +04:00
|
|
|
if (NULL != status) {
|
2010-08-04 23:36:40 +04:00
|
|
|
OMPI_STATUS_SET(status, &recvreq.req_recv.req_base.req_ompi.req_status);
|
2005-05-24 02:06:50 +04:00
|
|
|
}
|
2011-03-22 16:29:29 +03:00
|
|
|
|
2005-05-24 02:06:50 +04:00
|
|
|
MCA_PML_BASE_RECV_REQUEST_FINI( &recvreq.req_recv );
|
2011-03-22 16:29:29 +03:00
|
|
|
return rc;
|
2005-05-24 02:06:50 +04:00
|
|
|
}
|