Skip to content

Commit c8d73b9

Browse files
committed
Adding PVAR for backfill queue size
1 parent 7060882 commit c8d73b9

File tree

5 files changed

+14
-6
lines changed

5 files changed

+14
-6
lines changed

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
[submodule "Testing/driver/kwsys"]
22
path = Testing/driver/kwsys
33
url = https://github.com/mercury-hpc/kwsys.git
4-
[submodule "src/mchecksum"]
5-
path = src/mchecksum
6-
url = https://github.com/mercury-hpc/mchecksum.git
74
[submodule "src/boost"]
85
path = src/boost
96
url = https://github.com/mercury-hpc/preprocessor.git

src/mchecksum

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/mercury_core.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
#include "mercury_time.h"
2828
#include "mercury_error.h"
2929

30+
/* PVAR profiling support */
31+
#include "mercury_prof_pvar_impl.h"
32+
3033
#ifdef HG_HAS_SM_ROUTING
3134
#include <uuid/uuid.h>
3235
#endif
@@ -3153,9 +3156,13 @@ hg_core_trigger(struct hg_core_private_context *context, unsigned int timeout,
31533156
unsigned int count = 0;
31543157
hg_return_t ret = HG_SUCCESS;
31553158

3159+
HG_PROF_PVAR_UINT_COUNTER(hg_pvar_hg_backfill_queue_count);
31563160
while (count < max_count) {
31573161
struct hg_completion_entry *hg_completion_entry = NULL;
31583162

3163+
/* Set value of PVAR */
3164+
HG_PROF_PVAR_UINT_COUNTER_SET(hg_pvar_hg_backfill_queue_count, hg_atomic_get32(&context->backfill_queue_count));
3165+
31593166
hg_completion_entry =
31603167
hg_atomic_queue_pop_mc(context->completion_queue);
31613168
if (!hg_completion_entry) {

src/mercury_prof_pvar_impl.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ hg_prof_pvar_init() {
9999
/*Initialize internal PVAR data structures*/
100100
pvar_table = hg_hash_table_new(hg_prof_uint_hash, hg_prof_uint_equal);
101101
/* Register available PVARs */
102+
HG_PROF_PVAR_UINT_COUNTER_REGISTER(HG_UINT, HG_PROF_BIND_NO_OBJECT, hg_pvar_hg_backfill_queue_count, "Backfill queue size");
102103
HG_PROF_PVAR_UINT_COUNTER_REGISTER(HG_UINT, HG_PROF_BIND_NO_OBJECT, hg_pvar_hg_forward_count, "Number of times HG_Forward has been invoked");
103104
HG_PROF_PVAR_DOUBLE_COUNTER_REGISTER(HG_DOUBLE, HG_PROF_BIND_NO_OBJECT, hg_pvar_hg_input_serial_time, "Time taken to serialize input (s)");
104105
HG_PROF_PVAR_DOUBLE_COUNTER_REGISTER(HG_DOUBLE, HG_PROF_BIND_NO_OBJECT, hg_pvar_hg_input_deserial_time, "Time taken to de-serialize input (s)");

src/mercury_prof_pvar_impl.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ typedef struct hg_prof_pvar_data_t hg_prof_pvar_data_t;
3838
/* Public Macros */
3939
/*****************/
4040

41-
#define NUM_PVARS 5 /* Number of PVARs currently exported. PVAR indices go from 0......(NUM_PVARS - 1). */
41+
#define NUM_PVARS 6 /* Number of PVARs currently exported. PVAR indices go from 0......(NUM_PVARS - 1). */
4242

4343
/* PVAR handle declaration and registration macros */
4444
#define HG_PROF_PVAR_UINT_COUNTER(name) \
@@ -63,7 +63,7 @@ typedef struct hg_prof_pvar_data_t hg_prof_pvar_data_t;
6363
HG_PROF_PVAR_REGISTER_impl(HG_PVAR_CLASS_COUNTER, dtype, #name, \
6464
(void *)addr_##name, 1, bind, 1, desc);
6565

66-
/* Increment the value of a PVAR */
66+
/* Change the value of a PVAR */
6767
#define HG_PROF_PVAR_UINT_COUNTER_INC(name, val) \
6868
addr_##name = (addr_##name == NULL ? hg_prof_get_pvar_addr_from_name(#name): addr_##name); \
6969
for(int i=0; i < val; i++) \
@@ -73,6 +73,10 @@ typedef struct hg_prof_pvar_data_t hg_prof_pvar_data_t;
7373
addr_##name = (addr_##name == NULL ? hg_prof_get_pvar_addr_from_name(#name): addr_##name); \
7474
*(addr_##name) += val;
7575

76+
#define HG_PROF_PVAR_UINT_COUNTER_SET(name, val) \
77+
addr_##name = (addr_##name == NULL ? hg_prof_get_pvar_addr_from_name(#name): addr_##name); \
78+
hg_atomic_set32(addr_##name, val);
79+
7680
/**
7781
* Internal routine that gets invoked during Mercury's own initialization routine.
7882
* General routine for initializing the PVAR data structures and registering any PVARs that are not bound to a specific module.

0 commit comments

Comments
 (0)