@@ -48,8 +48,8 @@ AC_DEFUN(
48
48
# include <ompi/mca/osc/osc.h>
49
49
# include <ompi/mca/osc/monitoring/osc_monitoring_template.h>
50
50
51
- /*************************************** /
52
- /* Include template generating macros * /
51
+ /************************************************************ /
52
+ /* Include template generating macros and inlined functions * /
53
53
54
54
EOF
55
55
# Generate each case in order to register the proper template functions
59
59
done
60
60
cat << EOF >> $filename
61
61
62
- /*************************************** /
62
+ /************************************************************ /
63
63
64
- static inline int
65
- ompi_mca_osc_monitoring_set_template(ompi_osc_base_component_t * best_component,
66
- ompi_osc_base_module_t * module)
67
- {
68
- /* Sorry for the lack on indentation, but the portability won over the cleanliness * /
64
+ typedef struct {
65
+ const char * name;
66
+ ompi_osc_base_module_t * (* fct) (ompi_osc_base_module_t * );
67
+ } osc_monitoring_components_list_t;
68
+
69
+ static const osc_monitoring_components_list_t osc_monitoring_components_list[[]] = {
69
70
EOF
70
71
for comp in $components
71
72
do
72
- echo " if ( 0 == strcmp(\" ${comp} \" , best_component->osc_version.mca_component_name) ) {" >> $filename
73
- echo " OSC_MONITORING_SET_TEMPLATE_FCT_NAME(${comp} ) (module);" >> $filename
74
- echo " } else " >> $filename
73
+ echo " { .name = \" ${comp} \" , .fct = OSC_MONITORING_SET_TEMPLATE_FCT_NAME(${comp} ) }," >> $filename
75
74
done
76
75
cat << EOF >>$filename
77
- return OMPI_ERR_NOT_SUPPORTED;
78
- return OMPI_SUCCESS;
79
- }
76
+ { .name = NULL, .fct = NULL }
77
+ };
80
78
81
79
#endif /* MCA_OSC_MONITORING_GEN_TEMPLATE_H */
82
80
EOF
83
- unset filename components])
81
+ unset filename components
82
+ ])
84
83
])dnl
85
- ])dnl
84
+ ])dnl
86
85
87
86
# MCA_ompi_osc_monitoring_CONFIG()
88
87
# ------------------------------------------------
89
88
AC_DEFUN(
90
89
[MCA_ompi_osc_monitoring_CONFIG],
91
90
[AC_CONFIG_FILES([ompi/mca/osc/monitoring/Makefile])
92
-
91
+
93
92
AS_IF([test " $MCA_BUILD_ompi_common_monitoring_DSO_TRUE " = ' ' ],
94
93
[$1 ],
95
94
[$2 ])
0 commit comments