Skip to content

Commit a1ac81e

Browse files
committed
opal/util/show_help: slurp help text files into C code
Per discussion from https://github.com/open-mpi/ompi/wiki/Meeting-2025-03-14, we would like to make relocating an Open MPI installation easier. Specifically, text help files are something that Open MPI currently has to find in the install tree filesystem at run-time. If, instead, we can slurp these text files into C code, then there's nothing to find at run time. That being said, even with this change, developers will still maintain help messages in the various help_*.txt files around the code base. Maintaining descriptive, user-friendly help messages in text files (instead of manually hand-coding long strings in C) has proven to be quite useful. We do not want to lose this capability. This commit adds a step during "make" (in opal/util), those help_*.txt files are encoded into an indexed array of C strings in opal/util/show_help_content.c. opal_show_help*() then can look up the appropriate help strings via filename / topic tuples, just like it used to -- these strings now just happen to be in C variables instead of text files. This work is intended for main / v6.0.x -- not for v5.0.x. Signed-off-by: Jeff Squyres <jeff@squyres.com>
1 parent 13d0522 commit a1ac81e

File tree

57 files changed

+315
-447
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+315
-447
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ opal/tools/wrappers/opalCC-wrapper-data.txt
313313
opal/tools/wrappers/opal_wrapper
314314
opal/tools/wrappers/opal.pc
315315

316-
opal/util/show_help_lex.c
316+
opal/util/show_help_content.c
317317
opal/util/keyval/keyval_lex.c
318318

319319
test/monitoring/aggregate_profile.pl

ompi/Makefile.am

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
# Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
2222
# Copyright (c) 2021 Amazon.com, Inc. or its affiliates. All Rights
2323
# reserved.
24+
# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved.
2425
# $COPYRIGHT$
2526
#
2627
# Additional copyrights may follow
@@ -153,7 +154,7 @@ lib@OMPI_LIBMPI_NAME@_la_LDFLAGS = \
153154
headers =
154155
noinst_LTLIBRARIES =
155156
include_HEADERS =
156-
dist_ompidata_DATA =
157+
EXTRA_DIST =
157158
lib@OMPI_LIBMPI_NAME@_la_SOURCES += $(headers)
158159

159160
# Conditionally install the header files

ompi/communicator/Makefile.am

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# Copyright (c) 2014 Research Organization for Information Science
1616
# and Technology (RIST). All rights reserved.
1717
# Copyright (c) 2016 IBM Corporation. All rights reserved.
18+
# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved.
1819
# $COPYRIGHT$
1920
#
2021
# Additional copyrights may follow
@@ -39,4 +40,4 @@ lib@OMPI_LIBMPI_NAME@_la_SOURCES += \
3940
communicator/ft/comm_ft.c communicator/ft/comm_ft_reliable_bcast.c communicator/ft/comm_ft_propagator.c communicator/ft/comm_ft_detector.c communicator/ft/comm_ft_revoke.c
4041
endif # WANT_FT_MPI
4142

42-
dist_ompidata_DATA += communicator/help-comm.txt
43+
EXTRA_DIST += communicator/help-comm.txt

ompi/dpm/Makefile.am

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#
33
# Copyright (c) 2015-2020 Intel, Inc. All rights reserved.
44
# Copyright (c) 2016 IBM Corporation. All rights reserved.
5+
# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved.
56
# $COPYRIGHT$
67
#
78
# Additional copyrights may follow
@@ -11,11 +12,10 @@
1112

1213
# This makefile.am does not stand on its own - it is included from ompi/Makefile.am
1314

14-
dist_ompidata_DATA += dpm/help-dpm.txt
15+
EXTRA_DIST += dpm/help-dpm.txt
1516

1617
headers += \
1718
dpm/dpm.h
1819

1920
lib@OMPI_LIBMPI_NAME@_la_SOURCES += \
2021
dpm/dpm.c
21-

