@@ -48,8 +48,8 @@ AC_DEFUN(
4848# include <ompi/mca/osc/osc.h>
4949# include <ompi/mca/osc/monitoring/osc_monitoring_template.h>
5050
51- /*************************************** /
52- /* Include template generating macros * /
51+ /************************************************************ /
52+ /* Include template generating macros and inlined functions * /
5353
5454EOF
5555 # Generate each case in order to register the proper template functions
5959 done
6060 cat << EOF >> $filename
6161
62- /*************************************** /
62+ /************************************************************ /
6363
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[[]] = {
6970EOF
7071 for comp in $components
7172 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
7574 done
7675 cat << EOF >>$filename
77- return OMPI_ERR_NOT_SUPPORTED;
78- return OMPI_SUCCESS;
79- }
76+ { .name = NULL, .fct = NULL }
77+ };
8078
8179#endif /* MCA_OSC_MONITORING_GEN_TEMPLATE_H */
8280EOF
83- unset filename components])
81+ unset filename components
82+ ])
8483 ])dnl
85- ])dnl
84+ ])dnl
8685
8786# MCA_ompi_osc_monitoring_CONFIG()
8887# ------------------------------------------------
8988AC_DEFUN(
9089 [MCA_ompi_osc_monitoring_CONFIG],
9190 [AC_CONFIG_FILES([ompi/mca/osc/monitoring/Makefile])
92-
91+
9392 AS_IF([test " $MCA_BUILD_ompi_common_monitoring_DSO_TRUE " = ' ' ],
9493 [$1 ],
9594 [$2 ])
0 commit comments