From a27f74913408dd22ac025f7283c4253c94690659 Mon Sep 17 00:00:00 2001 From: Brian Barrett Date: Sat, 7 Aug 2004 00:53:56 +0000 Subject: [PATCH] * Move the MPI runtime code from src/runtime to src/mpiruntime to make the abstraction a little clearer. * Include mpiruntime.h instead of runtime.h in errhandler.h since only the MPI stuff was needed - speeds compile times greatly when working on the RTE... This commit was SVN r1948. --- configure.ac | 1 + src/Makefile.am | 2 + src/errhandler/errhandler.h | 2 +- src/mpiruntime/Makefile.am | 29 ++++++++++ src/mpiruntime/mpiruntime.h | 55 +++++++++++++++++++ .../ompi_mpi_finalize.c | 0 src/{runtime => mpiruntime}/ompi_mpi_init.c | 0 src/runtime/Makefile.am | 2 - src/runtime/runtime.h | 35 +----------- 9 files changed, 91 insertions(+), 35 deletions(-) create mode 100644 src/mpiruntime/Makefile.am create mode 100644 src/mpiruntime/mpiruntime.h rename src/{runtime => mpiruntime}/ompi_mpi_finalize.c (100%) rename src/{runtime => mpiruntime}/ompi_mpi_init.c (100%) diff --git a/configure.ac b/configure.ac index 745a466fb1..585f84ca74 100644 --- a/configure.ac +++ b/configure.ac @@ -854,6 +854,7 @@ AC_CONFIG_FILES([ src/os/linux/ia64/Makefile src/os/linux/x86_64/Makefile src/os/tru64/Makefile + src/mpiruntime/Makefile src/runtime/Makefile src/threads/Makefile src/util/Makefile diff --git a/src/Makefile.am b/src/Makefile.am index 6e8998d8b2..7fe909b176 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -19,6 +19,7 @@ SUBDIRS = \ class \ mca \ mpi \ + mpiruntime \ op \ os \ proc \ @@ -45,6 +46,7 @@ libmpi_la_LIBADD = \ class/liblfc.la \ mca/libmca.la \ mpi/libmpi_bindings.la \ + mpiruntime/libmpiruntime.la \ op/libop.la \ proc/libproc.la \ request/librequest.la \ diff --git a/src/errhandler/errhandler.h b/src/errhandler/errhandler.h index 362eaa1541..948793173a 100644 --- a/src/errhandler/errhandler.h +++ b/src/errhandler/errhandler.h @@ -11,7 +11,7 @@ #include "mpi.h" #include "class/ompi_object.h" #include "class/ompi_pointer_array.h" -#include "runtime/runtime.h" +#include "mpiruntime/mpiruntime.h" #include "errhandler/errhandler_predefined.h" /* diff --git a/src/mpiruntime/Makefile.am b/src/mpiruntime/Makefile.am new file mode 100644 index 0000000000..b344dcb8f3 --- /dev/null +++ b/src/mpiruntime/Makefile.am @@ -0,0 +1,29 @@ +# -*- makefile -*- +# +# $HEADER$ +# + +include $(top_srcdir)/config/Makefile.options + +AM_CPPFLAGS = -I$(top_builddir)/src/event + +noinst_LTLIBRARIES = libmpiruntime.la + +# Source code files + +headers = \ + mpiruntime.h + +libmpiruntime_la_SOURCES = \ + $(headers) \ + ompi_mpi_init.c \ + ompi_mpi_finalize.c + +# Conditionally install the header files + +if WANT_INSTALL_HEADERS +ompidir = $(includedir)/openmpi/mpiruntime +ompi_HEADERS = $(headers) +else +ompidir = $(includedir) +endif diff --git a/src/mpiruntime/mpiruntime.h b/src/mpiruntime/mpiruntime.h new file mode 100644 index 0000000000..cee9e4a6ea --- /dev/null +++ b/src/mpiruntime/mpiruntime.h @@ -0,0 +1,55 @@ +/* + * $HEADER$ + */ + +/** + * @file + * + * Interface into the MPI portion of the Open MPI Run Time Environment + */ + +#ifndef OMPI_MPIRUNTIME_H +#define OMPI_MPIRUNTIME_H + +#include "ompi_config.h" + +/* + * Global variables and symbols for the MPI layer + */ + +extern bool ompi_mpi_initialized; +extern bool ompi_mpi_finalized; +extern bool ompi_mpi_param_check; + +extern bool ompi_mpi_thread_multiple; +extern int ompi_mpi_thread_requested; +extern int ompi_mpi_thread_provided; + + +#ifdef __cplusplus +extern "C" { +#endif + + /** + * Initialize the Open MPI MPI environment + * + * Intialize all support code needed for MPI applications. This + * function should only be called by MPI applications (including + * singletons). It should only be called after both \code + * ompi_init() and \code ompi_rte_init() have been called. + */ + int ompi_mpi_init(int argc, char **argv, int requested, int *provided); + + /** + * Finalize the Open MPI MPI environment + * + * Should be called after all MPI functionality is complete (usually + * during MPI_FINALIZE) and before \c ompi_rte_finalize(). + */ + int ompi_mpi_finalize(void); + +#ifdef __cplusplus +} +#endif + +#endif /* OMPI_MPIRUNTIME_H */ diff --git a/src/runtime/ompi_mpi_finalize.c b/src/mpiruntime/ompi_mpi_finalize.c similarity index 100% rename from src/runtime/ompi_mpi_finalize.c rename to src/mpiruntime/ompi_mpi_finalize.c diff --git a/src/runtime/ompi_mpi_init.c b/src/mpiruntime/ompi_mpi_init.c similarity index 100% rename from src/runtime/ompi_mpi_init.c rename to src/mpiruntime/ompi_mpi_init.c diff --git a/src/runtime/Makefile.am b/src/runtime/Makefile.am index 766cb78064..a09b10a7d1 100644 --- a/src/runtime/Makefile.am +++ b/src/runtime/Makefile.am @@ -24,8 +24,6 @@ libruntime_la_SOURCES = \ ompi_init.c \ universe_connect.c \ universe_init.c \ - ompi_mpi_init.c \ - ompi_mpi_finalize.c \ ompi_progress.c \ ompi_rte_finalize.c \ ompi_rte_init.c diff --git a/src/runtime/runtime.h b/src/runtime/runtime.h index 0c38a7b260..98b8cc6839 100644 --- a/src/runtime/runtime.h +++ b/src/runtime/runtime.h @@ -13,19 +13,9 @@ #include "ompi_config.h" - -/* - * Global variables and symbols for the MPI layer - */ - -extern bool ompi_mpi_initialized; -extern bool ompi_mpi_finalized; -extern bool ompi_mpi_param_check; - -extern bool ompi_mpi_thread_multiple; -extern int ompi_mpi_thread_requested; -extern int ompi_mpi_thread_provided; - +/* For backwards compatibility. If you only need MPI stuff, please include + mpiruntime/mpiruntime.h directly */ +#include "mpiruntime/mpiruntime.h" #ifdef __cplusplus extern "C" { @@ -81,25 +71,6 @@ extern "C" { */ int ompi_rte_finalize(void); - - /** - * Initialize the Open MPI MPI environment - * - * Intialize all support code needed for MPI applications. This - * function should only be called by MPI applications (including - * singletons). It should only be called after both \code - * ompi_init() and \code ompi_rte_init() have been called. - */ - int ompi_mpi_init(int argc, char **argv, int requested, int *provided); - - /** - * Finalize the Open MPI MPI environment - * - * Should be called after all MPI functionality is complete (usually - * during MPI_FINALIZE) and before \c ompi_rte_finalize(). - */ - int ompi_mpi_finalize(void); - #ifdef __cplusplus } #endif