Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into suspend-documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
msimberg committed Feb 7, 2018
2 parents 95e90f7 + 5e877bf commit c821c11
Show file tree
Hide file tree
Showing 44 changed files with 1,769 additions and 2,233 deletions.
18 changes: 5 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,6 @@ hpx_option(HPX_WITH_MALLOC
${DEFAULT_MALLOC}
STRINGS "system;tcmalloc;jemalloc;tbbmalloc;custom")

hpx_option(HPX_WITH_HWLOC
BOOL
"Use Hwloc for hardware topology information and thread pinning. If disabled, performance might be reduced."
ON ADVANCED)

# Logging configuration
hpx_option(HPX_WITH_LOGGING BOOL
"Build HPX with logging enabled (default: ON)."
Expand Down Expand Up @@ -1498,15 +1493,12 @@ include(HPX_SetupAllocator)
# convey selected allocator type to the build configuration
hpx_add_config_define(HPX_HAVE_MALLOC "\"${HPX_WITH_MALLOC}\"")

if(HPX_WITH_HWLOC)
find_package(Hwloc)
if(NOT HWLOC_FOUND)
hpx_error("Hwloc could not be found and HPX_WITH_HWLOC=ON, please specify HWLOC_ROOT to point to the correct location or set HPX_WITH_HWLOC to OFF")
endif()
hpx_libraries(${HWLOC_LIBRARIES})
include_directories(${HWLOC_INCLUDE_DIR})
hpx_add_config_define(HPX_HAVE_HWLOC)
find_package(Hwloc)
if(NOT HWLOC_FOUND)
hpx_error("Hwloc could not be found, please specify HWLOC_ROOT to point to the correct location")
endif()
hpx_libraries(${HWLOC_LIBRARIES})
include_directories(${HWLOC_INCLUDE_DIR})

################################################################################
# Enable integration with Intel Amplifier
Expand Down
11 changes: 5 additions & 6 deletions cmake/templates/cmake_variables.qbk.in
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,11 @@ directory for `BOOST`, specify `BOOST_ROOT=/custom/boost/root`.
libraries).]
]
[[`HWLOC_ROOT:PATH`]
[Specifies where to look for the __hwloc__ library. While it is not
necessary to compile __hpx__ with HWLOC, we strongly suggest you do so.
HWLOC provides platform independent support for extracting information
about the used hardware architecture (number of cores, number of NUMA
domains, hyperthreading, etc.). __hpx__ utilizes this information if
available.]
[Specifies where to look for the __hwloc__ library. Set this if CMake is
not able to locate a suitable version of __hwloc__. __hwloc__ provides
platform independent support for extracting information about the used
hardware architecture (number of cores, number of NUMA domains,
hyperthreading, etc.). __hpx__ utilizes this information if available.]
]
[[`PAPI_ROOT:PATH`]
[Specifies where to look for the __papi__ library. The PAPI library is
Expand Down
1 change: 0 additions & 1 deletion cmake/toolchains/BGION-gcc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ set(HPX_HIDDEN_VISIBILITY OFF CACHE BOOL "")
#
set(BOOST_ROOT "/gpfs/bbp.cscs.ch/home/biddisco/apps/gcc-4.8.2/boost_1_56_0")
set(HWLOC_ROOT "/gpfs/bbp.cscs.ch/home/biddisco/apps/gcc-4.8.2/hwloc-1.8.1")
set(HPX_WITH_HWLOC ON CACHE BOOL "Use hwloc")

set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Default build")

Expand Down
4 changes: 3 additions & 1 deletion docs/hpx.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@
[def __boost_atomic__ [@http://www.boost.org/doc/libs/release/doc/html/atomic.html Boost.Atomic]]
[def __boost_serialization__ [@http://www.boost.org/doc/libs/release/libs/serialization/doc/index.html Boost.Serialization]]

[def __hwloc_downloads__ [@http://www.open-mpi.org/software/hwloc/v1.7/ hwloc]]
[def __hwloc_downloads__ [@http://www.open-mpi.org/software/hwloc/v1.11 Hwloc Downloads]]
[def __hwloc_doc__ [@http://www.open-mpi.org/projects/hwloc/doc/ Hwloc Documentation]]
[def __doxygen__ [@http://www.doxygen.org Doxygen]]

[def __macports__ [@http://www.macports.org/ MacPorts]]
Expand Down Expand Up @@ -185,6 +186,7 @@

[/ Section link shortcuts]
[def __boost_installation__ [link hpx.manual.build_system.prerequisites.boost_installation Installing Boost Libraries]]
[def __hwloc_installation__ [link hpx.manual.build_system.prerequisites.hwloc_installation Installing Hwloc]]
[def __prerequisites__ [link hpx.manual.build_system.prerequisites Build Prerequisites]]
[def __unix_installation__ [link hpx.manual.build_system.building_hpx.build_recipes.unix_installation How to Install __hpx__ on Unix Variants]]
[def __macos_installation__ [link hpx.manual.build_system.building_hpx.build_recipes.macos_installation How to Install __hpx__ on Mac OS]]
Expand Down
39 changes: 34 additions & 5 deletions docs/manual/build_system/prerequisites.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ The installation of Boost is described in detail in Boost's own
__boost_getting_started__ document. However, if you've never used the Boost
libraries (or even if you have), here's a quick primer: __boost_installation__.

In addition, we urge every user to have a recent version of hwloc installed on
the target system in order to have proper support for thread pinning and NUMA
awareness.
In addition, we require a recent version of hwloc in order to support thread
pinning and NUMA awareness. See __hwloc_installation__ for instructions on
building __hwloc__.

__hpx__ is written in 99.99% Standard C++ (the remaining 0.01% is platform specific
assembly code). As such __hpx__ is compilable with
Expand All @@ -64,8 +64,7 @@ favorite compiler with __hpx__ visit __stellar_hpx_buildbot__.

[[[*Required Libraries]]]
[[__boost_libraries__ ][1.57.0 or newer ][1.55.0 ]]
[[__hwloc__ ][1.10 ][1.2 (Xeon Phi: 1.6)]
[Used for OS-thread pinning and NUMA awareness. This library is optional on Mac OSX.]]
[[__hwloc__ ][1.10 ][1.2 (Xeon Phi: 1.6)]]
]

[important When compiling __hpx__ using clang/libc++ on OSX platform it is advised not
Expand Down Expand Up @@ -193,6 +192,36 @@ detail in the sections __unix_installation__ and __windows_installation__.

[endsect]

[/////////////////////////////////////////////////////////////////////////////]
[section:hwloc_installation Installing Hwloc]

[note These instructions are for everything except Windows. On Windows there is
no need to build hwloc. Instead download the latest release, extract the
files, and set `HWLOC_ROOT` during cmake configuration to the directory
in which you extracted the files. ]

We suggest you download the most recent release of hwloc from here:
__hwloc_downloads__. Unpack the downloaded archive into a directory of your
choosing. We will refer to this directory as `$HWLOC`.

To build hwloc run:

cd $HWLOC
./configure --prefix=<where to install hwloc>
make -j<N> install

where: `<where to install hwloc>` is the directory the built binaries will be
installed to, and `<N>` is the number of cores to use to build hwloc.

After the above sequence of commands has been executed you will need to specify
the directory where Hwloc was installed as `HWLOC_ROOT` (`<where to install
hwloc>`) while executing cmake for __hpx__ as explained in detail in the
sections __unix_installation__ and __windows_installation__.

Please see __hwloc_doc__ for more information about Hwloc.

[endsect]

[/////////////////////////////////////////////////////////////////////////////]
[endsect] [/ Prerequisites]

1 change: 1 addition & 0 deletions docs/manual/build_system/recipe_windows.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

* Download the Boost c++ libraries from __boost_downloads__
* Install the boost library as explained in the section __boost_installation__
* Install the hwloc library as explained in the section __hwloc_installation__
* Download the latest version of __cmake__ binaries, which are located under
the platform section of the downloads page at __cmake_download__.
* Download the latest version of __hpx__ from the __stellar__ website:
Expand Down
7 changes: 3 additions & 4 deletions docs/manual/commandline.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ described in the table below:
[[`--hpx:debug-timing-log [arg]`] [enable all messages on the timing log
channel and send all timing logs to the
target destination (default: cout)]]
[[`--hpx:debug-app-log [arg]`] [enable all messages on the application log
channel and send all application logs to the
target destination (default: cout)]]
[[`--hpx:debug-clp`] [debug command line processing]]
[[`--hpx:attach-debugger arg`] [wait for a debugger to be attached, possible arg values:
`startup` or `exception` (default: startup)]]
Expand Down Expand Up @@ -308,10 +311,6 @@ In addition to the syntax described below one can use `--hpx:bind=none` to
disable all binding of any threads to a particular core. This is mostly
supported for debugging purposes.

[note This command line option is only available if __hpx__ was built with
support for HWLOC (__hwloc__) enabled. Please see __cmake_options__ for more
details on how to enable support for HWLOC in __hpx__.]

The specified affinities refer to specific regions within a machine hardware
topology. In order to understand the hardware topology of a particular machine
it may be useful to run the lstopo tool which is part of __hwloc__ to see the
Expand Down
75 changes: 4 additions & 71 deletions hpx/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@
#include <hpx/config/compiler_native_tls.hpp>
#include <hpx/config/compiler_specific.hpp>
#include <hpx/config/constexpr.hpp>
#include <hpx/config/debug.hpp>
#include <hpx/config/defines.hpp>
#include <hpx/config/emulate_deleted.hpp>
#include <hpx/config/export_definitions.hpp>
#include <hpx/config/forceinline.hpp>
#include <hpx/config/lambda_capture.hpp>
#include <hpx/config/manual_profiling.hpp>
#include <hpx/config/threads_stack.hpp>
#include <hpx/config/version.hpp>

#include <boost/version.hpp>
Expand All @@ -44,23 +46,6 @@
#define _WINSOCKAPI_
#endif

///////////////////////////////////////////////////////////////////////////////
// Make sure DEBUG macro is defined consistently across platforms
#if defined(_DEBUG) && !defined(DEBUG)
# define DEBUG
#endif

///////////////////////////////////////////////////////////////////////////////
#if defined(DEBUG) && !defined(HPX_DEBUG)
# define HPX_DEBUG
#endif

#if defined(HPX_DEBUG)
# define HPX_BUILD_TYPE debug
#else
# define HPX_BUILD_TYPE release
#endif

///////////////////////////////////////////////////////////////////////////////
/// This is the default ip/port number used by the parcel subsystem
#define HPX_INITIAL_IP_PORT 7910
Expand Down Expand Up @@ -402,64 +387,12 @@
# endif
#endif

#if !defined(HPX_HAVE_VERIFY_LOCKS_GLOBALY)
# if defined(HPX_DEBUG)
# define HPX_HAVE_VERIFY_LOCKS_GLOBALY
# endif
#endif

///////////////////////////////////////////////////////////////////////////////

#if !defined(HPX_THREADS_STACK_OVERHEAD)
#if !defined(HPX_HAVE_VERIFY_LOCKS_GLOBALLY)
# if defined(HPX_DEBUG)
# if defined(HPX_GCC_VERSION)
# define HPX_THREADS_STACK_OVERHEAD 0x3000
# else
# define HPX_THREADS_STACK_OVERHEAD 0x2800
# endif
# else
# if defined(HPX_INTEL_VERSION)
# define HPX_THREADS_STACK_OVERHEAD 0x2800
# else
# define HPX_THREADS_STACK_OVERHEAD 0x800
# endif
# define HPX_HAVE_VERIFY_LOCKS_GLOBALLY
# endif
#endif

#if !defined(HPX_SMALL_STACK_SIZE)
# if defined(__has_feature)
# if __has_feature(address_sanitizer)
# define HPX_SMALL_STACK_SIZE 0x20000 // 128kByte
# endif
# endif
#endif

#if !defined(HPX_SMALL_STACK_SIZE)
# if defined(HPX_WINDOWS) && !defined(HPX_HAVE_GENERIC_CONTEXT_COROUTINES)
# define HPX_SMALL_STACK_SIZE 0x4000 // 16kByte
# else
# if defined(HPX_DEBUG)
# define HPX_SMALL_STACK_SIZE 0x20000 // 128kByte
# else
# if defined(__powerpc__) || defined(__INTEL_COMPILER)
# define HPX_SMALL_STACK_SIZE 0x20000 // 128kByte
# else
# define HPX_SMALL_STACK_SIZE 0x10000 // 64kByte
# endif
# endif
# endif
#endif

#if !defined(HPX_MEDIUM_STACK_SIZE)
# define HPX_MEDIUM_STACK_SIZE 0x0020000 // 128kByte
#endif
#if !defined(HPX_LARGE_STACK_SIZE)
# define HPX_LARGE_STACK_SIZE 0x0200000 // 2MByte
#endif
#if !defined(HPX_HUGE_STACK_SIZE)
# define HPX_HUGE_STACK_SIZE 0x2000000 // 32MByte
#endif

///////////////////////////////////////////////////////////////////////////////
// This limits how deep the internal recursion of future continuations will go
// before a new operation is re-spawned.
Expand Down
25 changes: 25 additions & 0 deletions hpx/config/debug.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright (c) 2007-2018 Hartmut Kaiser
// Copyright (c) 2011 Bryce Lelbach
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

#if !defined(HPX_CONFIG_DEBUG_HPP)
#define HPX_CONFIG_DEBUG_HPP

// Make sure DEBUG macro is defined consistently across platforms
#if defined(_DEBUG) && !defined(DEBUG)
# define DEBUG
#endif

#if defined(DEBUG) && !defined(HPX_DEBUG)
# define HPX_DEBUG
#endif

#if defined(HPX_DEBUG)
# define HPX_BUILD_TYPE debug
#else
# define HPX_BUILD_TYPE release
#endif

#endif
71 changes: 71 additions & 0 deletions hpx/config/threads_stack.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// Copyright (c) 2007-2018 Hartmut Kaiser
// Copyright (c) 2018 Thomas Heller
// Copyright (c) 2011 Bryce Lelbach
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

#ifndef HPX_CONFIG_THREADS_STACK_HPP
#define HPX_CONFIG_THREADS_STACK_HPP

#include <hpx/config/debug.hpp>
#include <hpx/config/defines.hpp>
#include <hpx/config/compiler_specific.hpp>

///////////////////////////////////////////////////////////////////////////////

#if !defined(HPX_THREADS_STACK_OVERHEAD)
# if defined(HPX_DEBUG)
# if defined(HPX_GCC_VERSION)
# define HPX_THREADS_STACK_OVERHEAD 0x3000
# else
# define HPX_THREADS_STACK_OVERHEAD 0x2800
# endif
# else
# if defined(HPX_INTEL_VERSION)
# define HPX_THREADS_STACK_OVERHEAD 0x2800
# else
# if defined(HPX_GCC_VERSION) && HPX_GCC_VERSION >= 40900 && HPX_GCC_VERSION < 50000
# define HPX_THREADS_STACK_OVERHEAD 0x1000
# else
# define HPX_THREADS_STACK_OVERHEAD 0x800
# endif
# endif
# endif
#endif

#if !defined(HPX_SMALL_STACK_SIZE)
# if defined(__has_feature)
# if __has_feature(address_sanitizer)
# define HPX_SMALL_STACK_SIZE 0x20000 // 128kByte
# endif
# endif
#endif

#if !defined(HPX_SMALL_STACK_SIZE)
# if defined(HPX_WINDOWS) && !defined(HPX_HAVE_GENERIC_CONTEXT_COROUTINES)
# define HPX_SMALL_STACK_SIZE 0x4000 // 16kByte
# else
# if defined(HPX_DEBUG)
# define HPX_SMALL_STACK_SIZE 0x20000 // 128kByte
# else
# if defined(__powerpc__) || defined(__INTEL_COMPILER)
# define HPX_SMALL_STACK_SIZE 0x20000 // 128kByte
# else
# define HPX_SMALL_STACK_SIZE 0x10000 // 64kByte
# endif
# endif
# endif
#endif

#if !defined(HPX_MEDIUM_STACK_SIZE)
# define HPX_MEDIUM_STACK_SIZE 0x0020000 // 128kByte
#endif
#if !defined(HPX_LARGE_STACK_SIZE)
# define HPX_LARGE_STACK_SIZE 0x0200000 // 2MByte
#endif
#if !defined(HPX_HUGE_STACK_SIZE)
# define HPX_HUGE_STACK_SIZE 0x2000000 // 32MByte
#endif

#endif
2 changes: 1 addition & 1 deletion hpx/include/threadmanager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
#define HPX_THREADMANAGER_MAY_20_2008_840AM

#include <hpx/runtime/threads/executors/thread_pool_executors.hpp>
#include <hpx/runtime/threads/policies/topology.hpp>
#include <hpx/runtime/threads/thread.hpp>
#include <hpx/runtime/threads/thread_data.hpp>
#include <hpx/runtime/threads/thread_helpers.hpp>
#include <hpx/runtime/threads/threadmanager.hpp>
#include <hpx/runtime/threads/topology.hpp>

#endif

Loading

0 comments on commit c821c11

Please sign in to comment.