From 940dbff0fa69fbfd5c74d9534caa40026f632ba7 Mon Sep 17 00:00:00 2001 From: George Bosilca Date: Mon, 26 Jun 2006 20:08:33 +0000 Subject: [PATCH] Add a new PERUSE macro. This is for the CONTINUE event (the one we added to the standard). This macro allow us to specify the length of the fragment. Now we are able to know how the message is fragmented between the network devices or inside the communication protocol. This commit was SVN r10508. --- ompi/mca/pml/ob1/pml_ob1_recvreq.c | 8 ++++---- ompi/mca/pml/ob1/pml_ob1_recvreq.h | 5 +++-- ompi/mca/pml/ob1/pml_ob1_sendreq.c | 8 ++++---- ompi/peruse/peruse-internal.h | 19 +++++++++++++++++++ ompi/peruse/peruse.h | 2 +- 5 files changed, 31 insertions(+), 11 deletions(-) diff --git a/ompi/mca/pml/ob1/pml_ob1_recvreq.c b/ompi/mca/pml/ob1/pml_ob1_recvreq.c index 46405a3dac..3abc76fb4f 100644 --- a/ompi/mca/pml/ob1/pml_ob1_recvreq.c +++ b/ompi/mca/pml/ob1/pml_ob1_recvreq.c @@ -440,8 +440,8 @@ static void mca_pml_ob1_recv_request_rget( descriptor->des_cbdata = frag; descriptor->des_cbfunc = mca_pml_ob1_rget_completion; - PERUSE_TRACE_COMM_EVENT( PERUSE_COMM_REQ_XFER_CONTINUE, - &(recvreq->req_recv.req_base), PERUSE_RECV ); + PERUSE_TRACE_COMM_OMPI_EVENT( PERUSE_COMM_REQ_XFER_CONTINUE, + &(recvreq->req_recv.req_base), size, PERUSE_RECV ); /* queue up get request */ rc = mca_bml_base_get(bml_btl,descriptor); @@ -757,8 +757,8 @@ void mca_pml_ob1_recv_request_schedule(mca_pml_ob1_recv_request_t* recvreq) recvreq->req_rdma_offset += size; OPAL_THREAD_ADD_SIZE_T(&recvreq->req_pipeline_depth,1); - PERUSE_TRACE_COMM_EVENT( PERUSE_COMM_REQ_XFER_CONTINUE, - &(recvreq->req_recv.req_base), PERUSE_RECV ); + PERUSE_TRACE_COMM_OMPI_EVENT( PERUSE_COMM_REQ_XFER_CONTINUE, + &(recvreq->req_recv.req_base), size, PERUSE_RECV ); /* send rdma request to peer */ rc = mca_bml_base_send(bml_btl, ctl, MCA_BTL_TAG_PML); diff --git a/ompi/mca/pml/ob1/pml_ob1_recvreq.h b/ompi/mca/pml/ob1/pml_ob1_recvreq.h index 358bda77f8..262c2ea225 100644 --- a/ompi/mca/pml/ob1/pml_ob1_recvreq.h +++ b/ompi/mca/pml/ob1/pml_ob1_recvreq.h @@ -293,8 +293,9 @@ do { &max_data, \ &free_after); \ bytes_delivered = max_data; \ - PERUSE_TRACE_COMM_EVENT (PERUSE_COMM_REQ_XFER_CONTINUE, \ - &(recvreq->req_recv.req_base), PERUSE_RECV); \ + PERUSE_TRACE_COMM_OMPI_EVENT (PERUSE_COMM_REQ_XFER_CONTINUE, \ + &(recvreq->req_recv.req_base), max_data, \ + PERUSE_RECV); \ } else { \ bytes_delivered = 0; \ } \ diff --git a/ompi/mca/pml/ob1/pml_ob1_sendreq.c b/ompi/mca/pml/ob1/pml_ob1_sendreq.c index 78bb580b9d..0fbeeb31ed 100644 --- a/ompi/mca/pml/ob1/pml_ob1_sendreq.c +++ b/ompi/mca/pml/ob1/pml_ob1_sendreq.c @@ -899,8 +899,8 @@ int mca_pml_ob1_send_request_schedule(mca_pml_ob1_send_request_t* sendreq) */ #if OMPI_WANT_PERUSE if( 0 != sendreq->req_send_offset ) { - PERUSE_TRACE_COMM_EVENT( PERUSE_COMM_REQ_XFER_CONTINUE, - &(sendreq->req_send.req_base), PERUSE_SEND ); + PERUSE_TRACE_COMM_OMPI_EVENT( PERUSE_COMM_REQ_XFER_CONTINUE, + &(sendreq->req_send.req_base), size, PERUSE_SEND ); } #endif /* OMPI_WANT_PERUSE */ @@ -1153,8 +1153,8 @@ void mca_pml_ob1_send_request_put( des->des_cbfunc = mca_pml_ob1_put_completion; des->des_cbdata = frag; - PERUSE_TRACE_COMM_EVENT( PERUSE_COMM_REQ_XFER_CONTINUE, - &(sendreq->req_send.req_base), PERUSE_SEND ); + PERUSE_TRACE_COMM_OMPI_EVENT( PERUSE_COMM_REQ_XFER_CONTINUE, + &(sendreq->req_send.req_base), size, PERUSE_SEND ); if(OMPI_SUCCESS != (rc = mca_bml_base_put(bml_btl, des))) { if(rc == OMPI_ERR_OUT_OF_RESOURCE) { diff --git a/ompi/peruse/peruse-internal.h b/ompi/peruse/peruse-internal.h index 144fe2cac0..c633d0b135 100644 --- a/ompi/peruse/peruse-internal.h +++ b/ompi/peruse/peruse-internal.h @@ -83,6 +83,24 @@ do { } \ } while(0) +#define PERUSE_TRACE_COMM_OMPI_EVENT(event, base_req, size, op) \ +do { \ + if( NULL != (base_req)->req_comm->c_peruse_handles ) { \ + ompi_peruse_handle_t * _ptr = (base_req)->req_comm->c_peruse_handles[(event)]; \ + if (NULL != _ptr && _ptr->active) { \ + peruse_comm_spec_t _comm_spec; \ + _comm_spec.comm = (base_req)->req_comm; \ + _comm_spec.buf = (base_req)->req_addr; \ + _comm_spec.count = size; \ + _comm_spec.datatype = MPI_PACKED; \ + _comm_spec.peer = (base_req)->req_peer; \ + _comm_spec.tag = (base_req)->req_tag; \ + _comm_spec.operation = (op); \ + _ptr->fn(_ptr, (MPI_Aint)(base_req), &_comm_spec, _ptr->param); \ + } \ + } \ +} while(0) + #define PERUSE_TRACE_MSG_EVENT(event, comm_ptr, hdr_peer, hdr_tag, op) \ do { \ if( NULL != (comm_ptr)->c_peruse_handles ) { \ @@ -103,6 +121,7 @@ do { #else #define PERUSE_TRACE_COMM_EVENT(event, base_req, op) +#define PERUSE_TRACE_COMM_OMPI_EVENT(event, base_req, size, op) #define PERUSE_TRACE_MSG_EVENT(event, comm_ptr, hdr_peer, hdr_tag, op) #endif diff --git a/ompi/peruse/peruse.h b/ompi/peruse/peruse.h index ae9309f239..87303b9076 100644 --- a/ompi/peruse/peruse.h +++ b/ompi/peruse/peruse.h @@ -67,7 +67,7 @@ enum { /* Queue events*/ PERUSE_COMM_SEARCH_POSTED_Q_BEGIN, PERUSE_COMM_SEARCH_POSTED_Q_END, - PERUSE_COMM_SEARCH_UNEX_Q_BEGIN, /* XXX Devation from 1.11 */ + PERUSE_COMM_SEARCH_UNEX_Q_BEGIN, /* XXX Deviation from 1.11 */ PERUSE_COMM_SEARCH_UNEX_Q_END, /* Collective events */