1- # -*- shell-script -*-
2- #
3- # Copyright (c) 2016 Inria. All rights reserved.
4- # $COPYRIGHT$
1+ dnl -* - shell-script -* -
2+ dnl
3+ dnl Copyright (c) 2016-2017 Inria. All rights reserved.
4+ dnl $COPYRIGHT $
5+ dnl
6+ dnl Additional copyrights may follow
7+ dnl
8+ dnl $HEADER $
9+ dnl
10+
11+ # mca_ompi_osc_monitoring_generate_templates
512#
6- # Additional copyrights may follow
13+ # Append to file $1 an array of components by listing component names in $2.
714#
8- # $HEADER$
15+ # $1 = filename
16+ # $2 = osc component names
917#
18+ AC_DEFUN([mca_ompi_osc_monitoring_generate_templates],[
19+ m4_ifval([$1 ], [
20+ AC_CONFIG_COMMANDS([$1 ],
21+ [filename= " $1 "
22+ components= ` echo " $2 " | sed -e ' s/,/ /g' -e ' s/monitoring//' `
23+ cat << EOF > $filename
24+ /* $filename
25+ *
26+ * This file was generated from ompi/mca/osc/monitoring/configure.m4
27+ *
28+ * DO NOT EDIT THIS FILE.
29+ *
30+ * /
31+ /*
32+ * Copyright (c) 2017 Inria. All rights reserved.
33+ * \$ COPYRIGHT$
34+ *
35+ * Additional copyrights may follow
36+ *
37+ * \$ HEADER$
38+ * /
39+
40+ # ifndef MCA_OSC_MONITORING_GEN_TEMPLATE_H
41+ # define MCA_OSC_MONITORING_GEN_TEMPLATE_H
42+
43+ # include <string.h>
44+ # include <ompi_config.h>
45+ # include <ompi/mca/osc/osc.h>
46+ # include <ompi/mca/osc/monitoring/osc_monitoring_template.h>
47+
48+ /*************************************** /
49+ /* Include template generating macros * /
50+
51+ EOF
52+ # Generate each case in order to register the proper template functions
53+ for comp in $components
54+ do
55+ echo " OSC_MONITORING_MODULE_TEMPLATE_GENERATE(${comp} )" >> $filename
56+ done
57+ cat << EOF >> $filename
58+
59+ /*************************************** /
60+
61+ static inline int
62+ ompi_mca_osc_monitoring_set_template(ompi_osc_base_component_t * best_component,
63+ ompi_osc_base_module_t * module)
64+ {
65+ /* Sorry for the lack on indentation, but the portability won over the cleanliness * /
66+ EOF
67+ for comp in $components
68+ do
69+ echo " if ( 0 == strcmp(\" ${comp} \" , best_component->osc_version.mca_component_name) ) {" >> $filename
70+ echo " OSC_MONITORING_SET_TEMPLATE(${comp} , module);" >> $filename
71+ echo " } else " >> $filename
72+ done
73+ cat << EOF >>$filename
74+ return OMPI_ERR_NOT_SUPPORTED;
75+ return OMPI_SUCCESS;
76+ }
77+
78+ #endif /* MCA_OSC_MONITORING_GEN_TEMPLATE_H */
79+ EOF
80+ unset filename components])
81+ ])dnl
82+ ])dnl
1083
1184# MCA_ompi_osc_monitoring_CONFIG()
1285# ------------------------------------------------
@@ -16,7 +89,7 @@ AC_DEFUN([MCA_ompi_osc_monitoring_CONFIG],[
1689 AS_IF([test " $MCA_BUILD_ompi_common_monitoring_DSO_TRUE " = ' ' ],
1790 [$1 ],
1891 [$2 ])
19- OPAL_CHECK_PORTALS4([osc_monitoring],
20- [AC_DEFINE([OMPI_WITH_OSC_PORTALS4], [1], [Whether or not to generate template for osc_portals4]) ],
21- [])
92+
93+ mca_ompi_osc_monitoring_generate_templates([ompi/mca/osc/monitoring/osc_monitoring_template_gen.h ],
94+ [mca_ompi_osc_m4_config_component_list, mca_ompi_osc_no_config_component_list])dnl
2295])dnl
0 commit comments