This source file includes following definitions.
- mca_pml_ob1_iprobe
- mca_pml_ob1_probe
- mca_pml_ob1_improbe
- mca_pml_ob1_mprobe
   1 
   2 
   3 
   4 
   5 
   6 
   7 
   8 
   9 
  10 
  11 
  12 
  13 
  14 
  15 
  16 
  17 
  18 
  19 
  20 
  21 #include "ompi_config.h"
  22 #include "ompi/request/request.h"
  23 #include "ompi/message/message.h"
  24 #include "pml_ob1_recvreq.h"
  25 
  26 
  27 int mca_pml_ob1_iprobe(int src,
  28                        int tag,
  29                        struct ompi_communicator_t *comm,
  30                        int *matched, ompi_status_public_t * status)
  31 {
  32     int rc = OMPI_SUCCESS;
  33     mca_pml_ob1_recv_request_t recvreq;
  34 
  35     OBJ_CONSTRUCT( &recvreq, mca_pml_ob1_recv_request_t );
  36     recvreq.req_recv.req_base.req_ompi.req_type = OMPI_REQUEST_PML;
  37     recvreq.req_recv.req_base.req_type = MCA_PML_REQUEST_IPROBE;
  38 
  39     MCA_PML_OB1_RECV_REQUEST_INIT(&recvreq, NULL, 0, &ompi_mpi_char.dt, src, tag, comm, false);
  40     MCA_PML_OB1_RECV_REQUEST_START(&recvreq);
  41 
  42     if( REQUEST_COMPLETE( &(recvreq.req_recv.req_base.req_ompi)) ) {
  43         if( NULL != status ) {
  44             *status = recvreq.req_recv.req_base.req_ompi.req_status;
  45         }
  46         rc = recvreq.req_recv.req_base.req_ompi.req_status.MPI_ERROR;
  47         *matched = 1;
  48     } else {
  49         *matched = 0;
  50         opal_progress();
  51     }
  52     MCA_PML_BASE_RECV_REQUEST_FINI( &recvreq.req_recv );
  53     return rc;
  54 }
  55 
  56 
  57 int mca_pml_ob1_probe(int src,
  58                       int tag,
  59                       struct ompi_communicator_t *comm,
  60                       ompi_status_public_t * status)
  61 {
  62     int rc = OMPI_SUCCESS;
  63     mca_pml_ob1_recv_request_t recvreq;
  64 
  65     OBJ_CONSTRUCT( &recvreq, mca_pml_ob1_recv_request_t );
  66     recvreq.req_recv.req_base.req_ompi.req_type = OMPI_REQUEST_PML;
  67     recvreq.req_recv.req_base.req_type = MCA_PML_REQUEST_PROBE;
  68 
  69     MCA_PML_OB1_RECV_REQUEST_INIT(&recvreq, NULL, 0, &ompi_mpi_char.dt, src, tag, comm, false);
  70     MCA_PML_OB1_RECV_REQUEST_START(&recvreq);
  71 
  72     ompi_request_wait_completion(&recvreq.req_recv.req_base.req_ompi);
  73     rc = recvreq.req_recv.req_base.req_ompi.req_status.MPI_ERROR;
  74     if (NULL != status) {
  75         *status = recvreq.req_recv.req_base.req_ompi.req_status;
  76     }
  77 
  78     MCA_PML_BASE_RECV_REQUEST_FINI( &recvreq.req_recv );
  79     return rc;
  80 }
  81 
  82 
  83 int
  84 mca_pml_ob1_improbe(int src,
  85                     int tag,
  86                     struct ompi_communicator_t *comm,
  87                     int *matched,
  88                     struct ompi_message_t **message,
  89                     ompi_status_public_t * status)
  90 {
  91     int rc = OMPI_SUCCESS;
  92     mca_pml_ob1_recv_request_t *recvreq;
  93 
  94     *message = ompi_message_alloc();
  95     if (NULL == *message) return OMPI_ERR_TEMP_OUT_OF_RESOURCE;
  96 
  97     MCA_PML_OB1_RECV_REQUEST_ALLOC(recvreq);
  98     if (NULL == recvreq) {
  99         ompi_message_return(*message);
 100         return OMPI_ERR_TEMP_OUT_OF_RESOURCE;
 101     }
 102     recvreq->req_recv.req_base.req_type = MCA_PML_REQUEST_IMPROBE;
 103 
 104     
 105     MCA_PML_OB1_RECV_REQUEST_INIT(recvreq, NULL, 0, &ompi_mpi_char.dt,
 106                                   src, tag, comm, false);
 107     MCA_PML_OB1_RECV_REQUEST_START(recvreq);
 108 
 109     if( REQUEST_COMPLETE( &(recvreq->req_recv.req_base.req_ompi)) ) {
 110         if( NULL != status ) {
 111             *status = recvreq->req_recv.req_base.req_ompi.req_status;
 112         }
 113         *matched = 1;
 114 
 115         (*message)->comm = comm;
 116         (*message)->req_ptr = recvreq;
 117         (*message)->peer = recvreq->req_recv.req_base.req_ompi.req_status.MPI_SOURCE;
 118         (*message)->count = recvreq->req_recv.req_base.req_ompi.req_status._ucount;
 119 
 120         rc = recvreq->req_recv.req_base.req_ompi.req_status.MPI_ERROR;
 121     } else {
 122         *matched = 0;
 123 
 124         
 125 
 126 
 127         MCA_PML_OB1_RECV_REQUEST_RETURN( recvreq );
 128         ompi_message_return(*message);
 129         *message = MPI_MESSAGE_NULL;
 130 
 131         opal_progress();
 132     }
 133 
 134     return rc;
 135 }
 136 
 137 
 138 int
 139 mca_pml_ob1_mprobe(int src,
 140                    int tag,
 141                    struct ompi_communicator_t *comm,
 142                    struct ompi_message_t **message,
 143                    ompi_status_public_t * status)
 144 {
 145     int rc = OMPI_SUCCESS;
 146     mca_pml_ob1_recv_request_t *recvreq;
 147 
 148     *message = ompi_message_alloc();
 149     if (NULL == *message) return OMPI_ERR_TEMP_OUT_OF_RESOURCE;
 150 
 151     MCA_PML_OB1_RECV_REQUEST_ALLOC(recvreq);
 152     if (NULL == recvreq) {
 153         ompi_message_return(*message);
 154         return OMPI_ERR_TEMP_OUT_OF_RESOURCE;
 155     }
 156     recvreq->req_recv.req_base.req_type = MCA_PML_REQUEST_MPROBE;
 157 
 158     
 159     MCA_PML_OB1_RECV_REQUEST_INIT(recvreq, NULL, 0, &ompi_mpi_char.dt,
 160                                   src, tag, comm, false);
 161     MCA_PML_OB1_RECV_REQUEST_START(recvreq);
 162 
 163     ompi_request_wait_completion(&recvreq->req_recv.req_base.req_ompi);
 164     rc = recvreq->req_recv.req_base.req_ompi.req_status.MPI_ERROR;
 165 
 166     if( NULL != status ) {
 167         *status = recvreq->req_recv.req_base.req_ompi.req_status;
 168     }
 169 
 170     (*message)->comm = comm;
 171     (*message)->req_ptr = recvreq;
 172     (*message)->peer = recvreq->req_recv.req_base.req_ompi.req_status.MPI_SOURCE;
 173     (*message)->count = recvreq->req_recv.req_base.req_ompi.req_status._ucount;
 174 
 175     return rc;
 176 }