Skip to content

Commit 8400502

Browse files
authored
Merge pull request #6353 from bosilca/topic/fix_monitoring_pvar
Fix the PVAR allocation usage.
2 parents e57e18f + e42b573 commit 8400502

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

ompi/mca/common/monitoring/HowTo_pml_monitoring.tex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ \subsubsection{Monitoring Phases}
490490
int rank, size, n, to, from, tagno, MPIT_result, provided, count;
491491
MPI_T_pvar_session session;
492492
MPI_Status status;
493-
MPI_Comm newcomm;
493+
MPI_Comm comm = MPI_COMM_WORLD;
494494
MPI_Request request;
495495
char filename[1024];
496496
@@ -530,7 +530,7 @@ \subsubsection{Monitoring Phases}
530530
/* Allocating a new PVAR in a session will reset the counters */
531531
532532
MPIT_result = MPI_T_pvar_handle_alloc(session, flush_pvar_idx,
533-
MPI_COMM_WORLD,
533+
&comm,
534534
&flush_handle,
535535
&count);
536536
if (MPIT_result != MPI_SUCCESS) {
@@ -690,7 +690,7 @@ \subsubsection{Accessing Monitoring Performance Variables}
690690
691691
/* Allocating a new PVAR in a session will reset the counters */
692692
MPIT_result = MPI_T_pvar_handle_alloc(session, count_pvar_idx,
693-
MPI_COMM_WORLD, &count_handle, &count);
693+
&comm, &count_handle, &count);
694694
if (MPIT_result != MPI_SUCCESS) {
695695
printf("failed to allocate handle on \"%s\" pvar, check that you have monitoring pml\n",
696696
count_pvar_name);

test/monitoring/check_monitoring.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
static inline int pvar_prefix ## _init(MPI_T_pvar_session session) \
4444
{ \
4545
int MPIT_result; \
46+
MPI_Comm comm = MPI_COMM_WORLD; \
4647
/* Get index */ \
4748
MPIT_result = MPI_T_pvar_get_index(pvar_prefix ## _pvar_name, \
4849
pvar_class, \
@@ -57,7 +58,7 @@
5758
/* Allocating a new PVAR in a session will reset the counters */ \
5859
int count; \
5960
MPIT_result = MPI_T_pvar_handle_alloc(session, pvar_prefix ## _pvar_idx, \
60-
MPI_COMM_WORLD, &(pvar_prefix ## _handle), \
61+
&comm, &(pvar_prefix ## _handle), \
6162
&count); \
6263
if( MPI_SUCCESS != MPIT_result ) { \
6364
fprintf(stderr, "Failed to allocate handle on \"%s\" pvar, check that you have " \

test/monitoring/example_reduce_count.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ int main(int argc, char**argv)
2121
MPI_T_pvar_session session;
2222
MPI_Status status;
2323
MPI_Request request;
24+
MPI_Comm comm = MPI_COMM_WORLD;
2425
size_t*counts;
2526

2627
n = -1;
@@ -50,7 +51,7 @@ int main(int argc, char**argv)
5051

5152
/* Allocating a new PVAR in a session will reset the counters */
5253
MPIT_result = MPI_T_pvar_handle_alloc(session, count_pvar_idx,
53-
MPI_COMM_WORLD, &count_handle, &count);
54+
&comm, &count_handle, &count);
5455
if (MPIT_result != MPI_SUCCESS) {
5556
printf("failed to allocate handle on \"%s\" pvar, check that you have monitoring pml\n",
5657
count_pvar_name);

test/monitoring/monitoring_test.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ int main(int argc, char* argv[])
7878
int rank, size, n, to, from, tagno, MPIT_result, provided, count, world_rank;
7979
MPI_T_pvar_session session;
8080
MPI_Comm newcomm;
81+
MPI_Comm comm = MPI_COMM_WORLD;
8182
char filename[1024];
8283

8384
for ( int arg_it = 1; argc > 1 && arg_it < argc; ++arg_it ) {
@@ -120,7 +121,7 @@ int main(int argc, char* argv[])
120121

121122
/* Allocating a new PVAR in a session will reset the counters */
122123
MPIT_result = MPI_T_pvar_handle_alloc(session, flush_pvar_idx,
123-
MPI_COMM_WORLD, &flush_handle, &count);
124+
&comm, &flush_handle, &count);
124125
if (MPIT_result != MPI_SUCCESS) {
125126
printf("failed to allocate handle on \"%s\" pvar, check that you have monitoring pml\n",
126127
flush_pvar_name);

test/monitoring/test_pvar_access.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ int main(int argc, char* argv[])
6767
MPI_T_pvar_session session;
6868
MPI_Status status;
6969
MPI_Comm newcomm;
70+
MPI_Comm comm = MPI_COMM_WORLD;
7071
MPI_Request request;
7172
size_t*msg_count_p1, *msg_size_p1;
7273
size_t*msg_count_p2, *msg_size_p2;
@@ -110,14 +111,14 @@ int main(int argc, char* argv[])
110111

111112
/* Allocating a new PVAR in a session will reset the counters */
112113
MPIT_result = MPI_T_pvar_handle_alloc(session, count_pvar_idx,
113-
MPI_COMM_WORLD, &count_handle, &count);
114+
&comm, &count_handle, &count);
114115
if (MPIT_result != MPI_SUCCESS) {
115116
printf("failed to allocate handle on \"%s\" pvar, check that you have monitoring pml\n",
116117
count_pvar_name);
117118
MPI_Abort(MPI_COMM_WORLD, MPIT_result);
118119
}
119120
MPIT_result = MPI_T_pvar_handle_alloc(session, msize_pvar_idx,
120-
MPI_COMM_WORLD, &msize_handle, &count);
121+
&comm, &msize_handle, &count);
121122
if (MPIT_result != MPI_SUCCESS) {
122123
printf("failed to allocate handle on \"%s\" pvar, check that you have monitoring pml\n",
123124
msize_pvar_name);

0 commit comments

Comments
 (0)