1
1

Bunch more updates from operation Red Storm:

* Add ability to completely disable libltdl (the dlopen code to load
  dynamic shared objects) to configure: --disable-dlopen
* Added MCA param (component_disable_dlopen) to disable DSO loading
  at runtime
* Made the event library behave in some not-completely-erroneous way
  on platforms where it has absolutely no eventops support (ie, no
  select, poll, or epoll)
* Disabled orte_wait, opal_few, and opal_daemon_init code on
  platforms without fork, waitpid support.  All non-init functions
  will return OPMI_ERR_NOT_SUPPORTED
* Disable orteprobe tool when fork or pipe aren't supported

This commit was SVN r6490.
Этот коммит содержится в:
Brian Barrett 2005-07-14 18:05:30 +00:00
родитель beba576af5
Коммит 14b89e0e50
15 изменённых файлов: 280 добавлений и 44 удалений

Просмотреть файл

@ -398,4 +398,26 @@ fi
AC_DEFINE_UNQUOTED([OMPI_ENABLE_PTY_SUPPORT], [$OMPI_ENABLE_PTY_SUPPORT], AC_DEFINE_UNQUOTED([OMPI_ENABLE_PTY_SUPPORT], [$OMPI_ENABLE_PTY_SUPPORT],
[Whether user wants PTY support or not]) [Whether user wants PTY support or not])
#
# Do we want to allow DLOPEN?
#
AC_MSG_CHECKING([if user wants dlopen support])
AC_ARG_ENABLE([dlopen],
[AC_HELP_STRING([--enable-dlopen],
[Whether build should attempt to use dlopen (or
similar) to dynamically load components.
Disabling dlopen implies --disable-mca-dso.
(default=enabled)])])
if test "$enable_dlopen" = "no" ; then
enable_mca_dso="no"
enable_mca_static="yes"
OMPI_ENABLE_DLOPEN_SUPPORT=0
AC_MSG_RESULT([no])
else
OMPI_ENABLE_DLOPEN_SUPPORT=1
AC_MSG_RESULT([yes])
fi
# this doesn't define anything in the makefiles or ompi_config.h.
# Only provides a variable that the MCA and ltdl stuff keys off.
]) ])

Просмотреть файл

