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

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

DEFINITIONS

This source file includes following definitions.
  1. mca_pml_cm_send_request_free
  2. mca_pml_cm_send_request_completion
  3. mca_pml_cm_send_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_sendreq.h"
  23 
  24 
  25 /*
  26  * The free call mark the final stage in a request
  27  * life-cycle. Starting from this point the request is completed at
  28  * both PML and user level, and can be used for others p2p
  29  * communications. Therefore, in the case of the CM PML it should be
  30  * added to the free request list.
  31  */
  32 static int
  33 mca_pml_cm_send_request_free(struct ompi_request_t** request)
  34 {
  35     mca_pml_cm_send_request_t* sendreq = *(mca_pml_cm_send_request_t**)request;
  36     assert( false == sendreq->req_base.req_free_called );
  37 
  38     sendreq->req_base.req_free_called = true;
  39     if( true == sendreq->req_base.req_pml_complete ) {
  40         if( MCA_PML_CM_REQUEST_SEND_THIN == sendreq->req_base.req_pml_type ) {
  41             MCA_PML_CM_THIN_SEND_REQUEST_RETURN( ((mca_pml_cm_thin_send_request_t*)  sendreq) );
  42         } else {
  43             MCA_PML_CM_HVY_SEND_REQUEST_RETURN( ((mca_pml_cm_hvy_send_request_t*)  sendreq) );
  44         }
  45     }
  46 
  47     *request = MPI_REQUEST_NULL;
  48     return OMPI_SUCCESS;
  49 }
  50 
  51 void
  52 mca_pml_cm_send_request_completion(struct mca_mtl_request_t *mtl_request)
  53 {
  54     mca_pml_cm_send_request_t *base_request =
  55         (mca_pml_cm_send_request_t*) mtl_request->ompi_req;
  56     if( MCA_PML_CM_REQUEST_SEND_THIN == base_request->req_base.req_pml_type ) {
  57         MCA_PML_CM_THIN_SEND_REQUEST_PML_COMPLETE(((mca_pml_cm_thin_send_request_t*) base_request));
  58     } else {
  59         MCA_PML_CM_HVY_SEND_REQUEST_PML_COMPLETE(((mca_pml_cm_hvy_send_request_t*) base_request));
  60     }
  61 }
  62 
  63 static void mca_pml_cm_send_request_construct(mca_pml_cm_hvy_send_request_t* sendreq)
  64 {
  65     /* no need to reinit for every send -- never changes */
  66     sendreq->req_send.req_base.req_ompi.req_start = mca_pml_cm_start;
  67     sendreq->req_send.req_base.req_ompi.req_free = mca_pml_cm_send_request_free;
  68     sendreq->req_send.req_base.req_ompi.req_cancel = mca_pml_cm_cancel;
  69 }
  70 
  71 OBJ_CLASS_INSTANCE(mca_pml_cm_send_request_t,
  72                    mca_pml_cm_request_t,
  73                    NULL,
  74                    NULL);
  75 
  76 OBJ_CLASS_INSTANCE(mca_pml_cm_thin_send_request_t,
  77                    mca_pml_cm_send_request_t,
  78                    mca_pml_cm_send_request_construct,
  79                    NULL);
  80 
  81 OBJ_CLASS_INSTANCE(mca_pml_cm_hvy_send_request_t,
  82                    mca_pml_cm_send_request_t,
  83                    mca_pml_cm_send_request_construct,
  84                    NULL);
  85 

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