Skip to content

Commit 9f114c6

Browse files
authored
Merge pull request #8067 from devreal/fix-ob1-spc
PML OB1: Fix potential overcounting of SPC sent/received message sizes and account for fin messages
2 parents 9779813 + 1fdf05f commit 9f114c6

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

ompi/mca/pml/ob1/pml_ob1.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
#include "ompi/mca/bml/base/base.h"
4848
#include "opal/mca/pmix/pmix-internal.h"
4949
#include "ompi/runtime/ompi_cr.h"
50+
#include "ompi/runtime/ompi_spc.h"
5051

5152
#include "pml_ob1.h"
5253
#include "pml_ob1_component.h"
@@ -708,6 +709,7 @@ int mca_pml_ob1_send_fin( ompi_proc_t* proc,
708709
if( OPAL_LIKELY( 1 == rc ) ) {
709710
MCA_PML_OB1_PROGRESS_PENDING(bml_btl);
710711
}
712+
SPC_RECORD(OMPI_SPC_BYTES_SENT_MPI, (ompi_spc_value_t)sizeof(mca_pml_ob1_fin_hdr_t));
711713
return OMPI_SUCCESS;
712714
}
713715
mca_bml_base_free(bml_btl, fin);

ompi/mca/pml/ob1/pml_ob1_recvreq.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ int mca_pml_ob1_recv_request_ack_send_btl(
252252
des->des_cbfunc = mca_pml_ob1_recv_ctl_completion;
253253

254254
rc = mca_bml_base_send(bml_btl, des, MCA_PML_OB1_HDR_TYPE_ACK);
255-
SPC_RECORD(OMPI_SPC_BYTES_RECEIVED_MPI, (ompi_spc_value_t)size);
255+
SPC_RECORD(OMPI_SPC_BYTES_SENT_MPI, (ompi_spc_value_t)sizeof(mca_pml_ob1_ack_hdr_t));
256256
if( OPAL_LIKELY( rc >= 0 ) ) {
257257
return OMPI_SUCCESS;
258258
}
@@ -456,8 +456,8 @@ static int mca_pml_ob1_recv_request_put_frag (mca_pml_ob1_rdma_frag_t *frag)
456456

457457
/* send rdma request to peer */
458458
rc = mca_bml_base_send (bml_btl, ctl, MCA_PML_OB1_HDR_TYPE_PUT);
459-
/* Increment counter for bytes_put even though they probably haven't all been received yet */
460-
SPC_RECORD(OMPI_SPC_BYTES_PUT, (ompi_spc_value_t)frag->rdma_length);
459+
/* Increment counter for bytes sent by MPI */
460+
SPC_RECORD(OMPI_SPC_BYTES_SENT_MPI, (ompi_spc_value_t)(sizeof (mca_pml_ob1_rdma_hdr_t) + reg_size));
461461
if (OPAL_UNLIKELY(rc < 0)) {
462462
mca_bml_base_free (bml_btl, ctl);
463463
return rc;

0 commit comments

Comments
 (0)