Skip to content

Commit b980e33

Browse files
committed
usnic: add completion stats
This should probably not go to the v2.x branch, since it changes the output format of the usnic stats. Signed-off-by: Jeff Squyres <[email protected]>
1 parent 706f53b commit b980e33

File tree

3 files changed

+29
-3
lines changed

3 files changed

+29
-3
lines changed

opal/mca/btl/usnic/btl_usnic_component.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,6 +1159,8 @@ static int usnic_component_progress(void)
11591159
if (OPAL_LIKELY(OPAL_BTL_USNIC_SEG_RECV ==
11601160
rseg->rs_base.us_type)) {
11611161
opal_btl_usnic_recv_fast(module, rseg, channel);
1162+
++module->stats.num_seg_total_completions;
1163+
++module->stats.num_seg_recv_completions;
11621164
fastpath_ok = false; /* prevent starvation */
11631165
return 1;
11641166
} else {
@@ -1188,6 +1190,8 @@ static int usnic_handle_completion(
11881190
seg = (opal_btl_usnic_segment_t*)completion->op_context;
11891191
rseg = (opal_btl_usnic_recv_segment_t*)seg;
11901192

1193+
++module->stats.num_seg_total_completions;
1194+
11911195
/* Make the completion be Valgrind-defined */
11921196
opal_memchecker_base_mem_defined(seg, sizeof(*seg));
11931197

@@ -1198,26 +1202,30 @@ static int usnic_handle_completion(
11981202

11991203
/**** Send ACK completions ****/
12001204
case OPAL_BTL_USNIC_SEG_ACK:
1205+
++module->stats.num_seg_ack_completions;
12011206
opal_btl_usnic_ack_complete(module,
12021207
(opal_btl_usnic_ack_segment_t *)seg);
12031208
break;
12041209

12051210
/**** Send of frag segment completion (i.e., the MPI message's
12061211
one-and-only segment has completed sending) ****/
12071212
case OPAL_BTL_USNIC_SEG_FRAG:
1213+
++module->stats.num_seg_frag_completions;
12081214
opal_btl_usnic_frag_send_complete(module,
12091215
(opal_btl_usnic_frag_segment_t*)seg);
12101216
break;
12111217

12121218
/**** Send of chunk segment completion (i.e., part of a large MPI
12131219
message is done sending) ****/
12141220
case OPAL_BTL_USNIC_SEG_CHUNK:
1221+
++module->stats.num_seg_chunk_completions;
12151222
opal_btl_usnic_chunk_send_complete(module,
12161223
(opal_btl_usnic_chunk_segment_t*)seg);
12171224
break;
12181225

12191226
/**** Receive completions ****/
12201227
case OPAL_BTL_USNIC_SEG_RECV:
1228+
++module->stats.num_seg_recv_completions;
12211229
opal_btl_usnic_recv(module, rseg, channel);
12221230
break;
12231231

opal/mca/btl/usnic/btl_usnic_stats.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013-2016 Cisco Systems, Inc. All rights reserved.
2+
* Copyright (c) 2013-2017 Cisco Systems, Inc. All rights reserved.
33
* $COPYRIGHT$
44
*
55
* Additional copyrights may follow
@@ -60,6 +60,12 @@ static inline void usnic_stats_reset(opal_btl_usnic_module_t *module)
6060
module->stats.pml_module_sends =
6161
module->stats.pml_send_callbacks =
6262

63+
module->stats.num_seg_total_completions =
64+
module->stats.num_seg_ack_completions =
65+
module->stats.num_seg_frag_completions =
66+
module->stats.num_seg_chunk_completions =
67+
module->stats.num_seg_recv_completions =
68+
6369
0;
6470

6571
for (i=0; i<USNIC_NUM_CHANNELS; ++i) {
@@ -82,7 +88,7 @@ void opal_btl_usnic_print_stats(
8288
char tmp[128], str[2048];
8389

8490
/* The usuals */
85-
snprintf(str, sizeof(str), "%s:MCW:%3u, %s, ST(P+D)/F/C/R(T+F)/A:%8lu(%8u+%8u)/%8lu/%8lu/%4lu(%4lu+%4lu)/%8lu, RcvTot/Chk/F/C/L/H/D/BF/A:%8lu/%c%c/%8lu/%8lu/%4lu+%2lu/%4lu/%4lu/%6lu OA/DA %4lu/%4lu CRC:%4lu ",
91+
snprintf(str, sizeof(str), "%s:MCW:%3u, %s, ST(P+D)/F/C/R(T+F)/A:%8lu(%8u+%8u)/%8lu/%8lu/%4lu(%4lu+%4lu)/%8lu, RcvTot/Chk/F/C/L/H/D/BF/A:%8lu/%c%c/%8lu/%8lu/%4lu+%2lu/%4lu/%4lu/%6lu Comp:T(A/F/C/R) %8lu(%8lu/%8lu/%8lu/%8lu), OA/DA %4lu/%4lu CRC:%4lu ",
8692
prefix,
8793
opal_proc_local_get()->proc_name.vpid,
8894

@@ -118,6 +124,12 @@ void opal_btl_usnic_print_stats(
118124
module->stats.num_badfrag_recvs,
119125
module->stats.num_ack_recvs,
120126

127+
module->stats.num_seg_total_completions,
128+
module->stats.num_seg_ack_completions,
129+
module->stats.num_seg_frag_completions,
130+
module->stats.num_seg_chunk_completions,
131+
module->stats.num_seg_recv_completions,
132+
121133
module->stats.num_old_dup_acks,
122134
module->stats.num_dup_acks,
123135

opal/mca/btl/usnic/btl_usnic_stats.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013 Cisco Systems, Inc. All rights reserved.
2+
* Copyright (c) 2013-2017 Cisco Systems, Inc. All rights reserved.
33
* $COPYRIGHT$
44
*
55
* Additional copyrights may follow
@@ -56,6 +56,12 @@ typedef struct opal_btl_usnic_module_stats_t {
5656
uint64_t pml_module_sends;
5757
uint64_t pml_send_callbacks;
5858

59+
uint64_t num_seg_total_completions;
60+
uint64_t num_seg_ack_completions;
61+
uint64_t num_seg_frag_completions;
62+
uint64_t num_seg_chunk_completions;
63+
uint64_t num_seg_recv_completions;
64+
5965
opal_event_t timer_event;
6066
struct timeval timeout;
6167
} opal_btl_usnic_module_stats_t;

0 commit comments

Comments
 (0)