14
14
dnl $HEADER$
15
15
dnl
16
16
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 -----------------------------------------------------------
56
21
AC_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 ] )
87
23
] )
88
24
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 -----------------------------------------------------------
89
30
AC_DEFUN ( [ OPAL_SUMMARY_PRINT] ,[
90
- OPAL_VAR_SCOPE_PUSH([ opal_summary_section opal_summary_section_name] )
91
31
cat <<EOF
92
32
93
33
Open MPI configuration:
@@ -97,69 +37,60 @@ MPI Standard Version: $MPI_VERSION.$MPI_SUBVERSION
97
37
EOF
98
38
99
39
if test "$project_ompi_amc" = "true" ; then
100
- echo "Build MPI C bindings: yes"
40
+ echo "Build MPI C bindings: yes" >& AS_MESSAGE_FD
101
41
else
102
- echo "Build MPI C bindings: no"
42
+ echo "Build MPI C bindings: no" >& AS_MESSAGE_FD
103
43
fi
104
44
105
45
dnl Print out the bindings if we are building OMPI
106
46
if test "$project_ompi_amc" = "true" ; then
107
47
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
109
49
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
111
51
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
113
53
else
114
- echo "Build MPI Fortran bindings: no"
54
+ echo "Build MPI Fortran bindings: no" >& AS_MESSAGE_FD
115
55
fi
116
56
117
57
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
119
59
else
120
- echo "Build MPI Java bindings (experimental): no"
60
+ echo "Build MPI Java bindings (experimental): no" >& AS_MESSAGE_FD
121
61
fi
122
62
fi
123
63
124
64
if test "$project_oshmem_amc" = "true" ; then
125
- echo "Build Open SHMEM support: yes"
65
+ echo "Build Open SHMEM support: yes" >& AS_MESSAGE_FD
126
66
elif test -z "$project_oshmem_amc" ; then
127
- echo "Build Open SHMEM support: no"
67
+ echo "Build Open SHMEM support: no" >& AS_MESSAGE_FD
128
68
else
129
- echo "Build Open SHMEM support: $project_oshmem_amc"
69
+ echo "Build Open SHMEM support: $project_oshmem_amc" >& AS_MESSAGE_FD
130
70
fi
131
71
132
72
if test $WANT_DEBUG = 0 ; then
133
- echo "Debug build: no"
73
+ echo "Debug build: no" >& AS_MESSAGE_FD
134
74
else
135
- echo "Debug build: yes"
75
+ echo "Debug build: yes" >& AS_MESSAGE_FD
136
76
fi
137
77
138
78
if test ! -z $with_platform ; then
139
- echo "Platform file: $with_platform"
79
+ echo "Platform file: $with_platform" >& AS_MESSAGE_FD
140
80
else
141
- echo "Platform file: (none)"
81
+ echo "Platform file: (none)" >& AS_MESSAGE_FD
142
82
fi
143
83
144
- echo
84
+ echo " " >& AS_MESSAGE_FD
145
85
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
154
87
155
88
if test $WANT_DEBUG = 1 ; then
156
- cat <<EOF
89
+ cat >& AS_MESSAGE_FD <<EOF
157
90
*****************************************************************************
158
91
THIS IS A DEBUG BUILD! DO NOT USE THIS BUILD FOR PERFORMANCE MEASUREMENTS!
159
92
*****************************************************************************
160
93
161
94
EOF
162
95
fi
163
-
164
- OPAL_VAR_SCOPE_POP
165
96
] )
0 commit comments