root/ompi/mca/pml/cm/pml_cm_recvreq.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. mca_pml_cm_recv_request_free
  2. mca_pml_cm_recv_request_completion
  3. mca_pml_cm_recv_request_construct

   1 /*
   2  * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
   3  *                         University Research and Technology
   4  *                         Corporation.  All rights reserved.
   5  * Copyright (c) 2004-2007 The University of Tennessee and The University
   6  *                         of Tennessee Research Foundation.  All rights
   7  *                         reserved.
   8  * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
   9  *                         University of Stuttgart.  All rights reserved.
  10  * Copyright (c) 2004-2006 The Regents of the University of California.
  11  *                         All rights reserved.
  12  * $COPYRIGHT$
  13  *
  14  * Additional copyrights may follow
  15  *
  16  * $HEADER$
  17  */
  18 
  19 #include "ompi_config.h"
  20 
  21 #include "pml_cm.h"
  22 #include "pml_cm_recvreq.h"
  23 
  24 static int
  25 mca_pml_cm_recv_request_free(struct ompi_request_t** request)
  26 {
  27     mca_pml_cm_request_t* recvreq = *(mca_pml_cm_request_t**)request;
  28 
  29     assert( false == recvreq->req_free_called );
  30 
  31     recvreq->req_free_called = true;
  32     if( true == recvreq->req_pml_complete ) {
  33         if( MCA_PML_CM_REQUEST_RECV_THIN == recvreq->req_pml_type ) {
  34             MCA_PML_CM_THIN_RECV_REQUEST_RETURN((mca_pml_cm_hvy_recv_request_t*)recvreq );
  35         } else {
  36             MCA_PML_CM_HVY_RECV_REQUEST_RETURN((mca_pml_cm_hvy_recv_request_t*)recvreq );
  37         }
  38     }
  39 
  40     *request = MPI_REQUEST_NULL;
  41     return OMPI_SUCCESS;
  42 }
  43 
  44 
  45 void mca_pml_cm_recv_request_completion(struct mca_mtl_request_t *mtl_request)
  46 {
  47     mca_pml_cm_request_t *base_request =
  48         (mca_pml_cm_request_t*) mtl_request->ompi_req;
  49     if( MCA_PML_CM_REQUEST_RECV_THIN == base_request->req_pml_type ) {
  50         MCA_PML_CM_THIN_RECV_REQUEST_PML_COMPLETE(((mca_pml_cm_thin_recv_request_t*)base_request));
  51     } else {
  52         MCA_PML_CM_HVY_RECV_REQUEST_PML_COMPLETE(((mca_pml_cm_hvy_recv_request_t*)base_request));
  53     }
  54 }
  55 
  56 static void
  57 mca_pml_cm_recv_request_construct(mca_pml_cm_thin_recv_request_t* recvreq)
  58 {
  59     recvreq->req_base.req_ompi.req_start = mca_pml_cm_start;
  60     recvreq->req_base.req_ompi.req_free = mca_pml_cm_recv_request_free;
  61     recvreq->req_base.req_ompi.req_cancel = mca_pml_cm_cancel;
  62     OBJ_CONSTRUCT( &(recvreq->req_base.req_convertor), opal_convertor_t );
  63 }
  64 
  65 
  66 OBJ_CLASS_INSTANCE(mca_pml_cm_thin_recv_request_t,
  67                    mca_pml_cm_request_t,
  68                    mca_pml_cm_recv_request_construct,
  69                    NULL);
  70 
  71 
  72 OBJ_CLASS_INSTANCE(mca_pml_cm_hvy_recv_request_t,
  73                    mca_pml_cm_request_t,
  74                    mca_pml_cm_recv_request_construct,
  75                    NULL);

/* [<][>][^][v][top][bottom][index][help] */