From d865e68e2093dc02d260e7d7ad7bbacd6f082621 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Sat, 2 Jul 2005 14:08:19 +0000 Subject: [PATCH] First cut at Makefile.am changes This commit was SVN r6272. --- opal/class/Makefile.am | 42 +++----- opal/dynamic-mca/Makefile.am | 21 ++++ opal/event/Makefile.am | 4 +- opal/include/Makefile.am | 19 ++++ opal/mca/Makefile.am | 34 ++++++ opal/mca/allocator/Makefile.am | 2 +- opal/mca/base/Makefile.am | 5 +- opal/mca/mca.h | 192 +++++++++++++++++++++++++++++++++ opal/mca/mpool/Makefile.am | 2 +- opal/runtime/Makefile.am | 43 ++++++++ opal/threads/Makefile.am | 20 ++-- opal/util/Makefile.am | 106 +++++++++--------- 12 files changed, 388 insertions(+), 102 deletions(-) create mode 100644 opal/dynamic-mca/Makefile.am create mode 100644 opal/include/Makefile.am create mode 100644 opal/mca/Makefile.am create mode 100644 opal/mca/mca.h create mode 100644 opal/runtime/Makefile.am diff --git a/opal/class/Makefile.am b/opal/class/Makefile.am index ebf7452f28..5f3e22fb4f 100644 --- a/opal/class/Makefile.am +++ b/opal/class/Makefile.am @@ -22,40 +22,28 @@ noinst_LTLIBRARIES = liblfc.la # Source code files headers = \ - ompi_bitmap.h \ - ompi_circular_buffer_fifo.h \ - ompi_fifo.h \ - ompi_free_list.h \ - ompi_hash_table.h \ - ompi_list.h \ - ompi_object.h \ - ompi_pointer_array.h \ - ompi_proc_table.h \ - ompi_value_array.h \ - ompi_rb_tree.h \ - orte_pointer_array.h \ - orte_value_array.h \ - orte_bitmap.h + ompi_circular_buffer_fifo.h \ + ompi_fifo.h \ + ompi_free_list.h \ + ompi_hash_table.h \ + ompi_list.h \ + ompi_object.h \ + ompi_rb_tree.h \ + ompi_value_array.h liblfc_la_SOURCES = \ $(headers) \ - ompi_free_list.c \ - ompi_hash_table.c \ - ompi_list.c \ - ompi_object.c \ - ompi_pointer_array.c \ - ompi_proc_table.c \ - ompi_bitmap.c \ - ompi_value_array.c \ - ompi_rb_tree.c \ - orte_pointer_array.c \ - orte_value_array.c \ - orte_bitmap.c + ompi_free_list.c \ + ompi_hash_table.c \ + ompi_list.c \ + ompi_object.c \ + ompi_rb_tree.c \ + ompi_value_array.c # Conditionally install the header files if WANT_INSTALL_HEADERS -ompidir = $(includedir)/openmpi/class +ompidir = $(includedir)/openmpi/opal/class ompi_HEADERS = $(headers) else ompidir = $(includedir) diff --git a/opal/dynamic-mca/Makefile.am b/opal/dynamic-mca/Makefile.am new file mode 100644 index 0000000000..94d257989e --- /dev/null +++ b/opal/dynamic-mca/Makefile.am @@ -0,0 +1,21 @@ +# +# Copyright (c) 2004-2005 The Trustees of Indiana University. +# All rights reserved. +# Copyright (c) 2004-2005 The Trustees of the University of Tennessee. +# All rights reserved. +# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# Copyright (c) 2004-2005 The Regents of the University of California. +# All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +include $(top_srcdir)/config/Makefile.options + +SUBDIRS = \ + allocator \ + mpool diff --git a/opal/event/Makefile.am b/opal/event/Makefile.am index fb5dc649e3..b5b796a979 100644 --- a/opal/event/Makefile.am +++ b/opal/event/Makefile.am @@ -21,7 +21,7 @@ include $(top_srcdir)/config/Makefile.options # of the header files in this directory get included elsewhere in OMPI. # #@%@#$... AM_CPPFLAGS = \ - -I$(top_srcdir)/src/event/compat + -I$(top_srcdir)/opal/event/compat # OMPI: No need to build the sample or test #SUBDIRS = . sample test @@ -63,7 +63,7 @@ libevent_la_DEPENDENCIES = $(objects) if WANT_INSTALL_HEADERS -ompidir = $(includedir)/openmpi/event +ompidir = $(includedir)/openmpi/opal/event ompi_HEADERS = $(headers) else ompidir = $(includedir) diff --git a/opal/include/Makefile.am b/opal/include/Makefile.am new file mode 100644 index 0000000000..b8ff290dbc --- /dev/null +++ b/opal/include/Makefile.am @@ -0,0 +1,19 @@ +# +# Copyright (c) 2004-2005 The Trustees of Indiana University. +# All rights reserved. +# Copyright (c) 2004-2005 The Trustees of the University of Tennessee. +# All rights reserved. +# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# Copyright (c) 2004-2005 The Regents of the University of California. +# All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +include $(top_srcdir)/config/Makefile.options + +SUBDIRS = sys diff --git a/opal/mca/Makefile.am b/opal/mca/Makefile.am new file mode 100644 index 0000000000..4d74571ab5 --- /dev/null +++ b/opal/mca/Makefile.am @@ -0,0 +1,34 @@ +# +# Copyright (c) 2004-2005 The Trustees of Indiana University. +# All rights reserved. +# Copyright (c) 2004-2005 The Trustees of the University of Tennessee. +# All rights reserved. +# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# Copyright (c) 2004-2005 The Regents of the University of California. +# All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +include $(top_srcdir)/config/Makefile.options + +SUBDIRS = \ + allocator \ + mpool \ + +# Source code files + +headers = mca.h + +# Conditionally install the header files + +if WANT_INSTALL_HEADERS +ompidir = $(includedir)/openmpi/opal/mca +ompi_HEADERS = $(headers) +else +ompidir = $(includedir) +endif diff --git a/opal/mca/allocator/Makefile.am b/opal/mca/allocator/Makefile.am index 6d668f4343..c2a8ab3966 100644 --- a/opal/mca/allocator/Makefile.am +++ b/opal/mca/allocator/Makefile.am @@ -26,7 +26,7 @@ headers = allocator.h # Conditionally install the header files if WANT_INSTALL_HEADERS -ompidir = $(includedir)/openmpi/mca/allocator +ompidir = $(includedir)/openmpi/opal/mca/allocator ompi_HEADERS = $(headers) else ompidir = $(includedir) diff --git a/opal/mca/base/Makefile.am b/opal/mca/base/Makefile.am index 3fe5a6bb33..086177ace8 100644 --- a/opal/mca/base/Makefile.am +++ b/opal/mca/base/Makefile.am @@ -35,7 +35,6 @@ pkgdata_DATA = help-mca-base.txt headers = \ base.h \ - mca_base_module_exchange.h \ mca_base_msgbuf.h \ mca_base_msgbuf_internal.h \ mca_base_param.h \ @@ -54,18 +53,16 @@ libmca_base_la_SOURCES = \ mca_base_components_open.c \ mca_base_components_close.c \ mca_base_list.c \ - mca_base_module_exchange.c \ mca_base_msgbuf.c \ mca_base_open.c \ mca_base_param.c \ mca_base_parse_paramfile.c \ mca_base_parse_paramfile_lex.l - # Conditionally install the header files if WANT_INSTALL_HEADERS -ompidir = $(includedir)/openmpi/mca/base +ompidir = $(includedir)/openmpi/opal/mca/base ompi_HEADERS = $(headers) else ompidir = $(includedir) diff --git a/opal/mca/mca.h b/opal/mca/mca.h new file mode 100644 index 0000000000..86484d552a --- /dev/null +++ b/opal/mca/mca.h @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University. + * All rights reserved. + * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. + * All rights reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ +/** + * @file + * + * Top-level interface for \em all MCA components. + */ + +#ifndef OMPI_MCA_H +#define OMPI_MCA_H + +#include "ompi_config.h" + +#include "class/ompi_list.h" +#include "util/cmd_line.h" + +/** + * MCA component open function. + * + * @retval MCA_SUCCESS This component can be used in the process. + * + * @retval anything_else The MCA will ignore this component for the + * duration of the process. + * + * All MCA components can have an "open" function that is invoked once + * per process, when the component is located and loaded. This function + * should register any MCA parameters (using + * mca_base_param_register_int() and mca_base_param_register_string()) + * that will be used by the component. Parameter registrations should + * occur in this function because the ompi_info command can be used by + * users to display all available MCA parameters (and their default + * values). However, the ompi_info command \em only invokes this open + * function on all components (i.e., no other component API methods). + * + * This function can also be used to allocate any resources necessary + * for the component (e.g., heap memory). + * + * This function should return MCA_SUCCESS if it wishes to remain + * loaded in the process. Any other return value will cause the MCA + * base to unload the component. Although most components do not use + * this mechanism to force themselves to be unloaded (because if they + * are immediately unloaded, ompi_info will not display them), the + * mechanism is available should the need arise. + * + * If the component a) has no MCA parameters to register, b) no + * resources to allocate, and c) can always be used in a process + * (albiet perhaps not selected), it may provide NULL for this + * function. In this cause, the MCA will act as if it called the open + * function and it returned MCA_SUCCESS. + */ +typedef int (*mca_base_open_component_fn_t)(void); + +/** MCA component close function + * + * @retval MCA_SUCCESS The component successfully shut down. + * + * @retval any_other_value Some error occurred, but is likely to be + * ignored. + * + * This function is invoked on a component after all of its modules + * have been finalized (according to the rules of its framework) and + * the component will never be used in the process again; the + * component may be unloaded from the process memory after the close + * function has been invoked. + * + * This function is typically used to release any resources still in + * use by the component. + * + * If the component has no resources to free, it may provide NULL for + * this function. In this case, the MCA will act as if it called the + * close function and it returned MCA_SUCCESS. + */ +typedef int (*mca_base_close_component_fn_t)(void); + + +/** + * Maximum length of MCA framework string names. + */ +#define MCA_BASE_MAX_TYPE_NAME_LEN 32 +/** + * Maximum length of MCA component string names. + */ +#define MCA_BASE_MAX_COMPONENT_NAME_LEN 64 + +/** + * Common type for all MCA components. + * + * An instance of this type is always the first element in MCA + * components, allowing the component to be associated with a + * particular version of a specific framework, and to publish its own + * name and version. + */ +struct mca_base_component_t { + + int mca_major_version; + /**< Major number of the MCA. */ + int mca_minor_version; + /**< Minor number of the MCA. */ + int mca_release_version; + /**< Release number of the MCA. */ + + char mca_type_name[MCA_BASE_MAX_TYPE_NAME_LEN]; + /**< String name of the framework that this component belongs to. */ + int mca_type_major_version; + /**< Major version number of the framework that this component + belongs to. */ + int mca_type_minor_version; + /**< Minor version number of the framework that this component + belongs to. */ + int mca_type_release_version; + /**< Release version number of the framework that this component + belongs to. */ + + char mca_component_name[MCA_BASE_MAX_COMPONENT_NAME_LEN]; + /**< This comopnent's string name. */ + int mca_component_major_version; + /**< This component's major version number. */ + int mca_component_minor_version; + /**< This component's minor version number. */ + int mca_component_release_version; + /**< This component's release version number. */ + + mca_base_open_component_fn_t mca_open_component; + /**< Method for opening this component. */ + mca_base_close_component_fn_t mca_close_component; + /**< Method for closing this component. */ +}; +/** + * Convenience typedef. + */ +typedef struct mca_base_component_t mca_base_component_t; + +/** + * Meta data for MCA v1.0.0 components. + */ +struct mca_base_component_data_1_0_0_t { + bool mca_is_checkpointable; + /**< Indicates whether this component is checkpointable or not. */ +}; +/** + * Convenience typedef. + */ +typedef struct mca_base_component_data_1_0_0_t mca_base_component_data_1_0_0_t; + +/** + * Macro for framework author convenience. + * + * This macro is used by frameworks defining their component types, + * indicating that they subscribe to the MCA version 1.0.0. See + * component header files (e.g., coll.h) for examples of its usage. + */ +#define MCA_BASE_VERSION_1_0_0 1, 0, 0 + + +/** + * MCA return codes. + */ +enum { + MCA_SUCCESS = 0, + /**< Success. */ + MCA_ERROR = -1, + /**< General error. */ + MCA_ERR_OUT_OF_RESOURCE = -2, + /**< Out of resources; a fatal error. */ + MCA_ERR_TEMP_OUT_OF_RESOURCE = -3, + /**< Out of resources; try again later. */ + MCA_ERR_BAD_PARAM = -5, + /**< Equivalent to MPI_ERR_ARG error code. */ + MCA_ERR_NOT_IMPLEMENTED = -10, + /**< Returned by functions or functionality that has not yet been + implemented */ + MCA_ERR_NOT_SUPPORTED = -11, + /**< Returned by functionality that is not supported. */ + + MCA_MAX_ERROR = -20 + /**< Maximum error code. */ +}; + +#endif /* OMPI_MCA_H */ diff --git a/opal/mca/mpool/Makefile.am b/opal/mca/mpool/Makefile.am index 886b766902..c8a93cf432 100644 --- a/opal/mca/mpool/Makefile.am +++ b/opal/mca/mpool/Makefile.am @@ -26,7 +26,7 @@ headers = mpool.h # Conditionally install the header files if WANT_INSTALL_HEADERS -ompidir = $(includedir)/openmpi/mca/mpool +ompidir = $(includedir)/openmpi/opal/mca/mpool ompi_HEADERS = $(headers) else ompidir = $(includedir) diff --git a/opal/runtime/Makefile.am b/opal/runtime/Makefile.am new file mode 100644 index 0000000000..4121518b46 --- /dev/null +++ b/opal/runtime/Makefile.am @@ -0,0 +1,43 @@ +# -*- makefile -*- +# +# Copyright (c) 2004-2005 The Trustees of Indiana University. +# All rights reserved. +# Copyright (c) 2004-2005 The Trustees of the University of Tennessee. +# All rights reserved. +# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# Copyright (c) 2004-2005 The Regents of the University of California. +# All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +include $(top_srcdir)/config/Makefile.options + +AM_CPPFLAGS = -I$(top_builddir)/src/event + +noinst_LTLIBRARIES = libruntime.la + +# Source code files + +headers = \ + ompi_progress.h \ + opal.h + +libruntime_la_SOURCES = \ + $(headers) \ + ompi_progress.c \ + orte_finalize.c \ + orte_init.c \ + +# Conditionally install the header files + +if WANT_INSTALL_HEADERS +ompidir = $(includedir)/openmpi/opal/runtime +ompi_HEADERS = $(headers) +else +ompidir = $(includedir) +endif diff --git a/opal/threads/Makefile.am b/opal/threads/Makefile.am index 5bcead7df6..6ce5fa19c5 100644 --- a/opal/threads/Makefile.am +++ b/opal/threads/Makefile.am @@ -22,22 +22,22 @@ noinst_LTLIBRARIES = libthreads.la # Source code files headers = \ - condition.h \ - mutex.h \ - mutex_unix.h \ - mutex_windows.h \ - thread.h + condition.h \ + mutex.h \ + mutex_unix.h \ + mutex_windows.h \ + thread.h libthreads_la_SOURCES = \ - $(headers) \ - condition.c \ - mutex.c \ - thread.c + $(headers) \ + condition.c \ + mutex.c \ + thread.c # Conditionally install the header files if WANT_INSTALL_HEADERS -ompidir = $(includedir)/openmpi/threads +ompidir = $(includedir)/openmpi/opal/threads ompi_HEADERS = $(headers) else ompidir = $(includedir) diff --git a/opal/util/Makefile.am b/opal/util/Makefile.am index 54f2d88c17..a38df67804 100644 --- a/opal/util/Makefile.am +++ b/opal/util/Makefile.am @@ -20,72 +20,64 @@ AM_CPPFLAGS = -DOMPI_PKGDATADIR=\"$(pkgdatadir)\" AM_LFLAGS = -Pompi_show_help_yy LEX_OUTPUT_ROOT = lex.ompi_show_help_yy -noinst_LTLIBRARIES = libompiutil.la +noinst_LTLIBRARIES = libopalutil.la # Source code files headers = \ - argv.h \ - basename.h \ - bit_ops.h \ - cmd_line.h \ - convert.h \ - ompi_environ.h \ - few.h \ - if.h \ - malloc.h \ - numtostr.h \ - output.h \ - path.h \ - sys_info.h \ - printf.h \ - proc_info.h \ - univ_info.h \ - os_path.h \ - os_create_dirpath.h \ - pow2.h \ - session_dir.h \ - show_help.h \ - show_help_lex.h \ - stacktrace.h \ - daemon_init.h \ - universe_setup_file_io.h \ - strncpy.h \ - qsort.h + argv.h \ + basename.h \ + bit_ops.h \ + cmd_line.h \ + convert.h \ + daemon_init.h \ + few.h \ + if.h \ + malloc.h \ + numtostr.h \ + ompi_environ.h \ + os_create_dirpath.h \ + os_path.h \ + output.h \ + path.h \ + pow2.h \ + printf.h \ + qsort.h \ + show_help.h \ + show_help_lex.h \ + stacktrace.h \ + strncpy.h \ + sys_info.h -libompiutil_la_SOURCES = \ - $(headers) \ - argv.c \ - basename.c \ - cmd_line.c \ - convert.c \ - few.c \ - if.c \ - malloc.c \ - numtostr.c \ - output.c \ - path.c \ - printf.c \ - proc_info.c \ - sys_info.c \ - univ_info.c \ - ompi_environ.c \ - os_path.c \ - os_create_dirpath.c \ - pow2.c \ - session_dir.c \ - show_help.c \ - show_help_lex.l \ - stacktrace.c \ - daemon_init.c \ - universe_setup_file_io.c \ - strncpy.c \ - qsort.c +libopalutil_la_SOURCES = \ + $(headers) \ + argv.c \ + basename.c \ + cmd_line.c \ + convert.c \ + daemon_init.c \ + few.c \ + if.c \ + malloc.c \ + numtostr.c \ + ompi_environ.c \ + os_create_dirpath.c \ + os_path.c \ + output.c \ + path.c \ + pow2.c \ + printf.c \ + qsort.c \ + show_help.c \ + show_help_lex.l \ + stacktrace.c \ + strncpy.c \ + sys_info.c # Conditionally install the header files if WANT_INSTALL_HEADERS -ompidir = $(includedir)/openmpi/util +ompidir = $(includedir)/openmpi/opal/util ompi_HEADERS = $(headers) else ompidir = $(includedir)