From ede4459f9af7e9aac5ad213602e319f0a24e03db Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Thu, 29 Jan 2004 02:49:32 +0000 Subject: [PATCH] Add ptl base open and close functions; ensure that ptl base is compiled into the rollup MCA MPI convenience library This commit was SVN r573. --- src/mca/mpi/Makefile.am | 4 +-- src/mca/mpi/ptl/Makefile.am | 7 ++++ src/mca/mpi/ptl/base/Makefile.am | 2 ++ src/mca/mpi/ptl/base/ptl_base_close.c | 29 +++++++++++++++ src/mca/mpi/ptl/base/ptl_base_open.c | 51 +++++++++++++++++++++++++++ src/mca/mpi/ptl/ptl.h | 24 +++++-------- 6 files changed, 99 insertions(+), 18 deletions(-) create mode 100644 src/mca/mpi/ptl/base/ptl_base_close.c create mode 100644 src/mca/mpi/ptl/base/ptl_base_open.c diff --git a/src/mca/mpi/Makefile.am b/src/mca/mpi/Makefile.am index 4ac7a1ff24..73ec20fa9c 100644 --- a/src/mca/mpi/Makefile.am +++ b/src/mca/mpi/Makefile.am @@ -22,8 +22,8 @@ libmca_mpi_convenience_la_SOURCES = libmca_mpi_convenience_la_LIBADD = \ base/libmca_mpi_base.la \ coll/libmca_mpi_coll.la \ - pml/libmca_mpi_pml.la -# Add in common_mpi, io, one, pml, ptl, topo as necessary + pml/libmca_mpi_pml.la \ + ptl/libmca_mpi_ptl.la libmca_mpi_convenience_la_DEPENDENCIES = $(libmca_mpi_convenience_la_LIBADD) # Conditionally install the header files diff --git a/src/mca/mpi/ptl/Makefile.am b/src/mca/mpi/ptl/Makefile.am index 042f64192e..0d0bc3c0fe 100644 --- a/src/mca/mpi/ptl/Makefile.am +++ b/src/mca/mpi/ptl/Makefile.am @@ -11,6 +11,13 @@ DIST_SUBDIRS = base $(MCA_ptl_ALL_SUBDIRS) headers = ptl.h +noinst_LTLIBRARIES = libmca_mpi_ptl.la +libmca_mpi_ptl_la_SOURCES = +libmca_mpi_ptl_la_LIBADD = \ + base/libmca_mpi_ptl_base.la \ + $(MCA_ptl_STATIC_LTLIBS) +libmca_mpi_ptl_la_DEPENDENCIES = $(libmca_mpi_ptl_la_LIBADD) + # Conditionally install the header files if WANT_INSTALL_HEADERS diff --git a/src/mca/mpi/ptl/base/Makefile.am b/src/mca/mpi/ptl/base/Makefile.am index 5268a6cdb7..3f226e0816 100644 --- a/src/mca/mpi/ptl/base/Makefile.am +++ b/src/mca/mpi/ptl/base/Makefile.am @@ -19,9 +19,11 @@ headers = \ libmca_mpi_ptl_base_la_SOURCES = \ $(headers) \ + ptl_base_close.c \ ptl_base_comm.c \ ptl_base_fragment.c \ ptl_base_match.c \ + ptl_base_open.c \ ptl_base_recvfrag.c \ ptl_base_recvreq.c \ ptl_base_sendfrag.c \ diff --git a/src/mca/mpi/ptl/base/ptl_base_close.c b/src/mca/mpi/ptl/base/ptl_base_close.c new file mode 100644 index 0000000000..ca0c2fb7e9 --- /dev/null +++ b/src/mca/mpi/ptl/base/ptl_base_close.c @@ -0,0 +1,29 @@ +/* + * $HEADER$ + */ + +#include "lam_config.h" + +#include +#include + +#include "lam/constants.h" +#include "mca/mca.h" +#include "mca/lam/base/base.h" +#include "mca/mpi/ptl/ptl.h" + + +int mca_ptl_base_close(void) +{ + extern lam_list_t mca_ptl_base_modules_available; + + /* Close all remaining available modules (may be one if this is a + LAM RTE program, or [possibly] multiple if this is laminfo) */ + + mca_base_modules_close(mca_ptl_base_output, + &mca_ptl_base_modules_available, NULL); + + /* All done */ + + return LAM_SUCCESS; +} diff --git a/src/mca/mpi/ptl/base/ptl_base_open.c b/src/mca/mpi/ptl/base/ptl_base_open.c new file mode 100644 index 0000000000..44dfee4f36 --- /dev/null +++ b/src/mca/mpi/ptl/base/ptl_base_open.c @@ -0,0 +1,51 @@ +/* + * $HEADER$ + */ + +#include "lam_config.h" + +#include +#include +#include + +#include "mca/mca.h" +#include "mca/lam/base/base.h" +#include "mca/mpi/ptl/ptl.h" + + +/* + * The following file was created by configure. It contains extern + * statements and the definition of an array of pointers to each + * module's public mca_base_module_t struct. + */ + +#include "mca/mpi/ptl/base/static-modules.h" + + +/* + * Global variables + */ +int mca_ptl_base_output = -1; +mca_ptl_t mca_ptl; +lam_list_t mca_ptl_base_modules_available; +mca_ptl_base_module_t mca_ptl_base_selected_module; + + +/** + * Function for finding and opening either all MCA modules, or the one + * that was specifically requested via a MCA parameter. + */ +int mca_ptl_base_open(void) +{ + /* Open up all available modules */ + + if (LAM_SUCCESS != + mca_base_modules_open("ptl", 0, mca_ptl_base_static_modules, + &mca_ptl_base_modules_available)) { + return LAM_ERROR; + } + + /* All done */ + + return LAM_SUCCESS; +} diff --git a/src/mca/mpi/ptl/ptl.h b/src/mca/mpi/ptl/ptl.h index 0d857d6534..e2a44d122f 100644 --- a/src/mca/mpi/ptl/ptl.h +++ b/src/mca/mpi/ptl/ptl.h @@ -5,15 +5,14 @@ * * P2P Transport Layer (PTL) */ -#ifndef LAM_MCA_PTL_H -#define LAM_MCA_PTL_H +#ifndef MCA_PTL_H +#define MCA_PTL_H #include "mca/mca.h" #include "lam/lam.h" #include "lam/lfc/list.h" #include "mpi/proc/proc.h" #include "mca/mpi/pml/pml.h" -#include "mca/mpi/ptl/ptl.h" /* @@ -165,26 +164,19 @@ typedef struct mca_ptl_t mca_ptl_t; #if defined(c_plusplus) || defined(__cplusplus) extern "C" { #endif - int mca_ptl_base_close(void); int mca_ptl_base_open(void); - int mca_ptl_base_query(void); int mca_ptl_base_init(void); + int mca_ptl_base_close(void); #if defined(c_plusplus) || defined(__cplusplus) } #endif /* - * Public variables + * Globals */ - -extern lam_list_t *mca_ptl_base_opened; -extern lam_list_t *mca_ptl_base_available; - -/* - * Global instance of array of pointers to mca_t. Will - * effectively be filled in by configure. - */ - -extern const mca_base_module_t **mca_ptl_base_modules; +extern int mca_ptl_base_output; +extern lam_list_t mca_ptl_base_modules_available; +extern mca_ptl_base_module_t mca_ptl_base_selected_module; +extern mca_ptl_t mca_ptl; #endif /* LAM_MCA_PTL_H */