From 1226d452bf8d51eaf2af693315fa61d14a828f0a Mon Sep 17 00:00:00 2001 From: George Bosilca Date: Fri, 31 Mar 2006 17:05:09 +0000 Subject: [PATCH] Add a base _START macro that will do the base initialization. Additinaly, that allow me to add the PERUSE event is a more homogeneous manner (all PML's will have them). This commit was SVN r9499. --- ompi/mca/pml/base/pml_base_recvreq.h | 25 ++++++++++++++++++++++++- ompi/mca/pml/base/pml_base_sendreq.h | 20 +++++++++++++++++++- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/ompi/mca/pml/base/pml_base_recvreq.h b/ompi/mca/pml/base/pml_base_recvreq.h index a6b3d9d3d3..d87cdb1bb5 100644 --- a/ompi/mca/pml/base/pml_base_recvreq.h +++ b/ompi/mca/pml/base/pml_base_recvreq.h @@ -2,7 +2,7 @@ * 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 + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -23,6 +23,7 @@ #include "ompi/mca/pml/base/pml_base_request.h" #include "ompi/datatype/convertor.h" +#include "ompi/peruse/peruse-internal.h" #if defined(c_plusplus) || defined(__cplusplus) extern "C" { @@ -78,7 +79,29 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_pml_base_recv_request_t); (request)->req_base.req_proc = NULL; \ (request)->req_base.req_pml_complete = (persistent ? true : false); \ (request)->req_base.req_free_called = false; \ + \ + PERUSE_TRACE_COMM_EVENT (PERUSE_COMM_REQ_ACTIVATE, \ + &((request)->req_base), \ + PERUSE_RECV); \ } +/** + * + * + */ +#define MCA_PML_BASE_RECV_START( request ) \ + do { \ + (request)->req_pml_complete = false; \ + (request)->req_ompi.req_complete = false; \ + (request)->req_ompi.req_state = OMPI_REQUEST_ACTIVE; \ + \ + /* always set the req_status.MPI_TAG to ANY_TAG before starting the \ + * request. This field is used if cancelled to find out if the request \ + * has been matched or not. \ + */ \ + (request)->req_ompi.req_status.MPI_TAG = OMPI_ANY_TAG; \ + (request)->req_ompi.req_status.MPI_ERROR = OMPI_SUCCESS; \ + (request)->req_ompi.req_status._cancelled = 0; \ + } while (0) /** * Return a receive request. Handle the release of the communicator and the diff --git a/ompi/mca/pml/base/pml_base_sendreq.h b/ompi/mca/pml/base/pml_base_sendreq.h index c6916bf67e..0867cd9b15 100644 --- a/ompi/mca/pml/base/pml_base_sendreq.h +++ b/ompi/mca/pml/base/pml_base_sendreq.h @@ -2,7 +2,7 @@ * 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 + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -26,6 +26,7 @@ #include "ompi/mca/pml/base/pml_base_request.h" #include "ompi/datatype/datatype.h" #include "ompi/datatype/convertor.h" +#include "ompi/peruse/peruse-internal.h" #if defined(c_plusplus) || defined(__cplusplus) extern "C" { @@ -112,8 +113,25 @@ typedef struct mca_pml_base_send_request_t mca_pml_base_send_request_t; } else { \ (request)->req_bytes_packed = 0; \ } \ + PERUSE_TRACE_COMM_EVENT (PERUSE_COMM_REQ_ACTIVATE, \ + &(request)->req_base, \ + PERUSE_SEND); \ } +/** + * Mark the request as started from the PML base point of view. + * + * @param request (IN) The send request. + */ + +#define MCA_PML_BASE_SEND_START( request ) \ + do { \ + (request)->req_pml_complete = false; \ + (request)->req_ompi.req_complete = false; \ + (request)->req_ompi.req_state = OMPI_REQUEST_ACTIVE; \ + (request)->req_ompi.req_status._cancelled = 0; \ + } while (0) + /** * Release the ref counts on the communicator and datatype. *