Skip to content

rework argobots configury to be smarter #7675

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -674,3 +674,4 @@ test/util/bipartite_graph

opal/test/reachable/reachable_netlink
opal/test/reachable/reachable_weighted
opal/mca/threads/argobots/threads_argobots.h
29 changes: 26 additions & 3 deletions opal/mca/threads/argobots/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
# $HEADER$
#

noinst_LTLIBRARIES = libmca_threads_argobots.la
AM_CPPFLAGS = $(opal_argo_CPPFLAGS)

libmca_threads_argobots_la_SOURCES = \
sources = \
threads_argobots.h \
threads_argobots_component.c \
threads_argobots_condition.c \
Expand All @@ -32,4 +32,27 @@ libmca_threads_argobots_la_SOURCES = \
threads_argobots_wait_sync.c \
threads_argobots_wait_sync.h

AM_LDFLAGS = -labt
#lib = libmca_threads_argobots.la
lib_sources = $(sources)

if MCA_BUILD_opal_threads_argobots_DSO
component_noinst =
component_install = mca_threads_argobots.la
else
component_noinst = libmca_threads_argobots.la
component_install =
endif

mcacomponentdir = $(opallibdir)
mcacomponent_LTLIBRARIES = $(component_install)
mca_threads_argobots_la_SOURCES = $(sources)
mca_threads_argobots_la_LDFLAGS = -module -avoid-version
mca_threads_argobots_la_LIBADD = $(top_builddir)/opal/lib@[email protected] \
$(opal_argo_LIBS)

noinst_LTLIBRARIES = $(component_noinst)
libmca_threads_argobots_la_SOURCES = $(sources)
libmca_threads_argobots_la_LDFLAGS = -module -avoid-version $(opal_argo_LDFLAGS)
libmca_threads_argobots_la_LIBADD = $(opal_argo_LIBS)


83 changes: 77 additions & 6 deletions opal/mca/threads/argobots/configure.m4
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,68 @@
#

