Skip to content

Commit f8a02eb

Browse files
authored
Merge pull request #3793 from bosilca/topic/monitoring_install_fix
Topic/monitoring install fix
2 parents 702a535 + 64bff0e commit f8a02eb

File tree

13 files changed

+118
-34
lines changed

13 files changed

+118
-34
lines changed

configure.ac

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1420,11 +1420,8 @@ AC_CONFIG_FILES([
14201420
test/threads/Makefile
14211421
test/util/Makefile
14221422
])
1423+
14231424
m4_ifdef([project_ompi], [AC_CONFIG_FILES([test/monitoring/Makefile])])
1424-
m4_ifdef([project_ompi], [
1425-
m4_ifdef([MCA_BUILD_ompi_pml_monitoring_DSO_TRUE],
1426-
[AC_CONFIG_LINKS(test/monitoring/profile2mat.pl:test/monitoring/profile2mat.pl
1427-
test/monitoring/aggregate_profile.pl:test/monitoring/aggregate_profile.pl)])])
14281425
14291426
AC_CONFIG_FILES([contrib/dist/mofed/debian/rules],
14301427
[chmod +x contrib/dist/mofed/debian/rules])
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# -*- shell-script -*-
2+
#
3+
# Copyright (c) 2017 The University of Tennessee and The University
4+
# of Tennessee Research Foundation. All rights
5+
# reserved.
6+
# $COPYRIGHT$
7+
#
8+
# Additional copyrights may follow
9+
#
10+
# $HEADER$
11+
#
12+
13+
# MCA_ompi_coll_monitoring_CONFIG([action-if-can-compile],
14+
# [action-if-cant-compile])
15+
# ------------------------------------------------
16+
AC_DEFUN([MCA_ompi_coll_monitoring_CONFIG],[
17+
AC_CONFIG_FILES([ompi/mca/coll/monitoring/Makefile])
18+
19+
AS_IF([test MCA_BUILD_ompi_common_monitoring_DSO_TRUE == ''],
20+
[$1],
21+
[$2])
22+
])dnl
23+

ompi/mca/common/monitoring/Makefile.am

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#
2+
# Copyright (c) 2016 The University of Tennessee and The University
3+
# of Tennessee Research Foundation. All rights
4+
# reserved.
25
# Copyright (c) 2016 Inria. All rights reserved.
36
# Copyright (c) 2017 Research Organization for Information Science
47
# and Technology (RIST). All rights reserved.
@@ -9,6 +12,8 @@
912
# $HEADER$
1013
#
1114

15+
EXTRA_DIST = profile2mat.pl aggregate_profile.pl
16+
1217
sources = common_monitoring.c common_monitoring_coll.c
1318
headers = common_monitoring.h common_monitoring_coll.h
1419

@@ -19,6 +24,19 @@ component_noinst = libmca_common_monitoring_noinst.la
1924

2025
if MCA_BUILD_ompi_common_monitoring_DSO
2126
lib_LTLIBRARIES += $(component_install)
27+
lib_LTLIBRARIES += ompi_monitoring_prof.la
28+
29+
ompi_monitoring_prof_la_SOURCES = monitoring_prof.c
30+
ompi_monitoring_prof_la_LDFLAGS= \
31+
-module -avoid-version -shared $(WRAPPER_EXTRA_LDFLAGS)
32+
ompi_monitoring_prof_la_LIBADD = \
33+
$(top_builddir)/ompi/lib@[email protected] \
34+
$(top_builddir)/opal/lib@[email protected]
35+
36+
if OPAL_INSTALL_BINARIES
37+
bin_SCRIPTS = profile2mat.pl aggregate_profile.pl
38+
endif # OPAL_INSTALL_BINARIES
39+
2240
else
2341
noinst_LTLIBRARIES += $(component_noinst)
2442
endif

ompi/mca/common/monitoring/common_monitoring.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ typedef struct mca_monitoring_coll_data_t mca_monitoring_coll_data_t;
110110
OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_monitoring_coll_data_t);
111111

112112
OMPI_DECLSPEC mca_monitoring_coll_data_t*mca_common_monitoring_coll_new(ompi_communicator_t*comm);
113+
OMPI_DECLSPEC int mca_common_monitoring_coll_cache_name(ompi_communicator_t*comm);
113114
OMPI_DECLSPEC void mca_common_monitoring_coll_release(mca_monitoring_coll_data_t*data);
114115
OMPI_DECLSPEC void mca_common_monitoring_coll_o2a(size_t size, mca_monitoring_coll_data_t*data);
115116
OMPI_DECLSPEC void mca_common_monitoring_coll_a2o(size_t size, mca_monitoring_coll_data_t*data);

