From b00f3dcaa28e6954bdcfd192b002133c23514523 Mon Sep 17 00:00:00 2001 From: Matthieu Schaller Date: Mon, 28 May 2018 15:59:09 +0200 Subject: [PATCH 1/6] Make sure all the GNU builtins for malloc and friends are switched off when compiling with tcmalloc and jemalloc. --- configure.ac | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 56018272d..836cdaf94 100644 --- a/configure.ac +++ b/configure.ac @@ -660,10 +660,13 @@ if test "x$with_tcmalloc" != "xno"; then if test "$have_tcmalloc" = "yes"; then TCMALLOC_LIBS="$tclibs" - # These are recommended for GCC. - if test "$ax_cv_c_compiler_vendor" = "gnu"; then - CFLAGS="$CFLAGS -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free" - fi + # Prevent compilers that replace the calls within built-ins (GNU 99) from doing so. + case "$ax_cv_c_compiler_vendor" in + intel | gnu | clang) + CFLAGS="$CFLAGS -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free" + ;; + esac + else TCMALLOC_LIBS="" fi @@ -720,6 +723,14 @@ if test "x$with_jemalloc" != "xno"; then if test "$have_jemalloc" = "yes"; then JEMALLOC_LIBS="$jelibs" + + # Prevent compilers that replace the regular calls within built-ins (GNU 99) from doing so. + case "$ax_cv_c_compiler_vendor" in + intel | gnu | clang) + CFLAGS="$CFLAGS -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free" + ;; + esac + else JEMALLOC_LIBS="" fi -- GitLab From 77e916ad030fc8dbb7dcd47375994d5232f8c81c Mon Sep 17 00:00:00 2001 From: Matthieu Schaller Date: Mon, 28 May 2018 23:23:46 +0200 Subject: [PATCH 2/6] Add a configuration flag to link a version of TBBmalloc instead of the standard one. --- configure.ac | 120 +++++++++++++++++++++++++++++++------------ examples/Makefile.am | 2 +- src/Makefile.am | 2 +- tests/Makefile.am | 2 +- 4 files changed, 89 insertions(+), 37 deletions(-) diff --git a/configure.ac b/configure.ac index 836cdaf94..31407a7b7 100644 --- a/configure.ac +++ b/configure.ac @@ -628,6 +628,38 @@ AC_SUBST([FFTW_LIBS]) AC_SUBST([FFTW_INCS]) AM_CONDITIONAL([HAVEFFTW],[test -n "$FFTW_LIBS"]) +# Check for -lprofiler usually part of the gperftools along with tcmalloc. +have_profiler="no" +AC_ARG_WITH([profiler], + [AS_HELP_STRING([--with-profiler], + [use cpu profiler library or specify the directory with lib @<:@yes/no@:>@] + )], + [with_profiler="$withval"], + [with_profiler="no"] +) +if test "x$with_profiler" != "xno"; then + if test "x$with_profiler" != "xyes" -a "x$with_profiler" != "x"; then + proflibs="-L$with_profiler -lprofiler" + else + proflibs="-lprofiler" + fi + AC_CHECK_LIB([profiler],[ProfilerFlush], + [have_profiler="yes" + AC_DEFINE([WITH_PROFILER],1,[Link against the gperftools profiling library.])], + [have_profiler="no"], $proflibs) + + if test "$have_profiler" = "yes"; then + PROFILER_LIBS="$proflibs" + else + PROFILER_LIBS="" + fi +fi +AC_SUBST([PROFILER_LIBS]) +AM_CONDITIONAL([HAVEPROFILER],[test -n "$PROFILER_LIBS"]) + +# Check for special allocators +have_special_allocator="no" + # Check for tcmalloc a fast malloc that is part of the gperftools. have_tcmalloc="no" AC_ARG_WITH([tcmalloc], @@ -637,6 +669,10 @@ AC_ARG_WITH([tcmalloc], [with_tcmalloc="$withval"], [with_tcmalloc="no"] ) +if test "x$with_tcmalloc" != "xno" -a "x$have_special_allocator" != "xno"; then + AC_MSG_ERROR("Cannot activate more than one alternative malloc library") +fi + if test "x$with_tcmalloc" != "xno"; then if test "x$with_tcmalloc" != "xyes" -a "x$with_tcmalloc" != "x"; then tclibs="-L$with_tcmalloc -ltcmalloc" @@ -660,7 +696,9 @@ if test "x$with_tcmalloc" != "xno"; then if test "$have_tcmalloc" = "yes"; then TCMALLOC_LIBS="$tclibs" - # Prevent compilers that replace the calls within built-ins (GNU 99) from doing so. + have_special_allocator="yes" + + # Prevent compilers that replace the calls with built-ins (GNU 99) from doing so. case "$ax_cv_c_compiler_vendor" in intel | gnu | clang) CFLAGS="$CFLAGS -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free" @@ -674,35 +712,6 @@ fi AC_SUBST([TCMALLOC_LIBS]) AM_CONDITIONAL([HAVETCMALLOC],[test -n "$TCMALLOC_LIBS"]) -# Check for -lprofiler usually part of the gperftools along with tcmalloc. -have_profiler="no" -AC_ARG_WITH([profiler], - [AS_HELP_STRING([--with-profiler], - [use cpu profiler library or specify the directory with lib @<:@yes/no@:>@] - )], - [with_profiler="$withval"], - [with_profiler="no"] -) -if test "x$with_profiler" != "xno"; then - if test "x$with_profiler" != "xyes" -a "x$with_profiler" != "x"; then - proflibs="-L$with_profiler -lprofiler" - else - proflibs="-lprofiler" - fi - AC_CHECK_LIB([profiler],[ProfilerFlush], - [have_profiler="yes" - AC_DEFINE([WITH_PROFILER],1,[Link against the gperftools profiling library.])], - [have_profiler="no"], $proflibs) - - if test "$have_profiler" = "yes"; then - PROFILER_LIBS="$proflibs" - else - PROFILER_LIBS="" - fi -fi -AC_SUBST([PROFILER_LIBS]) -AM_CONDITIONAL([HAVEPROFILER],[test -n "$PROFILER_LIBS"]) - # Check for jemalloc another fast malloc that is good with contention. have_jemalloc="no" AC_ARG_WITH([jemalloc], @@ -712,6 +721,10 @@ AC_ARG_WITH([jemalloc], [with_jemalloc="$withval"], [with_jemalloc="no"] ) +if test "x$with_jemalloc" != "xno" -a "x$have_special_allocator" != "xno"; then + AC_MSG_ERROR("Cannot activate more than one alternative malloc library") +fi + if test "x$with_jemalloc" != "xno"; then if test "x$with_jemalloc" != "xyes" -a "x$with_jemalloc" != "x"; then jelibs="-L$with_jemalloc -ljemalloc" @@ -724,7 +737,9 @@ if test "x$with_jemalloc" != "xno"; then if test "$have_jemalloc" = "yes"; then JEMALLOC_LIBS="$jelibs" - # Prevent compilers that replace the regular calls within built-ins (GNU 99) from doing so. + have_special_allocator="yes" + + # Prevent compilers that replace the regular calls with built-ins (GNU 99) from doing so. case "$ax_cv_c_compiler_vendor" in intel | gnu | clang) CFLAGS="$CFLAGS -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free" @@ -738,10 +753,46 @@ fi AC_SUBST([JEMALLOC_LIBS]) AM_CONDITIONAL([HAVEJEMALLOC],[test -n "$JEMALLOC_LIBS"]) -# Don't allow both tcmalloc and jemalloc. -if test "x$have_tcmalloc" != "xno" -a "x$have_jemalloc" != "xno"; then - AC_MSG_ERROR([Cannot use tcmalloc at same time as jemalloc]) +# Check for tbbmalloc, Intel's fast and parallel allocator +have_tbbmalloc="no" +AC_ARG_WITH([tbbmalloc], + [AS_HELP_STRING([--with-tbbmalloc], + [use tbbmalloc library or specify the directory with lib @<:@yes/no@:>@] + )], + [with_tbbmalloc="$withval"], + [with_tbbmalloc="no"] +) +if test "x$with_tbbmalloc" != "xno" -a "x$have_special_allocator" != "xno"; then + AC_MSG_ERROR("Cannot activate more than one alternative malloc library") +fi + +if test "x$with_tbbmalloc" != "xno"; then + if test "x$with_tbbmalloc" != "xyes" -a "x$with_tbbmalloc" != "x"; then + tbblibs="-L$with_tbbmalloc -ltbbmalloc_proxy -ltbbmalloc" + else + tbblibs="-ltbbmalloc_proxy -ltbbmalloc" + fi + AC_CHECK_LIB([tbbmalloc],[scalable_malloc],[have_tbbmalloc="yes"],[have_tbbmalloc="no"], + $tbblibs) + + if test "$have_tbbmalloc" = "yes"; then + TBBMALLOC_LIBS="$tbblibs" + + have_special_allocator="yes" + + # Prevent compilers that replace the calls with built-ins (GNU 99) from doing so. + case "$ax_cv_c_compiler_vendor" in + intel | gnu | clang) + CFLAGS="$CFLAGS -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free" + ;; + esac + + else + TBBMALLOC_LIBS="" + fi fi +AC_SUBST([TBBMALLOC_LIBS]) +AM_CONDITIONAL([HAVETBBMALLOC],[test -n "$TBBMALLOC_LIBS"]) # Check for HDF5. This is required. AX_LIB_HDF5 @@ -1243,6 +1294,7 @@ AC_MSG_RESULT([ GSL enabled : $have_gsl libNUMA enabled : $have_numa GRACKLE enabled : $have_grackle + Using tbbmalloc : $have_tbbmalloc Using tcmalloc : $have_tcmalloc Using jemalloc : $have_jemalloc CPU profiler : $have_profiler diff --git a/examples/Makefile.am b/examples/Makefile.am index 95057c9be..9de393ba6 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -24,7 +24,7 @@ AM_CFLAGS = -I$(top_srcdir)/src $(HDF5_CPPFLAGS) $(GSL_INCS) $(FFTW_INCS) AM_LDFLAGS = $(HDF5_LDFLAGS) # Extra libraries. -EXTRA_LIBS = $(HDF5_LIBS) $(FFTW_LIBS) $(PROFILER_LIBS) $(TCMALLOC_LIBS) $(JEMALLOC_LIBS) $(GRACKLE_LIBS) $(GSL_LIBS) +EXTRA_LIBS = $(HDF5_LIBS) $(FFTW_LIBS) $(PROFILER_LIBS) $(TCMALLOC_LIBS) $(JEMALLOC_LIBS) $(TBBMALLOC_LIBS) $(GRACKLE_LIBS) $(GSL_LIBS) # MPI libraries. MPI_LIBS = $(METIS_LIBS) $(MPI_THREAD_LIBS) diff --git a/src/Makefile.am b/src/Makefile.am index 374d2c456..d89133d3f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -25,7 +25,7 @@ AM_LDFLAGS = $(HDF5_LDFLAGS) $(FFTW_LIBS) -version-info 0:0:0 GIT_CMD = @GIT_CMD@ # Additional dependencies for shared libraries. -EXTRA_LIBS = $(HDF5_LIBS) $(PROFILER_LIBS) $(TCMALLOC_LIBS) $(JEMALLOC_LIBS) $(GRACKLE_LIB) $(GSL_LIBS) +EXTRA_LIBS = $(HDF5_LIBS) $(FFTW_LIBS) $(PROFILER_LIBS) $(TCMALLOC_LIBS) $(JEMALLOC_LIBS) $(TBBMALLOC_LIBS) $(GRACKLE_LIB) $(GSL_LIBS) # MPI libraries. MPI_LIBS = $(METIS_LIBS) $(MPI_THREAD_LIBS) diff --git a/tests/Makefile.am b/tests/Makefile.am index 891eef3f5..564076ed5 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -17,7 +17,7 @@ # Add the source directory and the non-standard paths to the included library headers to CFLAGS AM_CFLAGS = -I$(top_srcdir)/src $(HDF5_CPPFLAGS) $(GSL_INCS) $(FFTW_INCS) -AM_LDFLAGS = ../src/.libs/libswiftsim.a $(HDF5_LDFLAGS) $(HDF5_LIBS) $(FFTW_LIBS) $(GRACKLE_LIBS) $(GSL_LIBS) $(PROFILER_LIBS) +AM_LDFLAGS = ../src/.libs/libswiftsim.a $(HDF5_LDFLAGS) $(HDF5_LIBS) $(FFTW_LIBS) $(TCMALLOC_LIBS) $(JEMALLOC_LIBS) $(TBBMALLOC_LIBS) $(GRACKLE_LIBS) $(GSL_LIBS) $(PROFILER_LIBS) # List of programs and scripts to run in the test suite TESTS = testGreetings testMaths testReading.sh testSingle testKernel testSymmetry \ -- GitLab From ec52c170005b074f7095863e8a5514ec135faf58 Mon Sep 17 00:00:00 2001 From: Matthieu Schaller Date: Mon, 28 May 2018 23:39:30 +0200 Subject: [PATCH 3/6] Write the allocator library in the snapshots to match what is done for other libraries we link against. --- configure.ac | 6 ++++++ src/common_io.c | 1 + src/version.c | 20 ++++++++++++++++++++ src/version.h | 1 + 4 files changed, 28 insertions(+) diff --git a/configure.ac b/configure.ac index 31407a7b7..710e745ec 100644 --- a/configure.ac +++ b/configure.ac @@ -696,6 +696,8 @@ if test "x$with_tcmalloc" != "xno"; then if test "$have_tcmalloc" = "yes"; then TCMALLOC_LIBS="$tclibs" + AC_DEFINE([HAVE_TCMALLOC],1,[The tc-malloc library appears to be present.]) + have_special_allocator="yes" # Prevent compilers that replace the calls with built-ins (GNU 99) from doing so. @@ -737,6 +739,8 @@ if test "x$with_jemalloc" != "xno"; then if test "$have_jemalloc" = "yes"; then JEMALLOC_LIBS="$jelibs" + AC_DEFINE([HAVE_JEMALLOC],1,[The je-malloc library appears to be present.]) + have_special_allocator="yes" # Prevent compilers that replace the regular calls with built-ins (GNU 99) from doing so. @@ -778,6 +782,8 @@ if test "x$with_tbbmalloc" != "xno"; then if test "$have_tbbmalloc" = "yes"; then TBBMALLOC_LIBS="$tbblibs" + AC_DEFINE([HAVE_TBBMALLOC],1,[The TBB-malloc library appears to be present.]) + have_special_allocator="yes" # Prevent compilers that replace the calls with built-ins (GNU 99) from doing so. diff --git a/src/common_io.c b/src/common_io.c index 8b173adb7..88374e30c 100644 --- a/src/common_io.c +++ b/src/common_io.c @@ -340,6 +340,7 @@ void io_write_code_description(hid_t h_file) { io_write_attribute_s(h_grpcode, "CFLAGS", compilation_cflags()); io_write_attribute_s(h_grpcode, "HDF5 library version", hdf5_version()); io_write_attribute_s(h_grpcode, "Thread barriers", thread_barrier_version()); + io_write_attribute_s(h_grpcode, "Allocators", allocator_version()); #ifdef HAVE_FFTW io_write_attribute_s(h_grpcode, "FFTW library version", fftw3_version()); #endif diff --git a/src/version.c b/src/version.c index 54749721d..a0a2ae42a 100644 --- a/src/version.c +++ b/src/version.c @@ -368,6 +368,26 @@ const char *thread_barrier_version(void) { return version; } +/** + * @brief return the allocator library used in SWIFT. + * + * @result description of the allocation library + */ +const char *allocator_version(void) { + + static char version[256] = {0}; +#if defined(HAVE_TBBMALLOC) + sprintf(version, "TBB malloc"); +#elif defined(HAVE_TCMALLOC) + sprintf(version, "tc-malloc"); +#elif defined(HAVE_JEMALLOC) + sprintf(version, "je-malloc"); +#else + sprintf(version, "Compiler version (probably glibc)"); +#endif + return version; +} + /** * @brief Prints a greeting message to the standard output containing code * version and revision number diff --git a/src/version.h b/src/version.h index 3163f242c..44119b6a3 100644 --- a/src/version.h +++ b/src/version.h @@ -36,6 +36,7 @@ const char* hdf5_version(void); const char* fftw3_version(void); const char* libgsl_version(void); const char* thread_barrier_version(void); +const char* allocator_version(void); void greetings(void); #endif /* SWIFT_VERSION_H */ -- GitLab From 4e6c833bf7e2b0c8d066fac1d59de264f0799698 Mon Sep 17 00:00:00 2001 From: Matthieu Schaller Date: Tue, 29 May 2018 10:00:08 +0200 Subject: [PATCH 4/6] Updated the INSTALL.swift file with the new configuration options. --- INSTALL.swift | 109 +++++++++++++++++++++++++++++--------------------- 1 file changed, 63 insertions(+), 46 deletions(-) diff --git a/INSTALL.swift b/INSTALL.swift index 1782b75e3..98e258824 100644 --- a/INSTALL.swift +++ b/INSTALL.swift @@ -96,16 +96,20 @@ SWIFT depends on a number of third party libraries that should be available before you can build it. - - HDF5: a HDF5 library (v. 1.8.x or higher) is required to read and - write particle data. One of the commands "h5cc" or "h5pcc" - should be available. If "h5pcc" is located them a parallel - HDF5 built for the version of MPI located should be - provided. If the command is not available then it can be - located using the "--with-hfd5" configure option. The value - should be the full path to the "h5cc" or "h5pcc" commands. - - - - MPI: to run on more than one node an MPI library that fully + - HDF5: + A HDF5 library (v. 1.8.x or higher) is required to read and + write particle data. One of the commands "h5cc" or "h5pcc" + should be available. If "h5pcc" is located them a parallel + HDF5 built for the version of MPI located should be + provided. If the command is not available then it can be + located using the "--with-hfd5" configure option. The value + should be the full path to the "h5cc" or "h5pcc" commands. + SWIFT can make a very effective use of a parallel build of the + library when running on more than one node. This is highly + recommended. + + - MPI: + To run on more than one node an MPI library that fully supports MPI_THREAD_MULTIPLE. Before running configure the "mpirun" command should be available in the shell. If your command isn't called "mpirun" then define the "MPIRUN" @@ -116,50 +120,63 @@ before you can build it. much like the CC one. Use this when your MPI compiler has a none-standard name. - - GSL: To use cosmological time integration, a version of the GSL - must be available. - - - libtool: The build system relies on libtool as well as the other autotools. - - - Optional Dependencies - ===================== - - - - METIS: a build of the METIS library can be optionally used to - optimize the load between MPI nodes (requires an MPI - library). This should be found in the standard installation - directories, or pointed at using the "--with-metis" - configuration option. In this case the top-level - installation directory of the METIS build should be - given. Note to use METIS you should at least supply - "--with-metis". + - GSL: + To use cosmological time integration, a version of the GSL + must be available. + - FFTW 3.x: + To run with periodic gravity forces, a build of the fftw 3 + library must be available. Note that SWIFT does not make use + of the parallel capability of FFTW. Calculations are done by + single MPI nodes independently. - - libNUMA: a build of the NUMA library can be used to pin the threads - to the physical core of the machine SWIFT is running - on. This is not always necessary as the OS scheduler may - do a good job at distributing the threads among the - different cores on each computing node. +- libtool: + The build system relies on libtool as well as the other autotools. - - TCMalloc: a build of the TCMalloc library (part of gperftools) can - be used to obtain faster allocations than the standard C - malloc function part of glibc. The option "-with-tcmalloc" - should be passed to the configuration script to use it. - - - gperftools: a build of gperftools can be used to obtain good - profiling of the code. The option "-with-profiler" - needs to be passed to the configuration script to use - it. + Optional Dependencies + ===================== - - DOXYGEN: the doxygen library is required to create the SWIFT API - documentation. + - METIS: + a build of the METIS library can be optionally used to + optimize the load between MPI nodes (requires an MPI + library). This should be found in the standard installation + directories, or pointed at using the "--with-metis" + configuration option. In this case the top-level installation + directory of the METIS build should be given. Note to use + METIS you should at least supply "--with-metis". + +- libNUMA: + a build of the NUMA library can be used to pin the threads to + the physical core of the machine SWIFT is running on. This is + not always necessary as the OS scheduler may do a good job at + distributing the threads among the different cores on each + computing node. + + - tcmalloc / jemalloc / TBBmalloc: + a build of the tcmalloc library (part of gperftools), jemalloc + or TBBmalloc can be used be used to obtain faster and more + scalable allocations than the standard C malloc function part + of glibc. Using one of these is highly recommended on systems + with many cores per node. One of the options + "--with-tcmalloc", "--with-jemalloc" or "--with-tbbmalloc" + should be passed to the configuration script to use it. + + - gperftools: + a build of gperftools can be used to obtain good profiling of + the code. The option "-with-profiler" needs to be passed to + the configuration script to use it. + + - DOXYGEN: + the doxygen library is required to create the SWIFT API + documentation. + + - python: + Examples and solution script use python and rely on the numpy + library version 1.8.2 or higher. - - python: Examples and solution script use python and rely on the - numpy library version 1.8.2 or higher. SWIFT Coding style -- GitLab From b9f10dad03aa5a6ccf0b23ff4ba041a9c9bc4bb5 Mon Sep 17 00:00:00 2001 From: Matthieu Schaller Date: Tue, 29 May 2018 17:52:09 +0200 Subject: [PATCH 5/6] Better help string for the alternative mallocs and better configuration summary. --- configure.ac | 55 ++++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/configure.ac b/configure.ac index 710e745ec..0d8ead01e 100644 --- a/configure.ac +++ b/configure.ac @@ -631,7 +631,7 @@ AM_CONDITIONAL([HAVEFFTW],[test -n "$FFTW_LIBS"]) # Check for -lprofiler usually part of the gperftools along with tcmalloc. have_profiler="no" AC_ARG_WITH([profiler], - [AS_HELP_STRING([--with-profiler], + [AS_HELP_STRING([--with-profiler=PATH], [use cpu profiler library or specify the directory with lib @<:@yes/no@:>@] )], [with_profiler="$withval"], @@ -663,7 +663,7 @@ have_special_allocator="no" # Check for tcmalloc a fast malloc that is part of the gperftools. have_tcmalloc="no" AC_ARG_WITH([tcmalloc], - [AS_HELP_STRING([--with-tcmalloc], + [AS_HELP_STRING([--with-tcmalloc=PATH], [use tcmalloc library or specify the directory with lib @<:@yes/no@:>@] )], [with_tcmalloc="$withval"], @@ -696,9 +696,9 @@ if test "x$with_tcmalloc" != "xno"; then if test "$have_tcmalloc" = "yes"; then TCMALLOC_LIBS="$tclibs" - AC_DEFINE([HAVE_TCMALLOC],1,[The tc-malloc library appears to be present.]) + AC_DEFINE([HAVE_TCMALLOC],1,[The tcmalloc library appears to be present.]) - have_special_allocator="yes" + have_special_allocator="tcmalloc" # Prevent compilers that replace the calls with built-ins (GNU 99) from doing so. case "$ax_cv_c_compiler_vendor" in @@ -717,7 +717,7 @@ AM_CONDITIONAL([HAVETCMALLOC],[test -n "$TCMALLOC_LIBS"]) # Check for jemalloc another fast malloc that is good with contention. have_jemalloc="no" AC_ARG_WITH([jemalloc], - [AS_HELP_STRING([--with-jemalloc], + [AS_HELP_STRING([--with-jemalloc=PATH], [use jemalloc library or specify the directory with lib @<:@yes/no@:>@] )], [with_jemalloc="$withval"], @@ -739,9 +739,9 @@ if test "x$with_jemalloc" != "xno"; then if test "$have_jemalloc" = "yes"; then JEMALLOC_LIBS="$jelibs" - AC_DEFINE([HAVE_JEMALLOC],1,[The je-malloc library appears to be present.]) + AC_DEFINE([HAVE_JEMALLOC],1,[The jemalloc library appears to be present.]) - have_special_allocator="yes" + have_special_allocator="jemalloc" # Prevent compilers that replace the regular calls with built-ins (GNU 99) from doing so. case "$ax_cv_c_compiler_vendor" in @@ -760,7 +760,7 @@ AM_CONDITIONAL([HAVEJEMALLOC],[test -n "$JEMALLOC_LIBS"]) # Check for tbbmalloc, Intel's fast and parallel allocator have_tbbmalloc="no" AC_ARG_WITH([tbbmalloc], - [AS_HELP_STRING([--with-tbbmalloc], + [AS_HELP_STRING([--with-tbbmalloc=PATH], [use tbbmalloc library or specify the directory with lib @<:@yes/no@:>@] )], [with_tbbmalloc="$withval"], @@ -782,9 +782,9 @@ if test "x$with_tbbmalloc" != "xno"; then if test "$have_tbbmalloc" = "yes"; then TBBMALLOC_LIBS="$tbblibs" - AC_DEFINE([HAVE_TBBMALLOC],1,[The TBB-malloc library appears to be present.]) + AC_DEFINE([HAVE_TBBMALLOC],1,[The TBBmalloc library appears to be present.]) - have_special_allocator="yes" + have_special_allocator="TBBmalloc" # Prevent compilers that replace the calls with built-ins (GNU 99) from doing so. case "$ax_cv_c_compiler_vendor" in @@ -821,7 +821,8 @@ if test "$with_hdf5" = "yes"; then if test "$enable_parallel_hdf5" = "yes"; then AC_MSG_CHECKING([for HDF5 parallel support]) -# Check if the library is capable, the header should define H5_HAVE_PARALLEL. + + # Check if the library is capable, the header should define H5_HAVE_PARALLEL. AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ #include "hdf5.h" @@ -1288,23 +1289,21 @@ AC_MSG_RESULT([ $PACKAGE_NAME v.$PACKAGE_VERSION - Compiler : $CC - - vendor : $ax_cv_c_compiler_vendor - - version : $ax_cv_c_compiler_version - - flags : $CFLAGS - MPI enabled : $enable_mpi - HDF5 enabled : $with_hdf5 - - parallel : $have_parallel_hdf5 - Metis enabled : $have_metis - FFTW3 enabled : $have_fftw - GSL enabled : $have_gsl - libNUMA enabled : $have_numa - GRACKLE enabled : $have_grackle - Using tbbmalloc : $have_tbbmalloc - Using tcmalloc : $have_tcmalloc - Using jemalloc : $have_jemalloc - CPU profiler : $have_profiler - Pthread barriers : $have_pthread_barrier + Compiler : $CC + - vendor : $ax_cv_c_compiler_vendor + - version : $ax_cv_c_compiler_version + - flags : $CFLAGS + MPI enabled : $enable_mpi + HDF5 enabled : $with_hdf5 + - parallel : $have_parallel_hdf5 + Metis enabled : $have_metis + FFTW3 enabled : $have_fftw + GSL enabled : $have_gsl + libNUMA enabled : $have_numa + GRACKLE enabled : $have_grackle + Special allocators : $have_special_allocator + CPU profiler : $have_profiler + Pthread barriers : $have_pthread_barrier Hydro scheme : $with_hydro Dimensionality : $with_dimension -- GitLab From 0c22a0df32564b6a71da55f584d0a11a2e5973a2 Mon Sep 17 00:00:00 2001 From: "Peter W. Draper" Date: Thu, 31 May 2018 13:36:15 +0100 Subject: [PATCH 6/6] Fix some typos and reword some mangled phrases --- INSTALL.swift | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/INSTALL.swift b/INSTALL.swift index 98e258824..999a8d365 100644 --- a/INSTALL.swift +++ b/INSTALL.swift @@ -99,19 +99,18 @@ before you can build it. - HDF5: A HDF5 library (v. 1.8.x or higher) is required to read and write particle data. One of the commands "h5cc" or "h5pcc" - should be available. If "h5pcc" is located them a parallel + should be available. If "h5pcc" is located then a parallel HDF5 built for the version of MPI located should be provided. If the command is not available then it can be - located using the "--with-hfd5" configure option. The value + located using the "--with-hdf5" configure option. The value should be the full path to the "h5cc" or "h5pcc" commands. - SWIFT can make a very effective use of a parallel build of the - library when running on more than one node. This is highly - recommended. + SWIFT makes effective use of parallel HDF5 when running on more than + one node, so this option is highly recommended. - MPI: To run on more than one node an MPI library that fully - supports MPI_THREAD_MULTIPLE. Before running configure the - "mpirun" command should be available in the shell. If your + supports MPI_THREAD_MULTIPLE is required. Before running configure + the "mpirun" command should be available in the shell. If your command isn't called "mpirun" then define the "MPIRUN" environment variable, either in the shell or when running configure. @@ -125,7 +124,7 @@ before you can build it. must be available. - FFTW 3.x: - To run with periodic gravity forces, a build of the fftw 3 + To run with periodic gravity forces, a build of the FFTW 3 library must be available. Note that SWIFT does not make use of the parallel capability of FFTW. Calculations are done by single MPI nodes independently. @@ -146,7 +145,7 @@ before you can build it. directories, or pointed at using the "--with-metis" configuration option. In this case the top-level installation directory of the METIS build should be given. Note to use - METIS you should at least supply "--with-metis". + METIS you should supply at least "--with-metis". - libNUMA: a build of the NUMA library can be used to pin the threads to @@ -166,7 +165,7 @@ before you can build it. - gperftools: a build of gperftools can be used to obtain good profiling of - the code. The option "-with-profiler" needs to be passed to + the code. The option "--with-profiler" needs to be passed to the configuration script to use it. - DOXYGEN: @@ -182,8 +181,7 @@ before you can build it. SWIFT Coding style ================== -The SWIFT source code is using a variation of the 'Google' style. The -script 'format.sh' in the root directory applies the clang-format-3.8 -tool with our style choices to all the SWIFT C source file. Please -apply the formatting script to the files before submitting a merge -request. +The SWIFT source code uses a variation of 'Google' style. The script +'format.sh' in the root directory applies the clang-format-3.8 tool with our +style choices to all the SWIFT C source file. Please apply the formatting +script to the files before submitting a merge request. -- GitLab