@ -1101,7 +1101,7 @@ ompi_show_title "Library and Function tests"
# vscanf # vscanf
AC_CHECK_LIB([util], [openpty], [WRAPPER_EXTRA_LIBS="$WRAPPER_EXTRA_LIBS -lutil" LIBLAM_EXTRA_LIBS="$LIBLAMEXTRALIBS -lutil" LIBS="$LIBS -lutil]") AC_CHECK_LIB([util], [openpty], [WRAPPER_EXTRA_LIBS="$WRAPPER_EXTRA_LIBS -lutil" LIBLAM_EXTRA_LIBS="$LIBLAMEXTRALIBS -lutil" LIBS="$LIBS -lutil]")
AC_CHECK_FUNCS([asprintf snprintf vasprintf vsnprintf openpty isatty htonl ntohl htons ntohs getpwuid fork waitpid execve]) AC_CHECK_FUNCS([asprintf snprintf vasprintf vsnprintf openpty isatty htonl ntohl htons ntohs getpwuid fork waitpid execve pipe setsid])
# #
# Make sure we can copy va_lists (need check declared, not linkable) # Make sure we can copy va_lists (need check declared, not linkable)
@ -1340,11 +1340,11 @@ ompi_show_subtitle "Libtool configuration"
# use of the newest libltdl (i.e., the one that ships with libtool # use of the newest libltdl (i.e., the one that ships with libtool
# 1.5) because it has support for a lot more things than older # 1.5) because it has support for a lot more things than older
# versions of libtool (which are generally installed by default). # versions of libtool (which are generally installed by default).
AS_IF([test "$OMPI_ENABLE_DLOPEN_SUPPORT" = "1"],
AC_LIBLTDL_CONVENIENCE(opal/libltdl) [AC_LIBLTDL_CONVENIENCE(opal/libltdl)
AC_LIBTOOL_DLOPEN])
AC_SUBST(LTDLINCL) AC_SUBST(LTDLINCL)
AC_SUBST(LIBLTDL) AC_SUBST(LIBLTDL)
AC_LIBTOOL_DLOPEN
AM_PROG_LIBTOOL AM_PROG_LIBTOOL
# AC_CONFIG_SUBDIRS appears to be broken for non-gcc compilers (i.e., # AC_CONFIG_SUBDIRS appears to be broken for non-gcc compilers (i.e.,
@ -1366,39 +1366,48 @@ AM_PROG_LIBTOOL
ompi_show_subtitle "GNU libltdl setup" ompi_show_subtitle "GNU libltdl setup"
ompi_subdir_args="$ompi_subdir_args --enable-ltdl-convenience --disable-ltdl-install" if test "$OMPI_ENABLE_DLOPEN_SUPPORT" = "1" ; then
if test "$enable_shared" = "yes"; then ompi_subdir_args="$ompi_subdir_args --enable-ltdl-convenience --disable-ltdl-install"
ompi_subdir_args="$ompi_subdir_args --enable-shared" if test "$enable_shared" = "yes"; then
else ompi_subdir_args="$ompi_subdir_args --enable-shared"
ompi_subdir_args="$ompi_subdir_args --disable-shared" else
fi ompi_subdir_args="$ompi_subdir_args --disable-shared"
if test "$enable_static" = "yes"; then fi
ompi_subdir_args="$ompi_subdir_args --enable-static" if test "$enable_static" = "yes"; then
else ompi_subdir_args="$ompi_subdir_args --enable-static"
ompi_subdir_args="$ompi_subdir_args --disable-static" else
fi ompi_subdir_args="$ompi_subdir_args --disable-static"
fi
CFLAGS_save="$CFLAGS" CFLAGS_save="$CFLAGS"
CFLAGS="$OMPI_CFLAGS_BEFORE_PICKY" CFLAGS="$OMPI_CFLAGS_BEFORE_PICKY"
OMPI_CONFIG_SUBDIR(opal/libltdl, [$ompi_subdir_args], [HAPPY=1], [HAPPY=0]) OMPI_CONFIG_SUBDIR(opal/libltdl, [$ompi_subdir_args], [HAPPY=1], [HAPPY=0])
if test "$HAPPY" = "1"; then if test "$HAPPY" = "1"; then
LIBLTDL_SUBDIR=libltdl LIBLTDL_SUBDIR=libltdl
LIBLTDL_LTLIB=libltdl/libltdlc.la LIBLTDL_LTLIB=libltdl/libltdlc.la
WANT_LIBLTDL=1 WANT_LIBLTDL=1
# Arrgh. This is gross. But I can't think of any other way to do # Arrgh. This is gross. But I can't think of any other way to do
# it. :-( # it. :-(
flags="`egrep ^LIBADD_DL opal/libltdl/Makefile | cut -d= -f2-`" flags="`egrep ^LIBADD_DL opal/libltdl/Makefile | cut -d= -f2-`"
OMPI_CHECK_LINKER_FLAGS([opal/libltdl/libtool], [-export-dynamic $flags]) OMPI_CHECK_LINKER_FLAGS([opal/libltdl/libtool], [-export-dynamic $flags])
WRAPPER_EXTRA_LIBS="$WRAPPER_EXTRA_LIBS $extra_ldflags" WRAPPER_EXTRA_LIBS="$WRAPPER_EXTRA_LIBS $extra_ldflags"
LDFLAGS="-export-dynamic $LDFLAGS" LDFLAGS="-export-dynamic $LDFLAGS"
else
LIBLTDL_SUBDIR=
LIBLTDL_LTLIB=
WANT_LIBLTDL=0
fi
CFLAGS="$CFLAGS_save"
else else
AC_MSG_WARN([libltdl support disabled (by --disable-dlopen)])
LIBLTDL_SUBDIR= LIBLTDL_SUBDIR=
LIBLTDL_LTLIB= LIBLTDL_LTLIB=
WANT_LIBLTDL=0 WANT_LIBLTDL=0
fi fi
CFLAGS="$CFLAGS_save"
AC_SUBST(LIBLTDL_SUBDIR) AC_SUBST(LIBLTDL_SUBDIR)
AC_SUBST(LIBLTDL_LTLIB) AC_SUBST(LIBLTDL_LTLIB)
AM_CONDITIONAL(WANT_LIBLTDL, test "$WANT_LIBLTDL" = "1") AM_CONDITIONAL(WANT_LIBLTDL, test "$WANT_LIBLTDL" = "1")

Просмотреть файл

@ -39,6 +39,8 @@
#include "mca/pml/base/base.h" #include "mca/pml/base/base.h"
#include "mca/ptl/ptl.h" #include "mca/ptl/ptl.h"
#include "mca/ptl/base/base.h" #include "mca/ptl/base/base.h"
#include "mca/btl/btl.h"
#include "mca/btl/base/base.h"
#include "mca/topo/topo.h" #include "mca/topo/topo.h"
#include "mca/topo/base/base.h" #include "mca/topo/base/base.h"
@ -193,6 +195,11 @@ void ompi_info::open_components()
*/ */
component_map["ptl"] = &mca_ptl_base_components_opened; component_map["ptl"] = &mca_ptl_base_components_opened;
/* mca_btl_base_open() should not be called directly. This call is performed
* in the PML base open.
*/
component_map["btl"] = &mca_btl_base_components_opened;
mca_topo_base_open(); mca_topo_base_open();
component_map["topo"] = &mca_topo_base_components_opened; component_map["topo"] = &mca_topo_base_components_opened;
@ -212,7 +219,8 @@ void ompi_info::close_components()
// them generally "in order", but it doesn't really matter. // them generally "in order", but it doesn't really matter.
mca_topo_base_close(); mca_topo_base_close();
// the PMl has to call the base PTL close function. // the PML has to call the base PTL close function.
// the PML has to call the base BTL close function.
mca_pml_base_close(); mca_pml_base_close();
mca_mpool_base_close(); mca_mpool_base_close();
mca_io_base_close(); mca_io_base_close();

Просмотреть файл

@ -166,6 +166,7 @@ int main(int argc, char *argv[])
ompi_info::mca_types.push_back("mpool"); ompi_info::mca_types.push_back("mpool");
ompi_info::mca_types.push_back("pml"); ompi_info::mca_types.push_back("pml");
ompi_info::mca_types.push_back("ptl"); ompi_info::mca_types.push_back("ptl");
ompi_info::mca_types.push_back("btl");
ompi_info::mca_types.push_back("topo"); ompi_info::mca_types.push_back("topo");
ompi_info::mca_types.push_back("errmgr"); ompi_info::mca_types.push_back("errmgr");

Просмотреть файл

@ -541,4 +541,5 @@ void ompi_info::do_config(bool want_all)
out("MPI parameter check", "option:mpi-param-check", paramcheck); out("MPI parameter check", "option:mpi-param-check", paramcheck);
out("Memory profiling support", "option:mem-profile", memprofile); out("Memory profiling support", "option:mem-profile", memprofile);
out("Memory debugging support", "option:mem-debug", memdebug); out("Memory debugging support", "option:mem-debug", memdebug);
out("libltdl support", "option:dlopen", OMPI_WANT_LIBLTDL);
} }