AC_DEFUN([OPAL_CONFIG_ARGOBOTS_THREADS],[
AC_CHECK_HEADERS([abt.h],
[AC_CHECK_LIB([abt],[ABT_init],
[threads_argobots_happy="yes"],
[threads_argobots_happy="no"])],
[threads_argobots_happy="no"])

AS_IF([test "$threads_argobots_happy" = "yes"],
AC_ARG_WITH([argobots],
[AC_HELP_STRING([--with-argobots=DIR],
[Specify location of argobots installation. Error if argobots support cannot be found.])])

AC_ARG_WITH([argobots-libdir],
[AC_HELP_STRING([--with-argobots-libdir=DIR],
[Search for argobots libraries in DIR])])

opal_check_argo_save_CPPFLAGS=$CPPFLAGS
opal_check_argo_save_LDFLAGS=$LDFLAGS
opal_check_argo_save_LIBS=$LIBS

opal_argo_happy=yes
AS_IF([test "$with_argo" = "no"],
[opal_argo_happy=no])

AS_IF([test $opal_argo_happy = yes],
[AC_MSG_CHECKING([looking for argobots in])
AS_IF([test "$with_argobots" != "yes"],
[opal_argo_dir=$with_argobots
AC_MSG_RESULT([($opal_argo_dir)])],
[AC_MSG_RESULT([(default search paths)])])
AS_IF([test ! -z "$with_argobots_libdir" && \
test "$with_argobots_libdir" != "yes"],
[opal_argo_libdir=$with_argobots_libdir])
])

AS_IF([test $opal_argo_happy = yes],
[OPAL_CHECK_PACKAGE([opal_argo],
[abt.h],
[abt],
[ABT_init],
[],
[$opal_argo_dir],
[$opal_argo_libdir],
[],
[opal_argo_happy=no])])

AS_IF([test $opal_argo_happy = yes && test -n "$opal_argo_dir"],
[OPAL_ARGO_INCLUDE_PATH="$opal_argo_dir/include/"],
[OPAL_ARGO_INCLUDE_PATH=""])

AS_IF([test $opal_argo_happy = yes],
[AC_CONFIG_FILES([opal/mca/threads/argobots/threads_argobots.h])
AC_SUBST([OPAL_ARGO_INCLUDE_PATH])
AC_SUBST([opal_argo_CPPFLAGS])
AC_SUBST([opal_argo_LDFLAGS])
AC_SUBST([opal_argo_LIBS])
TPKG_CFLAGS="$opal_argo_CPPFLAGS"
TPKG_FCFLAGS="$opal_argo_CPPFLAGS"
TPKG_CXXFLAGS="$opal_argo_CPPFLAGS"
TPKG_CPPFLAGS="$opal_argo_CPPFLAGS"
TPKG_CXXCPPFLAGS="$opal_argo_CPPFLAGS"
TPKG_LDFLAGS="$opal_argo_LDFLAGS"
TPKG_LIBS="$opal_argo_LIBS"])

CPPFLAGS=$opal_check_argo_save_CPPFLAGS
LDFLAGS=$opal_check_argo_save_LDFLAGS
LIBS=$opal_check_argo_save_LIBS

AS_IF([test "$opal_argo_happy" = "yes"],
[$1],
[$2])
])dnl
Expand All @@ -44,6 +99,7 @@ AC_DEFUN([MCA_opal_threads_argobots_COMPILE_MODE], [
AC_MSG_RESULT([$$4])
])


# If component was selected, $1 will be 1 and we should set the base header
AC_DEFUN([MCA_opal_threads_argobots_POST_CONFIG],[
AS_IF([test "$1" = "1"],
Expand All @@ -60,6 +116,21 @@ AC_DEFUN([MCA_opal_threads_argobots_POST_CONFIG],[
AC_DEFINE_UNQUOTED([MCA_threads_wait_sync_base_include_HEADER],
["opal/mca/threads/argobots/threads_argobots_wait_sync.h"],
[Header to include for wait_sync implementation])
THREAD_CFLAGS="$TPKG_CFLAGS"
THREAD_FCFLAGS="$TPKG_FCFLAGS"
THREAD_CXXFLAGS="$TPKG_CXXFLAGS"
THREAD_CPPFLAGS="$TPKG_CPPFLAGS"
THREAD_CXXCPPFLAGS="$TPKG_CXXCPPFLAGS"
THREAD_LDFLAGS="$TPKG_LDFLAGS"
THREAD_LIBS="$TPKG_LIBS"
AC_SUBST(THREAD_CFLAGS)
AC_SUBST(THREAD_FCFLAGS)
AC_SUBST(THREAD_CXXFLAGS)
AC_SUBST(THREAD_CPPFLAGS)
AC_SUBST(THREAD_LDFLAGS)
AC_SUBST(THREAD_LIBS)
LIBS="$LIBS $THREAD_LIBS"
LDFLAGS="$LDFLAGS $THREAD_LDFLAGS"
])

])dnl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#ifndef OPAL_MCA_THREADS_ARGOBOTS_THREADS_ARGOBOTS_H
#define OPAL_MCA_THREADS_ARGOBOTS_THREADS_ARGOBOTS_H

#include <abt.h>
#include "@OPAL_ARGO_INCLUDE_PATH@abt.h"

static inline void opal_threads_argobots_ensure_init(void)
{
Expand Down
1 change: 0 additions & 1 deletion opal/mca/threads/argobots/threads_argobots_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include "opal/mca/threads/thread.h"
#include "opal/mca/threads/threads.h"
#include "opal/constants.h"
#include <abt.h>

static int opal_threads_argobots_open(void);

Expand Down
2 changes: 0 additions & 2 deletions opal/mca/threads/argobots/threads_argobots_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
#include "opal/mca/threads/threads.h"
#include "opal/mca/threads/tsd.h"

#include <abt.h>

struct opal_tsd_key_value {
opal_tsd_key_t key;
opal_tsd_destructor_t destructor;
Expand Down
1 change: 0 additions & 1 deletion opal/mca/threads/argobots/threads_argobots_mutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
#include "opal/sys/atomic.h"
#include "opal/util/output.h"

#include <abt.h>

BEGIN_C_DECLS

Expand Down
2 changes: 1 addition & 1 deletion opal/mca/threads/argobots/threads_argobots_threads.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
#ifndef OPAL_MCA_THREADS_ARGOBOTS_THREADS_ARGOBOTS_THREADS_H
#define OPAL_MCA_THREADS_ARGOBOTS_THREADS_ARGOBOTS_THREADS_H

#include <abt.h>
#include <signal.h>
#include "opal/mca/threads/argobots/threads_argobots.h"

struct opal_thread_t {
opal_object_t super;
Expand Down
1 change: 0 additions & 1 deletion opal/mca/threads/argobots/threads_argobots_tsd.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#define OPAL_MCA_THREADS_ARGOBOTS_THREADS_ARGOBOTS_TSD_H

#include "opal/mca/threads/argobots/threads_argobots.h"
#include <abt.h>

typedef ABT_key opal_tsd_key_t;

Expand Down
1 change: 0 additions & 1 deletion opal/mca/threads/argobots/threads_argobots_wait_sync.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#define OPAL_MCA_THREADS_ARGOBOTS_THREADS_ARGOBOTS_WAIT_SYNC_H

#include "opal/mca/threads/argobots/threads_argobots.h"
#include <abt.h>

typedef struct ompi_wait_sync_t {
opal_atomic_int32_t count;
Expand Down