Skip to content
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

First attempt at metis partitioner #878

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from
Open
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
53 changes: 53 additions & 0 deletions config/sst_check_metis.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
AC_DEFUN([SST_CHECK_METIS],
[
sst_check_metis_happy="yes"
sst_check_metis_requested="yes"

AC_ARG_WITH([metis],
[AS_HELP_STRING([--with-metis@<:@=DIR@:>@],
[Use Metis package installed in optionally specified DIR])],
[sst_check_metis_requested="yes"],
[sst_check_metis_requested="no"])

AS_IF([test "x$with_metis" = "xno"], [sst_check_metis_happy="no"])

CPPFLAGS_saved="$CPPFLAGS"
LDFLAGS_saved="$LDFLAGS"
CXX_saved="$CXX"
CC_saved="$CC"

AS_IF([test "x$MPICXX" != "x"], [CXX="$MPICXX"])
AS_IF([test "x$MPICC" != "x"], [CC="$MPICC"])

AS_IF([test "$sst_check_metis_happy" = "yes"], [
AS_IF([test ! -z "$with_metis" -a "$with_metis" != "yes"],
[METIS_CPPFLAGS="-I$with_metis/include"
CPPFLAGS="$METIS_CPPFLAGS $CPPFLAGS"
METIS_LDFLAGS="-L$with_metis/lib"
LDFLAGS="$METIS_LDFLAGS $LDFLAGS"],
[METIS_CPPFLAGS=
METIS_LDFLAGS=])

AC_CHECK_HEADERS([metis.h], [], [sst_check_metis_happy="no"])
AC_CHECK_LIB([metis], [METIS_PartGraphKway],
[METIS_LIB="-lmetis"], [sst_check_metis_happy="no"], [-lm])])

CPPFLAGS="$CPPFLAGS_saved"
LDFLAGS="$LDFLAGS_saved"
CXX="$CXX_saved"
CC="$CC_saved"

AC_SUBST([METIS_CPPFLAGS])
AC_SUBST([METIS_LDFLAGS])
AC_SUBST([METIS_LIB])

AC_MSG_CHECKING([for Metis package])
AC_MSG_RESULT([$sst_check_metis_happy])

# if user doesn't specify --with-metis then string is empty, otherwise is has a value
# if the value is not "no" then we treat as a path, and MUST find in order to be
# successful
AS_IF([test "x$sst_check_metis_requested" = "xyes" -a "x$sst_check_metis_happy" != "xyes"],
[AC_MSG_FAILURE([Metis was requested by configure (--with-metis=$with_metis) but the required libraries and header files could not be found.])])
AS_IF([test "$sst_check_metis_happy" = "yes"], [$1], [$2])
])
10 changes: 10 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ SST_ENABLE_CORE_PROFILE()

SST_CHECK_FPIC()

SST_CHECK_METIS([have_metis=1],[have_metis=0],[AC_MSG_ERROR([Metis requested but not found])])
AS_IF([test "x$have_metis" = "x1"], [AC_DEFINE_UNQUOTED([HAVE_METIS], [1],
[Define if you have the metis library.])])
AM_CONDITIONAL([HAVE_METIS], [test "$have_metis" = 1])

AC_DEFINE_UNQUOTED([SST_CPPFLAGS], ["$CPPFLAGS"], [Defines the CPPFLAGS used to build SST])
AC_DEFINE_UNQUOTED([SST_CFLAGS], ["$CFLAGS"], [Defines the CFLAGS used to build SST])
AC_DEFINE_UNQUOTED([SST_CXXFLAGS], ["$CXXFLAGS"], [Defines the CXXFLAGS used to build SST])
Expand Down Expand Up @@ -231,6 +236,11 @@ if test "x$PYTHON_VERSION3" = "xyes" ; then
else
printf "%38s : No\n" "Python3"
fi
if test "x$sst_check_metis_happy" = "xyes" ; then
printf "%38s : YES\n" "Metis Partitioner"
else
printf "%38s : No\n" "Metis Partitioner"
fi
if test "x$sst_check_hdf5_happy" = "xyes" ; then
printf "%38s : Yes\n" "HDF5 Support"
else
Expand Down
5 changes: 5 additions & 0 deletions src/sst/core/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ AM_CPPFLAGS = \
-DTIXML_USE_STL \
-DSST_BUILDING_CORE=1 \
$(ZOLTAN_CPPFLAGS) \
$(METIS_CPPFLAGS) \
$(PYTHON_CPPFLAGS) \
-I$(top_srcdir)/external \
$(LTDLINCL)
Expand Down Expand Up @@ -278,6 +279,7 @@ sstinfo_x_SOURCES = \
sstsim_x_LDADD = \
$(PYTHON_LIBS) \
$(ZOLTAN_LIB) \
$(METIS_LIB) \
$(PARMETIS_LIB) \
$(MPILIBS) \
$(TCMALLOC_LIB) \
Expand All @@ -286,6 +288,7 @@ sstsim_x_LDADD = \
sstsim_x_LDFLAGS = \
$(PARMETIS_LDFLAGS) \
$(ZOLTAN_LDFLAGS) \
$(METIS_LDFLAGS) \
$(TCMALLOC_LDFLAGS) \
$(PYTHON_LDFLAGS) \
-export-dynamic \
Expand All @@ -294,13 +297,15 @@ sstsim_x_LDFLAGS = \
sstinfo_x_LDADD = \
$(ZOLTAN_LIB) \
$(PARMETIS_LIB) \
$(METIS_LIB) \
$(MPILIBS) \
$(TCMALLOC_LIB) \
-lm

sstinfo_x_LDFLAGS = \
$(PARMETIS_LDFLAGS) \
$(ZOLTAN_LDFLAGS) \
$(METIS_LDFLAGS) \
$(TCMALLOC_LDFLAGS) \
$(PYTHON_LDFLAGS) \
-export-dynamic \
Expand Down
8 changes: 8 additions & 0 deletions src/sst/core/impl/partitioners/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,11 @@ sst_core_sources += \
impl/partitioners/simplepart.h \
impl/partitioners/singlepart.cc \
impl/partitioners/singlepart.h

if HAVE_METIS
sst_core_sources += \
impl/partitioners/util.hpp \
impl/partitioners/csrmat.hpp \
impl/partitioners/metispart.h \
impl/partitioners/metispart.cc
endif
Loading