1414dnl $HEADER$
1515dnl
1616
17- # OPAL_SUMMARY_ADD(section, topic, unused, result)
18- #
19- # queue a summary line in the given section of the form:
20- # topic: result
21- #
22- # section:topic lines are only added once; first to add wins.
23- # The key for uniqification is a shell-variable-ified representation
24- # of section followed by an underscore followed by a
25- # shell-variable-ified representation of line.
26- #
27- # There are no restrictions on the contents of section and topic; they
28- # can be variable references (although the use case for this is
29- # dubious) and they can contain most ASCII characters (escape
30- # characters excluded). Note that some care must be taken with the
31- # unique check and this liberal rule, as the unique check is after the
32- # string has been run through AS_TR_SH. Basically, any character that
33- # is not legal in a shell variable name will be turned into an
34- # underscore. So the strings "Section_foo" and "Section-foo" would be
35- # the same as far as the unique check is concerned.
36- #
37- # The input strings are evaluated during OPAL_SUMMARY_ADD, not during
38- # OPAL_SUMMARY_PRINT. This seems to meet the principle of least
39- # astonishment. A common pattern is to call
40- # OPAL_SUMMARY_ADD([Resource Type], [Component Name], [], [$results])
41- # and then unset $results to avoid namespace pollution. This will
42- # work properly with the current behavior, but would result in odd
43- # errors if we delayed evaluation.
44- #
45- # As a historical note, the third argument has never been used in
46- # OPAL_SUMMARY_ADD and its meaning is unclear. Preferred behavior is
47- # to leave it empty.
48- #
49- # As a final historical note, the initial version of SUMMARY_ADD was
50- # added with implementation of the callers having all of the section
51- # and topic headers double quoted. This was never necessary, and
52- # certainly is not with the current implementation. While harmless,
53- # it is not great practice to over-quote, so we recommend against
54- # doing so.
55- # -----------------------------------------------------------
17+ dnl OPAL_SUMMARY_ADD(section, topic, unused, result)
18+ dnl
19+ dnl Turn around and call OAC_SUMMARY_ADD
20+ dnl -----------------------------------------------------------
5621AC_DEFUN ( [ OPAL_SUMMARY_ADD] ,[
57- OPAL_VAR_SCOPE_PUSH([ opal_summary_line opal_summary_newline opal_summary_key] )
58-
59- # The end quote on the next line is intentional!
60- opal_summary_newline="
61- "
62- opal_summary_line="$2 : $4 "
63- opal_summary_key="AS_TR_SH ( [ $1 ] ) _AS_TR_SH([ $2 ] )"
64-
65- # Use the section name variable as an indicator for whether or not
66- # the section has already been created.
67- AS_IF ( [ AS_VAR_TEST_SET ( [ opal_summary_section_] AS_TR_SH ( [ $1 ] ) [ _name] ) ] ,
68- [ ] ,
69- [ AS_VAR_SET ( [ opal_summary_section_] AS_TR_SH ( [ $1 ] ) [ _name] , [ "$1 "] )
70- OPAL_APPEND([ opal_summary_sections] , [ AS_TR_SH ( [ $1 ] ) ] )] )
71-
72- # Use the summary key as indicator if the section:topic has already
73- # been added to the results for the given section.
74- AS_IF ( [ AS_VAR_TEST_SET ( [ ${opal_summary_key}] ) ] ,
75- [ ] ,
76- [ AS_VAR_SET ( [ ${opal_summary_key}] , [ 1] )
77- dnl this is a bit overcomplicated, but we are basically implementing
78- dnl a poor mans AS_VAR_APPEND with the ability to specify a separator,
79- dnl because we have a newline separator in the string.
80- AS_IF ( [ AS_VAR_TEST_SET ( [ opal_summary_section_] AS_TR_SH ( [ $1 ] ) [ _value] ) ] ,
81- [ AS_VAR_APPEND ( [ opal_summary_section_] AS_TR_SH ( [ $1 ] ) [ _value] ,
82- [ "${opal_summary_newline}${opal_summary_line}"] ) ] ,
83- [ AS_VAR_SET ( [ opal_summary_section_] AS_TR_SH ( [ $1 ] ) [ _value] ,
84- [ "${opal_summary_line}"] ) ] ) ] )
85-
86- OPAL_VAR_SCOPE_POP
22+ OAC_SUMMARY_ADD([ $1 ] , [ $2 ] , [ $4 ] )
8723] )
8824
25+ dnl OPAL_SUMMARY_PRINT
26+ dnl
27+ dnl Print a bunch of Open MPI summary configuration information and
28+ dnl then turn around and call OAC_SUMMARY_PRINT.
29+ dnl -----------------------------------------------------------
8930AC_DEFUN ( [ OPAL_SUMMARY_PRINT] ,[
90- OPAL_VAR_SCOPE_PUSH([ opal_summary_section opal_summary_section_name] )
9131 cat <<EOF
9232
9333Open MPI configuration:
@@ -97,69 +37,60 @@ MPI Standard Version: $MPI_VERSION.$MPI_SUBVERSION
9737EOF
9838
9939 if test "$project_ompi_amc" = "true" ; then
100- echo "Build MPI C bindings: yes"
40+ echo "Build MPI C bindings: yes" >& AS_MESSAGE_FD
10141 else
102- echo "Build MPI C bindings: no"
42+ echo "Build MPI C bindings: no" >& AS_MESSAGE_FD
10343 fi
10444
10545 dnl Print out the bindings if we are building OMPI
10646 if test "$project_ompi_amc" = "true" ; then
10747 if test $OMPI_BUILD_FORTRAN_BINDINGS = $OMPI_FORTRAN_MPIFH_BINDINGS ; then
108- echo "Build MPI Fortran bindings: mpif.h"
48+ echo "Build MPI Fortran bindings: mpif.h" >& AS_MESSAGE_FD
10949 elif test $OMPI_BUILD_FORTRAN_BINDINGS = $OMPI_FORTRAN_USEMPI_BINDINGS ; then
110- echo "Build MPI Fortran bindings: mpif.h, use mpi"
50+ echo "Build MPI Fortran bindings: mpif.h, use mpi" >& AS_MESSAGE_FD
11151 elif test $OMPI_BUILD_FORTRAN_BINDINGS = $OMPI_FORTRAN_USEMPIF08_BINDINGS ; then
112- echo "Build MPI Fortran bindings: mpif.h, use mpi, use mpi_f08"
52+ echo "Build MPI Fortran bindings: mpif.h, use mpi, use mpi_f08" >& AS_MESSAGE_FD
11353 else
114- echo "Build MPI Fortran bindings: no"
54+ echo "Build MPI Fortran bindings: no" >& AS_MESSAGE_FD
11555 fi
11656
11757 if test $WANT_MPI_JAVA_BINDINGS -eq 1 ; then
118- echo "Build MPI Java bindings (experimental): yes"
58+ echo "Build MPI Java bindings (experimental): yes" >& AS_MESSAGE_FD
11959 else
120- echo "Build MPI Java bindings (experimental): no"
60+ echo "Build MPI Java bindings (experimental): no" >& AS_MESSAGE_FD
12161 fi
12262 fi
12363
12464 if test "$project_oshmem_amc" = "true" ; then
125- echo "Build Open SHMEM support: yes"
65+ echo "Build Open SHMEM support: yes" >& AS_MESSAGE_FD
12666 elif test -z "$project_oshmem_amc" ; then
127- echo "Build Open SHMEM support: no"
67+ echo "Build Open SHMEM support: no" >& AS_MESSAGE_FD
12868 else
129- echo "Build Open SHMEM support: $project_oshmem_amc"
69+ echo "Build Open SHMEM support: $project_oshmem_amc" >& AS_MESSAGE_FD
13070 fi
13171
13272 if test $WANT_DEBUG = 0 ; then
133- echo "Debug build: no"
73+ echo "Debug build: no" >& AS_MESSAGE_FD
13474 else
135- echo "Debug build: yes"
75+ echo "Debug build: yes" >& AS_MESSAGE_FD
13676 fi
13777
13878 if test ! -z $with_platform ; then
139- echo "Platform file: $with_platform"
79+ echo "Platform file: $with_platform" >& AS_MESSAGE_FD
14080 else
141- echo "Platform file: (none)"
81+ echo "Platform file: (none)" >& AS_MESSAGE_FD
14282 fi
14383
144- echo
84+ echo " " >& AS_MESSAGE_FD
14585
146- for opal_summary_section in ${opal_summary_sections} ; do
147- AS_VAR_COPY ( [ opal_summary_section_name] , [ opal_summary_section_${opal_summary_section}_name] )
148- AS_VAR_COPY ( [ opal_summary_section_value] , [ opal_summary_section_${opal_summary_section}_value] )
149- echo "${opal_summary_section_name}"
150- echo "-----------------------"
151- echo "${opal_summary_section_value}" | sort -f
152- echo " "
153- done
86+ OAC_SUMMARY_PRINT
15487
15588 if test $WANT_DEBUG = 1 ; then
156- cat <<EOF
89+ cat >& AS_MESSAGE_FD <<EOF
15790*****************************************************************************
15891 THIS IS A DEBUG BUILD! DO NOT USE THIS BUILD FOR PERFORMANCE MEASUREMENTS!
15992*****************************************************************************
16093
16194EOF
16295 fi
163-
164- OPAL_VAR_SCOPE_POP
16596] )
0 commit comments