From a9ed53aa66446e1a4d3d9fff701af82669365dcc Mon Sep 17 00:00:00 2001 From: Joseph Schuchart Date: Mon, 28 Sep 2020 15:19:29 +0200 Subject: [PATCH 1/2] pml/ob1: add SPC instrumentation of sent fin messages Signed-off-by: Joseph Schuchart --- ompi/mca/pml/ob1/pml_ob1.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ompi/mca/pml/ob1/pml_ob1.c b/ompi/mca/pml/ob1/pml_ob1.c index 0dcb0c7122..014cb82207 100644 --- a/ompi/mca/pml/ob1/pml_ob1.c +++ b/ompi/mca/pml/ob1/pml_ob1.c @@ -47,6 +47,7 @@ #include "ompi/mca/bml/base/base.h" #include "opal/mca/pmix/pmix-internal.h" #include "ompi/runtime/ompi_cr.h" +#include "ompi/runtime/ompi_spc.h" #include "pml_ob1.h" #include "pml_ob1_component.h" @@ -708,6 +709,7 @@ int mca_pml_ob1_send_fin( ompi_proc_t* proc, if( OPAL_LIKELY( 1 == rc ) ) { MCA_PML_OB1_PROGRESS_PENDING(bml_btl); } + SPC_RECORD(OMPI_SPC_BYTES_SENT_MPI, (ompi_spc_value_t)sizeof(mca_pml_ob1_fin_hdr_t)); return OMPI_SUCCESS; } mca_bml_base_free(bml_btl, fin); From 1fdf05f6343729809fc0aae9adbdd68ac2c1209d Mon Sep 17 00:00:00 2001 From: Joseph Schuchart Date: Mon, 28 Sep 2020 15:38:47 +0200 Subject: [PATCH 2/2] pml/ob1: fix SPC potential over-counting when sending ack and requesting put mca_pml_ob1_recv_request_put_frag is used to request a put from the peer if get fails mca_pml_ob1_recv_request_ack_send_btl is used to send an acknowledgement, not data Signed-off-by: Joseph Schuchart --- ompi/mca/pml/ob1/pml_ob1_recvreq.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ompi/mca/pml/ob1/pml_ob1_recvreq.c b/ompi/mca/pml/ob1/pml_ob1_recvreq.c index 6bef26a387..4a4a6d5276 100644 --- a/ompi/mca/pml/ob1/pml_ob1_recvreq.c +++ b/ompi/mca/pml/ob1/pml_ob1_recvreq.c @@ -252,7 +252,7 @@ int mca_pml_ob1_recv_request_ack_send_btl( des->des_cbfunc = mca_pml_ob1_recv_ctl_completion; rc = mca_bml_base_send(bml_btl, des, MCA_PML_OB1_HDR_TYPE_ACK); - SPC_RECORD(OMPI_SPC_BYTES_RECEIVED_MPI, (ompi_spc_value_t)size); + SPC_RECORD(OMPI_SPC_BYTES_SENT_MPI, (ompi_spc_value_t)sizeof(mca_pml_ob1_ack_hdr_t)); if( OPAL_LIKELY( rc >= 0 ) ) { return OMPI_SUCCESS; } @@ -456,8 +456,8 @@ static int mca_pml_ob1_recv_request_put_frag (mca_pml_ob1_rdma_frag_t *frag) /* send rdma request to peer */ rc = mca_bml_base_send (bml_btl, ctl, MCA_PML_OB1_HDR_TYPE_PUT); - /* Increment counter for bytes_put even though they probably haven't all been received yet */ - SPC_RECORD(OMPI_SPC_BYTES_PUT, (ompi_spc_value_t)frag->rdma_length); + /* Increment counter for bytes sent by MPI */ + SPC_RECORD(OMPI_SPC_BYTES_SENT_MPI, (ompi_spc_value_t)(sizeof (mca_pml_ob1_rdma_hdr_t) + reg_size)); if (OPAL_UNLIKELY(rc < 0)) { mca_bml_base_free (bml_btl, ctl); return rc;