ompi/mca/common/monitoring/common_monitoring_coll.c

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,20 @@ struct mca_monitoring_coll_data_t {
4141
/* Collectives operation monitoring */
4242
static opal_hash_table_t *comm_data = NULL;
4343

44-
static inline void mca_common_monitoring_coll_cache(mca_monitoring_coll_data_t*data)
44+
int mca_common_monitoring_coll_cache_name(ompi_communicator_t*comm)
4545
{
46-
if( data->is_released ) {
47-
/* As long as the data struct is not released, we still have the communicator to
48-
immediately fetch the communicator's name */
49-
data->comm_name = strdup(data->p_comm->c_name);
46+
mca_monitoring_coll_data_t*data;
47+
int ret = opal_hash_table_get_value_uint64(comm_data, *((uint64_t*)&comm), (void*)&data);
48+
if( OPAL_SUCCESS == ret ) {
49+
data->comm_name = strdup(comm->c_name);
50+
data->p_comm = NULL;
5051
}
52+
return ret;
53+
}
54+
55+
static inline void mca_common_monitoring_coll_cache(mca_monitoring_coll_data_t*data)
56+
{
57+
int world_rank;
5158
if( -1 == data->world_rank ) {
5259
/* Get current process world_rank */
5360
mca_common_monitoring_get_world_rank(ompi_comm_rank(data->p_comm), data->p_comm,
@@ -160,9 +167,8 @@ void mca_common_monitoring_coll_flush(FILE *pf, mca_monitoring_coll_data_t*data)
160167
"O2A\t%" PRId32 "\t%zu bytes\t%zu msgs sent\n"
161168
"A2O\t%" PRId32 "\t%zu bytes\t%zu msgs sent\n"
162169
"A2A\t%" PRId32 "\t%zu bytes\t%zu msgs sent\n",
163-
data->p_comm ? data->p_comm->c_name
164-
: data->comm_name ? data->comm_name : "(no-name)",
165-
data->procs,
170+
data->comm_name ? data->comm_name : data->p_comm ?
171+
data->p_comm->c_name : "(no-name)", data->procs,
166172
data->world_rank, data->o2a_size, data->o2a_count,
167173
data->world_rank, data->a2o_size, data->a2o_count,
168174
data->world_rank, data->a2a_size, data->a2a_count);
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# -*- shell-script -*-
2+
#
3+
# Copyright (c) 2017 The University of Tennessee and The University
4+
# of Tennessee Research Foundation. All rights
5+
# reserved.
6+
# $COPYRIGHT$
7+
#
8+
# Additional copyrights may follow
9+
#
10+
# $HEADER$
11+
#
12+
13+
# MCA_ompi_common_monitoring_CONFIG([action-if-can-compile],
14+
# [action-if-cant-compile])
15+
# ------------------------------------------------
16+
AC_DEFUN([MCA_ompi_common_monitoring_CONFIG],[
17+
AC_CONFIG_FILES([ompi/mca/common/monitoring/Makefile])
18+
19+
m4_ifdef([project_ompi], [
20+
m4_ifdef([MCA_BUILD_ompi_common_monitoring_DSO_TRUE],
21+
[AC_CONFIG_LINKS(profile2mat.pl:test/monitoring/profile2mat.pl
22+
aggregate_profile.pl:test/monitoring/aggregate_profile.pl)])])
23+
24+
25+
AS_IF([test MCA_BUILD_ompi_common_monitoring_DSO_TRUE == ''],
26+
[$1],
27+
[$2])
28+
])dnl
File renamed without changes.
File renamed without changes.

ompi/mca/osc/monitoring/configure.m4

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@
1111
# MCA_ompi_osc_monitoring_CONFIG()
1212
# ------------------------------------------------
1313
AC_DEFUN([MCA_ompi_osc_monitoring_CONFIG],[
14-
AC_CONFIG_FILES([ompi/mca/osc/monitoring/Makefile])
14+
AC_CONFIG_FILES([ompi/mca/osc/monitoring/Makefile])
1515

16-
OPAL_CHECK_PORTALS4([osc_monitoring],
17-
[AC_DEFINE([OMPI_WITH_OSC_PORTALS4], [1], [Whether or not to generate template for osc_portals4])],
18-
[])
19-
])dnl
16+
AS_IF([test MCA_BUILD_ompi_common_monitoring_DSO_TRUE == ''],
17+
[$1],
18+
[$2])
19+
OPAL_CHECK_PORTALS4([osc_monitoring],
20+
[AC_DEFINE([OMPI_WITH_OSC_PORTALS4], [1], [Whether or not to generate template for osc_portals4])],
21+
[])
22+
])dnl

0 commit comments

Comments
 (0)