Просмотреть файл

@ -185,16 +185,18 @@ void ompi_info::show_component_version(const string& type_name,
components = component_map[type_name]; components = component_map[type_name];
if (NULL != components) { if (NULL != components) {
for (item = opal_list_get_first(components); if (opal_list_get_size(components) > 0){
opal_list_get_end(components) != item; for (item = opal_list_get_first(components);
item = opal_list_get_next(item)) { opal_list_get_end(components) != item;
cli = (mca_base_component_list_item_t *) item; item = opal_list_get_next(item)) {
component = cli->cli_component; cli = (mca_base_component_list_item_t *) item;
if (want_all_components || component = cli->cli_component;
component->mca_component_name == component_name) { if (want_all_components ||
show_mca_version(component, scope, ver_type); component->mca_component_name == component_name) {
show_mca_version(component, scope, ver_type);
}
}
} }
}
} }
} }

Просмотреть файл

@ -68,19 +68,39 @@
#if defined(HAVE_SELECT) && HAVE_SELECT #if defined(HAVE_SELECT) && HAVE_SELECT
extern const struct opal_eventop opal_selectops; extern const struct opal_eventop opal_selectops;
#ifndef OPAL_HAVE_WORKING_EVENTOPS
#define OPAL_HAVE_WORKING_EVENTOPS 1
#endif #endif
#endif
#if defined(HAVE_POLL) && HAVE_POLL && HAVE_WORKING_POLL #if defined(HAVE_POLL) && HAVE_POLL && HAVE_WORKING_POLL
extern const struct opal_eventop opal_pollops; extern const struct opal_eventop opal_pollops;
#ifndef OPAL_HAVE_WORKING_EVENTOPS
#define OPAL_HAVE_WORKING_EVENTOPS 1
#endif #endif
#endif
#if defined(HAVE_RTSIG) && HAVE_RTSIG #if defined(HAVE_RTSIG) && HAVE_RTSIG
extern const struct opal_eventop opal_rtsigops; extern const struct opal_eventop opal_rtsigops;
#ifndef OPAL_HAVE_WORKING_EVENTOPS
#define OPAL_HAVE_WORKING_EVENTOPS 1
#endif #endif
#endif
#if defined(HAVE_EPOLL) && HAVE_EPOLL #if defined(HAVE_EPOLL) && HAVE_EPOLL
extern const struct opal_eventop opal_epollops; extern const struct opal_eventop opal_epollops;
#ifndef OPAL_HAVE_WORKING_EVENTOPS
#define OPAL_HAVE_WORKING_EVENTOPS 1
#endif #endif
#endif
#if defined(HAVE_WORKING_KQUEUE) && HAVE_WORKING_KQUEUE #if defined(HAVE_WORKING_KQUEUE) && HAVE_WORKING_KQUEUE
extern const struct opal_eventop opal_kqops; extern const struct opal_eventop opal_kqops;
#ifndef OPAL_HAVE_WORKING_EVENTOPS
#define OPAL_HAVE_WORKING_EVENTOPS 1
#endif #endif
#endif
#if 0 #if 0
/* This is to prevent event library from picking up the win32_ops since this will /* This is to prevent event library from picking up the win32_ops since this will
be picked up over select(). By using select, we can pretty much use the OOB and be picked up over select(). By using select, we can pretty much use the OOB and
@ -88,8 +108,15 @@ extern const struct opal_eventop opal_kqops;
this to work */ this to work */
#if defined(WIN32) && WIN32 #if defined(WIN32) && WIN32
extern const struct opal_eventop opal_win32ops; extern const struct opal_eventop opal_win32ops;
#ifndef OPAL_HAVE_WORKING_EVENTOPS
#define OPAL_HAVE_WORKING_EVENTOPS 1
#endif #endif
#endif #endif
#endif
#ifndef OPAL_HAVE_WORKING_EVENTOPS
#define OPAL_HAVE_WORKING_EVENTOPS 0
#endif
/* In order of preference */ /* In order of preference */
static const struct opal_eventop *opal_eventops[] = { static const struct opal_eventop *opal_eventops[] = {
@ -248,6 +275,8 @@ opal_event_init(void)
if(opal_event_inited++ != 0) if(opal_event_inited++ != 0)
return OMPI_SUCCESS; return OMPI_SUCCESS;
#if OPAL_HAVE_WORKING_EVENTOPS
opal_event_sigcb = NULL; opal_event_sigcb = NULL;
opal_event_gotsig = 0; opal_event_gotsig = 0;
gettimeofday(&opal_event_tv, NULL); gettimeofday(&opal_event_tv, NULL);
@ -275,6 +304,8 @@ opal_event_init(void)
log_to(stderr); log_to(stderr);
log_debug_cmd(LOG_MISC, 80); log_debug_cmd(LOG_MISC, 80);
#endif #endif
#endif /* HAVE_WORKING_EVENTOPS */
return OMPI_SUCCESS; return OMPI_SUCCESS;
} }
@ -364,6 +395,7 @@ int opal_event_enable(void)
int opal_event_restart(void) int opal_event_restart(void)
{ {
#if OPAL_HAVE_WORKING_EVENTOPS
int rc; int rc;
#if OMPI_ENABLE_PROGRESS_THREADS #if OMPI_ENABLE_PROGRESS_THREADS
opal_mutex_lock(&opal_event_lock); opal_mutex_lock(&opal_event_lock);
@ -383,18 +415,26 @@ int opal_event_restart(void)
if((rc = opal_evsignal_restart()) != 0) if((rc = opal_evsignal_restart()) != 0)
return OMPI_ERROR; return OMPI_ERROR;
return (OMPI_SUCCESS); return (OMPI_SUCCESS);
#else /* OPAL_HAVE_WORKING_EVENTOPS */
return OMPI_ERR_NOT_SUPPORTED;
#endif
} }
int opal_event_haveevents(void) int opal_event_haveevents(void)
{ {
#if OPAL_HAVE_WORKING_EVENTOPS
return (RB_ROOT(&opal_timetree) || TAILQ_FIRST(&opal_eventqueue) || return (RB_ROOT(&opal_timetree) || TAILQ_FIRST(&opal_eventqueue) ||
TAILQ_FIRST(&opal_signalqueue) || TAILQ_FIRST(&opal_activequeue)); TAILQ_FIRST(&opal_signalqueue) || TAILQ_FIRST(&opal_activequeue));
#else
return 0;
#endif
} }
static void static void
opal_event_process_active(void) opal_event_process_active(void)
{ {
#if OPAL_HAVE_WORKING_EVENTOPS
struct opal_event *ev; struct opal_event *ev;
short ncalls; short ncalls;
@ -417,6 +457,7 @@ opal_event_process_active(void)
} }
} }
} }
#endif
} }
int int
@ -435,6 +476,7 @@ opal_event_loop(int flags)
if (opal_event_inited == false) if (opal_event_inited == false)
return(0); return(0);
#if OPAL_HAVE_WORKING_EVENTOPS
if(opal_using_threads()) { if(opal_using_threads()) {
opal_mutex_lock(&opal_event_lock); opal_mutex_lock(&opal_event_lock);
} }
@ -511,6 +553,7 @@ opal_event_loop(int flags)
} }
} }
opal_mutex_unlock(&opal_event_lock); opal_mutex_unlock(&opal_event_lock);
#endif /* OPAL_HAVE_WORKING_EVENTOPS */
return (num_active); return (num_active);
} }
@ -519,6 +562,8 @@ int
opal_event_add_i(struct opal_event *ev, struct timeval *tv) opal_event_add_i(struct opal_event *ev, struct timeval *tv)
{ {
int rc = 0; int rc = 0;
#if OPAL_HAVE_WORKING_EVENTOPS
LOG_DBG((LOG_MISC, 55, LOG_DBG((LOG_MISC, 55,
"event_add: event: %p, %s%s%scall %p", "event_add: event: %p, %s%s%scall %p",
ev, ev,
@ -579,6 +624,10 @@ opal_event_add_i(struct opal_event *ev, struct timeval *tv)
opal_event_pipe_signalled++; opal_event_pipe_signalled++;
} }
#endif #endif
#else /* OPAL_HAVE_WORKING_EVENTOPS */
rc = OMPI_ERR_NOT_SUPPORTED;
#endif /* OPAL_HAVE_WORKING_EVENTOPS */
return rc; return rc;
} }
@ -586,6 +635,8 @@ opal_event_add_i(struct opal_event *ev, struct timeval *tv)
int opal_event_del_i(struct opal_event *ev) int opal_event_del_i(struct opal_event *ev)
{ {
int rc = 0; int rc = 0;
#if OPAL_HAVE_WORKING_EVENTOPS
assert(!(ev->ev_flags & ~OPAL_EVLIST_ALL)); assert(!(ev->ev_flags & ~OPAL_EVLIST_ALL));
/* See if we are just active executing this event in a loop */ /* See if we are just active executing this event in a loop */
@ -616,6 +667,10 @@ int opal_event_del_i(struct opal_event *ev)
opal_event_pipe_signalled++; opal_event_pipe_signalled++;
} }
#endif #endif
#else /* OPAL_HAVE_WORKING_EVENTOPS */
rc = OMPI_ERR_NOT_SUPPORTED;
#endif /* OPAL_HAVE_WORKING_EVENTOPS */
return (rc); return (rc);
} }
@ -623,6 +678,7 @@ int opal_event_del_i(struct opal_event *ev)
static void static void
opal_timeout_correct(struct timeval *off) opal_timeout_correct(struct timeval *off)
{ {
#if OPAL_HAVE_WORKING_EVENTOPS
struct opal_event *ev; struct opal_event *ev;
/* We can modify the key element of the node without destroying /* We can modify the key element of the node without destroying
@ -630,12 +686,14 @@ opal_timeout_correct(struct timeval *off)
*/ */
RB_FOREACH(ev, opal_event_tree, &opal_timetree) RB_FOREACH(ev, opal_event_tree, &opal_timetree)
timersub(&ev->ev_timeout, off, &ev->ev_timeout); timersub(&ev->ev_timeout, off, &ev->ev_timeout);
#endif
} }
static void static void
opal_timeout_process(void) opal_timeout_process(void)
{ {
#if OPAL_HAVE_WORKING_EVENTOPS
struct timeval now; struct timeval now;
struct opal_event *ev, *next; struct opal_event *ev, *next;
@ -655,11 +713,13 @@ opal_timeout_process(void)
ev->ev_callback)); ev->ev_callback));
opal_event_active_i(ev, OPAL_EV_TIMEOUT, 1); opal_event_active_i(ev, OPAL_EV_TIMEOUT, 1);
} }
#endif
} }
static void static void
opal_timeout_insert(struct opal_event *ev) opal_timeout_insert(struct opal_event *ev)
{ {
#if OPAL_HAVE_WORKING_EVENTOPS
struct opal_event *tmp; struct opal_event *tmp;
tmp = RB_FIND(opal_event_tree, &opal_timetree, ev); tmp = RB_FIND(opal_event_tree, &opal_timetree, ev);
@ -680,11 +740,13 @@ opal_timeout_insert(struct opal_event *ev)
tmp = RB_INSERT(opal_event_tree, &opal_timetree, ev); tmp = RB_INSERT(opal_event_tree, &opal_timetree, ev);
assert(tmp == NULL); assert(tmp == NULL);
#endif
} }
static void static void
opal_event_queue_remove(struct opal_event *ev, int queue) opal_event_queue_remove(struct opal_event *ev, int queue)
{ {
#if OPAL_HAVE_WORKING_EVENTOPS
if (!(ev->ev_flags & queue)) if (!(ev->ev_flags & queue))
errx(1, "%s: %p(fd %d) not on queue %x", __func__, errx(1, "%s: %p(fd %d) not on queue %x", __func__,
(void *) ev, ev->ev_fd, queue); (void *) ev, ev->ev_fd, queue);
@ -706,11 +768,13 @@ opal_event_queue_remove(struct opal_event *ev, int queue)
default: default:
errx(1, "%s: unknown queue %x", __func__, queue); errx(1, "%s: unknown queue %x", __func__, queue);
} }
#endif
} }
static void static void
opal_event_queue_insert(struct opal_event *ev, int queue) opal_event_queue_insert(struct opal_event *ev, int queue)
{ {
#if OPAL_HAVE_WORKING_EVENTOPS
if (ev->ev_flags & queue) if (ev->ev_flags & queue)
errx(1, "%s: %p(fd %d) already on queue %x", __func__, errx(1, "%s: %p(fd %d) already on queue %x", __func__,
(void *) ev, ev->ev_fd, queue); (void *) ev, ev->ev_fd, queue);
@ -732,10 +796,12 @@ opal_event_queue_insert(struct opal_event *ev, int queue)
default: default:
errx(1, "%s: unknown queue %x", __func__, queue); errx(1, "%s: unknown queue %x", __func__, queue);
} }
#endif
} }
void opal_event_active_i(struct opal_event * ev, int res, short ncalls) void opal_event_active_i(struct opal_event * ev, int res, short ncalls)
{ {
#if OPAL_HAVE_WORKING_EVENTOPS
/* We get different kinds of events, add them together */ /* We get different kinds of events, add them together */
if (ev->ev_flags & OPAL_EVLIST_ACTIVE) { if (ev->ev_flags & OPAL_EVLIST_ACTIVE) {
ev->ev_res |= res; ev->ev_res |= res;
@ -746,6 +812,5 @@ void opal_event_active_i(struct opal_event * ev, int res, short ncalls)
ev->ev_ncalls = ncalls; ev->ev_ncalls = ncalls;
ev->ev_pncalls = NULL; ev->ev_pncalls = NULL;
opal_event_queue_insert(ev, OPAL_EVLIST_ACTIVE); opal_event_queue_insert(ev, OPAL_EVLIST_ACTIVE);
#endif
} }

Просмотреть файл

@ -19,7 +19,9 @@
#include "ompi_config.h" #include "ompi_config.h"
#if OMPI_WANT_LIBLTDL
#include "libltdl/ltdl.h" #include "libltdl/ltdl.h"
#endif
#include "opal/class/opal_object.h" #include "opal/class/opal_object.h"
@ -124,6 +126,11 @@ OMPI_DECLSPEC int mca_base_component_find(const char *directory, const char *ty
/* mca_base_component_register.c */ /* mca_base_component_register.c */
#if ! OMPI_WANT_LIBLTDL
/* if we don't have libltdl, provide dummy handle type */
typedef void* lt_dlhandle;
#endif
OMPI_DECLSPEC int mca_base_component_repository_initialize(void); OMPI_DECLSPEC int mca_base_component_repository_initialize(void);
OMPI_DECLSPEC int mca_base_component_repository_retain(char *type, OMPI_DECLSPEC int mca_base_component_repository_retain(char *type,
lt_dlhandle component_handle, lt_dlhandle component_handle,

Просмотреть файл

@ -21,8 +21,10 @@
#include <ctype.h> #include <ctype.h>
#include <stdlib.h> #include <stdlib.h>
#if OMPI_WANT_LIBLTDL
/* Ensure to get the right <ltdl.h> */ /* Ensure to get the right <ltdl.h> */
#include "libltdl/ltdl.h" #include "libltdl/ltdl.h"
#endif
#include "include/constants.h" #include "include/constants.h"
#include "opal/util/output.h" #include "opal/util/output.h"
@ -72,6 +74,7 @@ struct ltfn_data_holder_t {
typedef struct ltfn_data_holder_t ltfn_data_holder_t; typedef struct ltfn_data_holder_t ltfn_data_holder_t;
#if OMPI_WANT_LIBLTDL
/* /*
* Private functions * Private functions
*/ */
@ -96,7 +99,7 @@ static const char *ompi_info_suffix = ".ompi_info";
static const char *key_dependency = "dependency="; static const char *key_dependency = "dependency=";
static const char component_template[] = "mca_%s_"; static const char component_template[] = "mca_%s_";
static opal_list_t found_files; static opal_list_t found_files;
#endif /* OMPI_WANT_LIBLTDL */
/* /*
* Function to find as many components of a given type as possible. This * Function to find as many components of a given type as possible. This
@ -127,20 +130,29 @@ int mca_base_component_find(const char *directory, const char *type,
opal_list_append(found_components, (opal_list_item_t *) cli); opal_list_append(found_components, (opal_list_item_t *) cli);
} }
#if OMPI_WANT_LIBLTDL
/* Find any available dynamic components in the specified directory */ /* Find any available dynamic components in the specified directory */
if (open_dso_components) { if (open_dso_components) {
find_dyn_components(directory, type, NULL, found_components); int param, param_disable_dlopen;
param = mca_base_param_find("base", NULL, "component_disable_dlopen");
mca_base_param_lookup_int(param, &param_disable_dlopen);
if (0 == param_disable_dlopen) {
find_dyn_components(directory, type, NULL, found_components);
}
} else { } else {
opal_output_verbose(40, 0, opal_output_verbose(40, 0,
"mca: base: component_find: dso loading for %s MCA components disabled", "mca: base: component_find: dso loading for %s MCA components disabled",
type); type);
} }
#endif
/* All done */ /* All done */
return OMPI_SUCCESS; return OMPI_SUCCESS;
} }
#if OMPI_WANT_LIBLTDL
/* /*
* Open up all directories in a given path and search for components of * Open up all directories in a given path and search for components of
@ -695,3 +707,5 @@ static void free_dependency_list(opal_list_t *dependencies)
} }
OBJ_DESTRUCT(dependencies); OBJ_DESTRUCT(dependencies);
} }
#endif /* OMPI_WANT_LIBLTDL */

Просмотреть файл

@ -23,14 +23,17 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#if OMPI_WANT_LIBLTDL
/* Ensure to get the right <ltdl.h> */ /* Ensure to get the right <ltdl.h> */
#include "libltdl/ltdl.h" #include "libltdl/ltdl.h"
#endif
#include "include/constants.h" #include "include/constants.h"
#include "opal/class/opal_list.h" #include "opal/class/opal_list.h"
#include "mca/mca.h" #include "mca/mca.h"
#include "mca/base/base.h" #include "mca/base/base.h"
#if OMPI_WANT_LIBLTDL
/* /*
* Private types * Private types
@ -60,11 +63,17 @@ static void di_destructor(opal_object_t *obj);
static OBJ_CLASS_INSTANCE(dependency_item_t, opal_list_item_t, static OBJ_CLASS_INSTANCE(dependency_item_t, opal_list_item_t,
di_constructor, di_destructor); di_constructor, di_destructor);
#endif /* OMPI_WANT_LIBLTDL */
/* /*
* Private variables * Private variables
*/ */
static bool initialized = false; static bool initialized = false;
#if OMPI_WANT_LIBLTDL
static opal_list_t repository; static opal_list_t repository;
@ -74,6 +83,8 @@ static opal_list_t repository;
static repository_item_t *find_component(const char *type, const char *name); static repository_item_t *find_component(const char *type, const char *name);
static int link_items(repository_item_t *src, repository_item_t *depend); static int link_items(repository_item_t *src, repository_item_t *depend);
#endif /* OMPI_WANT_LIBLTDL */
/* /*
* Initialize the repository * Initialize the repository
@ -83,7 +94,7 @@ int mca_base_component_repository_initialize(void)
/* Setup internal structures */ /* Setup internal structures */
if (!initialized) { if (!initialized) {
#if OMPI_WANT_LIBLTDL
/* Initialize libltdl */ /* Initialize libltdl */
if (lt_dlinit() != 0) { if (lt_dlinit() != 0) {
@ -91,6 +102,7 @@ int mca_base_component_repository_initialize(void)
} }
OBJ_CONSTRUCT(&repository, opal_list_t); OBJ_CONSTRUCT(&repository, opal_list_t);
#endif
initialized = true; initialized = true;
} }
@ -109,6 +121,7 @@ int mca_base_component_repository_retain(char *type,
lt_dlhandle component_handle, lt_dlhandle component_handle,
const mca_base_component_t *component_struct) const mca_base_component_t *component_struct)
{ {
#if OMPI_WANT_LIBLTDL
repository_item_t *ri; repository_item_t *ri;
/* Allocate a new repository item */ /* Allocate a new repository item */
@ -131,6 +144,9 @@ int mca_base_component_repository_retain(char *type,
/* All done */ /* All done */
return OMPI_SUCCESS; return OMPI_SUCCESS;
#else
return OMPI_ERR_NOT_SUPPORTED;
#endif
} }
@ -140,12 +156,16 @@ int mca_base_component_repository_retain(char *type,
int mca_base_component_repository_retain_component(const char *type, int mca_base_component_repository_retain_component(const char *type,
const char *name) const char *name)
{ {
#if OMPI_WANT_LIBLTDL
repository_item_t *ri = find_component(type, name); repository_item_t *ri = find_component(type, name);
if (NULL != ri) { if (NULL != ri) {
OBJ_RETAIN(ri); OBJ_RETAIN(ri);
return OMPI_SUCCESS; return OMPI_SUCCESS;
} }
return OMPI_ERR_NOT_FOUND; return OMPI_ERR_NOT_FOUND;
#else
return OMPI_ERR_NOT_SUPPORTED;
#endif
} }
@ -157,6 +177,7 @@ int mca_base_component_repository_link(const char *src_type,
const char *depend_type, const char *depend_type,
const char *depend_name) const char *depend_name)
{ {
#if OMPI_WANT_LIBLTDL
repository_item_t *src, *depend; repository_item_t *src, *depend;
/* Look up the two components */ /* Look up the two components */
@ -173,6 +194,9 @@ int mca_base_component_repository_link(const char *src_type,
/* Link them */ /* Link them */
return link_items(src, depend); return link_items(src, depend);
#else
return OMPI_ERR_NOT_SUPPORTED;
#endif
} }
@ -182,11 +206,13 @@ int mca_base_component_repository_link(const char *src_type,
*/ */
void mca_base_component_repository_release(const mca_base_component_t *component) void mca_base_component_repository_release(const mca_base_component_t *component)
{ {
#if OMPI_WANT_LIBLTDL
repository_item_t *ri = find_component(component->mca_type_name, repository_item_t *ri = find_component(component->mca_type_name,
component->mca_component_name); component->mca_component_name);
if (NULL != ri) { if (NULL != ri) {
OBJ_RELEASE(ri); OBJ_RELEASE(ri);
} }
#endif
} }
@ -195,10 +221,13 @@ void mca_base_component_repository_release(const mca_base_component_t *component
*/ */
void mca_base_component_repository_finalize(void) void mca_base_component_repository_finalize(void)
{ {
#if OMPI_WANT_LIBLTDL
opal_list_item_t *item; opal_list_item_t *item;
repository_item_t *ri; repository_item_t *ri;
#endif
if (initialized) { if (initialized) {
#if OMPI_WANT_LIBLTDL
/* Have to be slightly careful about this because of dependencies, /* Have to be slightly careful about this because of dependencies,
particularly on OS's where it matters (i.e., closing a particularly on OS's where it matters (i.e., closing a
@ -225,10 +254,13 @@ void mca_base_component_repository_finalize(void)
/* Close down libltdl */ /* Close down libltdl */
lt_dlexit(); lt_dlexit();
#endif
initialized = false; initialized = false;
} }
} }
#if OMPI_WANT_LIBLTDL
static repository_item_t *find_component(const char *type, const char *name) static repository_item_t *find_component(const char *type, const char *name)
{ {
@ -354,3 +386,5 @@ static void di_destructor(opal_object_t *obj)
OBJ_RELEASE(di->di_repository_entry); OBJ_RELEASE(di->di_repository_entry);
} }
#endif /* OMPI_WANT_LIBLTDL */

Просмотреть файл

@ -77,6 +77,9 @@ int mca_base_open(void)
mca_base_param_register_int("base", NULL, "component_show_load_errors", mca_base_param_register_int("base", NULL, "component_show_load_errors",
"component_show_load_errors", 0); "component_show_load_errors", 0);
mca_base_param_register_int("base", NULL, "component_disable_dlopen",
"component_disable_dlopen", 0);
/* What verbosity level do we want? */ /* What verbosity level do we want? */
mca_base_param_lookup_string(param_index, &value); mca_base_param_lookup_string(param_index, &value);

Просмотреть файл

@ -31,6 +31,7 @@
int opal_daemon_init(char *working_dir) int opal_daemon_init(char *working_dir)
{ {
#if defined(HAVE_FORK)
#ifndef WIN32 #ifndef WIN32
/* it seems that there is an entirely different way to write daemons in /* it seems that there is an entirely different way to write daemons in
WINDOWS land. Firstly, they are called services and the way to WINDOWS land. Firstly, they are called services and the way to
@ -47,7 +48,9 @@ int opal_daemon_init(char *working_dir)
} }
/* child continues */ /* child continues */
#if defined(HAVE_SETSID)
setsid(); /* become session leader */ setsid(); /* become session leader */
#endif
if (NULL != working_dir) { if (NULL != working_dir) {
chdir(working_dir); /* change working directory */ chdir(working_dir); /* change working directory */
@ -85,4 +88,8 @@ int opal_daemon_init(char *working_dir)
printf ("This function has not been implemented in windows yet, file %s line %d\n", __FILE__, __LINE__); printf ("This function has not been implemented in windows yet, file %s line %d\n", __FILE__, __LINE__);
abort(); abort();
#endif #endif
#else /* HAVE_FORK */
return OMPI_ERR_NOT_SUPPORTED;
#endif
} }

Просмотреть файл

@ -33,6 +33,7 @@
int opal_few(char *argv[], int *status) int opal_few(char *argv[], int *status)
{ {
#ifndef WIN32 #ifndef WIN32
#if defined(HAVE_FORK) && defined(HAVE_EXECVE) && defined(HAVE_WAITPID)
pid_t pid, ret; pid_t pid, ret;
if ((pid = fork()) < 0) { if ((pid = fork()) < 0) {
@ -73,6 +74,10 @@ int opal_few(char *argv[], int *status)
/* Return the status to the caller */ /* Return the status to the caller */
return OMPI_SUCCESS; return OMPI_SUCCESS;
#else
return OMPI_ERR_NOT_SUPPORTED;
#endif
#else #else
/* Welcome to windows land. This is apparently a simple fork() exec() /* Welcome to windows land. This is apparently a simple fork() exec()

Просмотреть файл

@ -38,6 +38,7 @@
#include "opal/threads/mutex.h" #include "opal/threads/mutex.h"
#include "opal/threads/condition.h" #include "opal/threads/condition.h"
#ifdef HAVE_WAITPID
/********************************************************************* /*********************************************************************
* *
@ -610,3 +611,54 @@ internal_waitpid_callback(int fd, short event, void *arg)
opal_condition_signal(&(data->cond)); opal_condition_signal(&(data->cond));
} }
#endif #endif
#else /* HAVE_WAITPID */
int
orte_wait_init(void) {
return OMPI_SUCCESS;
}
int
orte_wait_finalize(void)
{
return OMPI_SUCCESS;
}
pid_t
orte_waitpid(pid_t wpid, int *status, int options)
{
return OMPI_ERR_NOT_SUPPORTED;
}
int
orte_wait_cb(pid_t wpid, orte_wait_fn_t callback, void *data)
{
return OMPI_ERR_NOT_SUPPORTED;
}
int
orte_wait_cb_cancel(pid_t wpid)
{
return OMPI_ERR_NOT_SUPPORTED;
}
int
orte_wait_cb_disable(void)
{
return OMPI_ERR_NOT_SUPPORTED;
}
int
orte_wait_cb_enable(void)
{
return OMPI_ERR_NOT_SUPPORTED;
}
int
orte_wait_kill(int sig)
{
return OMPI_ERR_NOT_SUPPORTED;
}
#endif

Просмотреть файл

@ -138,6 +138,8 @@ int main(int argc, char *argv[])
int id, orted_pipe[2]; int id, orted_pipe[2];
pid_t pid; pid_t pid;
#if defined(HAVE_FORK) && defined(HAVE_PIPE)
/* setup to check common command line options that just report and die */ /* setup to check common command line options that just report and die */
memset(&orteprobe_globals, 0, sizeof(orteprobe_globals)); memset(&orteprobe_globals, 0, sizeof(orteprobe_globals));
cmd_line = OBJ_NEW(opal_cmd_line_t); cmd_line = OBJ_NEW(opal_cmd_line_t);
@ -443,4 +445,8 @@ fprintf(stderr, "attempting to read from daemon\n");
orte_finalize(); orte_finalize();
exit(0); exit(0);
#else /* HAVE_FORK && HAVE_PIPE */
fprintf(stderr, "orteprobe: system appears to not support remote probes\n");
exit(1);
#endif
} }