ompi/errhandler/Makefile.am

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# All rights reserved.
1313
# Copyright (c) 2008 Cisco Systems, Inc. All rights reserved.
1414
# Copyright (c) 2016 IBM Corporation. All rights reserved.
15+
# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved.
1516
# $COPYRIGHT$
1617
#
1718
# Additional copyrights may follow
@@ -21,7 +22,7 @@
2122

2223
# This makefile.am does not stand on its own - it is included from ompi/Makefile.am
2324

24-
dist_ompidata_DATA += errhandler/help-mpi-errors.txt
25+
EXTRA_DIST += errhandler/help-mpi-errors.txt
2526

2627
headers += \
2728
errhandler/errcode.h \

ompi/mca/bml/r2/Makefile.am

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
# All rights reserved.
1010
# Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
1111
# Copyright (c) 2017 IBM Corporation. All rights reserved.
12+
# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved.
1213
# $COPYRIGHT$
1314
#
1415
# Additional copyrights may follow
@@ -21,7 +22,7 @@ r2_sources = \
2122
bml_r2.h \
2223
bml_r2_component.c
2324

24-
dist_ompidata_DATA = help-mca-bml-r2.txt
25+
EXTRA_DIST = help-mca-bml-r2.txt
2526

2627
if MCA_BUILD_ompi_bml_r2_DSO
2728
component_noinst =

ompi/mca/coll/base/Makefile.am

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@
99
# University of Stuttgart. All rights reserved.
1010
# Copyright (c) 2004-2005 The Regents of the University of California.
1111
# All rights reserved.
12+
# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved.
1213
# $COPYRIGHT$
1314
#
1415
# Additional copyrights may follow
1516
#
1617
# $HEADER$
1718
#
1819

19-
dist_ompidata_DATA = base/help-mca-coll-base.txt
20+
EXTRA_DIST = base/help-mca-coll-base.txt
2021

2122
headers += \
2223
base/base.h \
@@ -51,4 +52,3 @@ if WANT_FT_MPI
5152
libmca_coll_la_SOURCES += \
5253
base/coll_base_agree_noft.c
5354
endif # WANT_FT_MPI
54-

ompi/mca/coll/xhc/Makefile.am

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
#
22
# Copyright (c) 2021-2024 Computer Architecture and VLSI Systems (CARV)
33
# Laboratory, ICS Forth. All rights reserved.
4+
# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved.
45
# $COPYRIGHT$
56
#
67
# Additional copyrights may follow
78
#
89
# $HEADER$
910
#
1011

11-
dist_opaldata_DATA = help-coll-xhc.txt
12+
EXTRA_DIST = help-coll-xhc.txt
1213

1314
sources = \
1415
coll_xhc.h \

ompi/mca/hook/base/Makefile.am

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
#
22
# Copyright (c) 2017 IBM Corporation. All rights reserved.
3+
# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved.
34
# $COPYRIGHT$
45
#
56
# Additional copyrights may follow
67
#
78
# $HEADER$
89
#
910

10-
dist_ompidata_DATA = base/help-mca-hook-base.txt
11+
EXTRA_DIST = base/help-mca-hook-base.txt
1112

1213
headers += \
1314
base/base.h

ompi/mca/mtl/ofi/Makefile.am

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# Copyright (c) 2020 Triad National Security, LLC. All rights
1111
# reserved.
1212
# Copyright (c) 2022 Amazon.com, Inc. or its affiliates. All Rights reserved.
13+
# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved.
1314
# $COPYRIGHT$
1415
#
1516
# Additional copyrights may follow
@@ -18,15 +19,14 @@
1819
#
1920

2021
EXTRA_DIST = post_configure.sh \
22+
help-mtl-ofi.txt \
2123
$(generated_source_modules)
2224

2325
MAINTAINERCLEANFILES = \
2426
$(generated_sources)
2527

2628
AM_CPPFLAGS = $(mtl_ofi_CPPFLAGS)
2729

28-
dist_ompidata_DATA = help-mtl-ofi.txt
29-
3030
generated_source_modules = \
3131
mtl_ofi_send_opt.pm \
3232
mtl_ofi_isend_opt.pm \

0 commit comments

Comments
 (0)