Skip to content

Commit

Permalink
Merge pull request #1312 from STEllAR-GROUP/fixing_857
Browse files Browse the repository at this point in the history
Fixing #857: hpx::naming::locality leaks parcelport specific information into the public interface
  • Loading branch information
hkaiser committed Nov 22, 2014
2 parents d9f8692 + d0078dc commit 3c0973d
Show file tree
Hide file tree
Showing 95 changed files with 2,449 additions and 2,047 deletions.
172 changes: 86 additions & 86 deletions docs/manual/build_system/cmake_toolchains.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -14,81 +14,61 @@ In order to compile HPX for various platforms, we provide a variety of Toolchain
take care of setting up various __cmake__ variables like compilers etc. They are located
in the `cmake/toolchains` directory:

* [link hpx.manual.build_system.building_hpx.cmake_toolchains.BGION_gcc BGION-gcc]
* [link hpx.manual.build_system.building_hpx.cmake_toolchains.XeonPhi XeonPhi]
* [link hpx.manual.build_system.building_hpx.cmake_toolchains.BGQ BGQ]
* [link hpx.manual.build_system.building_hpx.cmake_toolchains.Cray_Intel Cray-Intel]
* [link hpx.manual.build_system.building_hpx.cmake_toolchains.XeonPhi XeonPhi]
* [link hpx.manual.build_system.building_hpx.cmake_toolchains.BGION_gcc BGION-gcc]


[teletype]

To use them pass the `-DCMAKE_TOOLCHAIN_FILE=<toolchain>` argument to the cmake invocation.

[heading:BGION_gcc BGION-gcc]
[heading:XeonPhi XeonPhi]

``
# Copyright (c) 2014 John Biddiscombe
# Copyright (c) 2014 Thomas Heller
#
# 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)
# This is the default toolchain file to be used with CNK on a BlueGene/Q. It sets
#
# This is the default toolchain file to be used with Intel Xeon PHIs. It sets
# the appropriate compile flags and compiler such that HPX will compile.
# Note that you still need to provide Boost, hwloc and other utility libraries
# like a custom allocator yourself.
#
# Usage : cmake -DCMAKE_TOOLCHAIN_FILE=~/src/hpx/cmake/toolchains/BGION-gcc.cmake ~/src/hpx
#
set(CMAKE_SYSTEM_NAME Linux)
# Set the gcc Compiler
set(CMAKE_CXX_COMPILER g++)
set(CMAKE_C_COMPILER gcc)
#set(CMAKE_Fortran_COMPILER)
# Add flags we need for BGAS compilation
set(CMAKE_CXX_FLAGS_INIT
"-D__powerpc__ -D__bgion__ -I/gpfs/bbp.cscs.ch/home/biddisco/src/bgas/rdmahelper "
CACHE STRING "Initial compiler flags used to compile for BGAS"
)
# the V1R2M2 includes are necessary for some hardware specific features
#-DHPX_SMALL_STACK_SIZE=0x200000 -DHPX_MEDIUM_STACK_SIZE=0x200000 -DHPX_LARGE_STACK_SIZE=0x200000 -DHPX_HUGE_STACK_SIZE=0x200000
set(CMAKE_EXE_LINKER_FLAGS_INIT "-L/gpfs/bbp.cscs.ch/apps/bgas/tools/gcc/gcc-4.8.2/install/lib64 -latomic -lrt" CACHE STRING "BGAS flags")
set(CMAKE_C_FLAGS_INIT "-D__powerpc__ -I/gpfs/bbp.cscs.ch/home/biddisco/src/bgas/rdmahelper" CACHE STRING "BGAS flags")
# We do not perform cross compilation here ...
set(CMAKE_CROSSCOMPILING OFF)
# Set the Intel Compiler
set(CMAKE_CXX_COMPILER icpc)
set(CMAKE_C_COMPILER icc)
set(CMAKE_Fortran_COMPILER ifort)
# Add the -mmic compile flag such that everything will be compiled for the correct
# platform
set(CMAKE_CXX_FLAGS_INIT "-mmic" CACHE STRING "Initial compiler flags used to compile for the Xeon Phi")
set(CMAKE_C_FLAGS_INIT "-mmic" CACHE STRING "Initial compiler flags used to compile for the Xeon Phi")
set(CMAKE_Fortran_FLAGS_INIT "-mmic" CACHE STRING "Initial compiler flags used to compile for the Xeon Phi")
# Disable searches in the default system paths. We are cross compiling after all
# and cmake might pick up wrong libraries that way
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
# We do a cross compilation here ...
set(CMAKE_CROSSCOMPILING ON)
# Set our platform name
set(HPX_PLATFORM "native")
# Disable generic coroutines (and use posix version)
set(HPX_WITH_GENERIC_CONTEXT_COROUTINES OFF CACHE BOOL "diable generic coroutines")
# BGAS nodes support ibverbs
set(HPX_PARCELPORT_IBVERBS ON CACHE BOOL "")
# Always disable the tcp parcelport as it is nonfunctional on the BGQ.
set(HPX_PARCELPORT_TCP ON CACHE BOOL "")
# Always enable the tcp parcelport as it is currently the only way to communicate on the BGQ.
set(HPX_PARCELPORT_MPI ON CACHE BOOL "")
# We have a bunch of cores on the A2 processor ...
set(HPX_MAX_CPU_COUNT "64" CACHE STRING "")
# We have no custom malloc yet
set(HPX_PLATFORM "XeonPhi")
# Always disable the ibverbs parcelport as it is nonfunctional on the BGQ.
set(HPX_PARCELPORT_IBVERBS OFF CACHE BOOL "Enable the ibverbs based parcelport. This is currently an experimental feature")
# We have a bunch of cores on the MIC ... increase the default
set(HPX_MAX_CPU_COUNT "256" CACHE STRING "")
# We default to tbbmalloc as our allocator on the MIC
if(NOT DEFINED HPX_MALLOC)
set(HPX_MALLOC "system" CACHE STRING "")
set(HPX_MALLOC "tbbmalloc" CACHE STRING "")
endif()
set(HPX_HIDDEN_VISIBILITY OFF CACHE BOOL "")
#
# Convenience setup for jb @ bbpbg2.cscs.ch
#
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")
#
# Testing flags
#
set(BUILD_TESTING ON CACHE BOOL "Testing enabled by default")
set(HPX_BUILD_TESTS ON CACHE BOOL "Testing enabled by default")
set(HPX_BUILD_TESTS_BENCHMARKS ON CACHE BOOL "Testing enabled by default")
set(HPX_BUILD_TESTS_REGRESSIONS ON CACHE BOOL "Testing enabled by default")
set(HPX_BUILD_TESTS_UNIT ON CACHE BOOL "Testing enabled by default")
set(HPX_BUILD_TESTS_EXTERNAL_BUILD OFF CACHE BOOL "Turn off build of cmake build tests")
set(DART_TESTING_TIMEOUT 45 CACHE STRING "Life is too short")
#HPX_STATIC_LINKING
# Set the TBBMALLOC_PLATFORM correctly so that find_package(TBBMalloc) sets the
# right hints
set(TBBMALLOC_PLATFORM "mic" CACHE STRING "")
set(HPX_HIDDEN_VISIBILITY OFF CACHE BOOL "Use -fvisibility=hidden for builds on platforms which support it")
``

[heading:BGQ BGQ]
Expand Down Expand Up @@ -204,51 +184,71 @@ To use them pass the `-DCMAKE_TOOLCHAIN_FILE=<toolchain>` argument to the cmake
set(CMAKE_CROSSCOMPILING ON)
``

[heading:XeonPhi XeonPhi]
[heading:BGION_gcc BGION-gcc]

``
# Copyright (c) 2014 Thomas Heller
# Copyright (c) 2014 John Biddiscombe
#
# 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)
#
# This is the default toolchain file to be used with Intel Xeon PHIs. It sets
# This is the default toolchain file to be used with CNK on a BlueGene/Q. It sets
# the appropriate compile flags and compiler such that HPX will compile.
# Note that you still need to provide Boost, hwloc and other utility libraries
# like a custom allocator yourself.
#
# Usage : cmake -DCMAKE_TOOLCHAIN_FILE=~/src/hpx/cmake/toolchains/BGION-gcc.cmake ~/src/hpx
#
set(CMAKE_SYSTEM_NAME Linux)
# Set the Intel Compiler
set(CMAKE_CXX_COMPILER icpc)
set(CMAKE_C_COMPILER icc)
set(CMAKE_Fortran_COMPILER ifort)
# Add the -mmic compile flag such that everything will be compiled for the correct
# platform
set(CMAKE_CXX_FLAGS_INIT "-mmic" CACHE STRING "Initial compiler flags used to compile for the Xeon Phi")
set(CMAKE_C_FLAGS_INIT "-mmic" CACHE STRING "Initial compiler flags used to compile for the Xeon Phi")
set(CMAKE_Fortran_FLAGS_INIT "-mmic" CACHE STRING "Initial compiler flags used to compile for the Xeon Phi")
# Disable searches in the default system paths. We are cross compiling after all
# and cmake might pick up wrong libraries that way
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
# We do a cross compilation here ...
set(CMAKE_CROSSCOMPILING ON)
# Set the gcc Compiler
set(CMAKE_CXX_COMPILER g++)
set(CMAKE_C_COMPILER gcc)
#set(CMAKE_Fortran_COMPILER)
# Add flags we need for BGAS compilation
set(CMAKE_CXX_FLAGS_INIT
"-D__powerpc__ -D__bgion__ -I/gpfs/bbp.cscs.ch/home/biddisco/src/bgas/rdmahelper "
CACHE STRING "Initial compiler flags used to compile for BGAS"
)
# the V1R2M2 includes are necessary for some hardware specific features
#-DHPX_SMALL_STACK_SIZE=0x200000 -DHPX_MEDIUM_STACK_SIZE=0x200000 -DHPX_LARGE_STACK_SIZE=0x200000 -DHPX_HUGE_STACK_SIZE=0x200000
set(CMAKE_EXE_LINKER_FLAGS_INIT "-L/gpfs/bbp.cscs.ch/apps/bgas/tools/gcc/gcc-4.8.2/install/lib64 -latomic -lrt" CACHE STRING "BGAS flags")
set(CMAKE_C_FLAGS_INIT "-D__powerpc__ -I/gpfs/bbp.cscs.ch/home/biddisco/src/bgas/rdmahelper" CACHE STRING "BGAS flags")
# We do not perform cross compilation here ...
set(CMAKE_CROSSCOMPILING OFF)
# Set our platform name
set(HPX_PLATFORM "XeonPhi")
# Always disable the ibverbs parcelport as it is nonfunctional on the BGQ.
set(HPX_PARCELPORT_IBVERBS OFF CACHE BOOL "Enable the ibverbs based parcelport. This is currently an experimental feature")
# We have a bunch of cores on the MIC ... increase the default
set(HPX_MAX_CPU_COUNT "256" CACHE STRING "")
# We default to tbbmalloc as our allocator on the MIC
set(HPX_PLATFORM "native")
# Disable generic coroutines (and use posix version)
set(HPX_WITH_GENERIC_CONTEXT_COROUTINES OFF CACHE BOOL "diable generic coroutines")
# BGAS nodes support ibverbs
set(HPX_PARCELPORT_IBVERBS ON CACHE BOOL "")
# Always disable the tcp parcelport as it is nonfunctional on the BGQ.
set(HPX_PARCELPORT_TCP ON CACHE BOOL "")
# Always enable the tcp parcelport as it is currently the only way to communicate on the BGQ.
set(HPX_PARCELPORT_MPI ON CACHE BOOL "")
# We have a bunch of cores on the A2 processor ...
set(HPX_MAX_CPU_COUNT "64" CACHE STRING "")
# We have no custom malloc yet
if(NOT DEFINED HPX_MALLOC)
set(HPX_MALLOC "tbbmalloc" CACHE STRING "")
set(HPX_MALLOC "system" CACHE STRING "")
endif()
# Set the TBBMALLOC_PLATFORM correctly so that find_package(TBBMalloc) sets the
# right hints
set(TBBMALLOC_PLATFORM "mic" CACHE STRING "")
set(HPX_HIDDEN_VISIBILITY OFF CACHE BOOL "Use -fvisibility=hidden for builds on platforms which support it")
set(HPX_HIDDEN_VISIBILITY OFF CACHE BOOL "")
#
# Convenience setup for jb @ bbpbg2.cscs.ch
#
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")
#
# Testing flags
#
set(BUILD_TESTING ON CACHE BOOL "Testing enabled by default")
set(HPX_BUILD_TESTS ON CACHE BOOL "Testing enabled by default")
set(HPX_BUILD_TESTS_BENCHMARKS ON CACHE BOOL "Testing enabled by default")
set(HPX_BUILD_TESTS_REGRESSIONS ON CACHE BOOL "Testing enabled by default")
set(HPX_BUILD_TESTS_UNIT ON CACHE BOOL "Testing enabled by default")
set(HPX_BUILD_TESTS_EXTERNAL_BUILD OFF CACHE BOOL "Turn off build of cmake build tests")
set(DART_TESTING_TIMEOUT 45 CACHE STRING "Life is too short")
#HPX_STATIC_LINKING
``


Expand Down
4 changes: 0 additions & 4 deletions docs/manual/build_system/cmake_variables.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ The options are split into these categories:
* [link build_system.cmake_variables.HPX_COMPILER_WARNINGS HPX_COMPILER_WARNINGS]
* [link build_system.cmake_variables.HPX_FULL_RPATH HPX_FULL_RPATH]
* [link build_system.cmake_variables.HPX_GCC_VERSION_CHECK HPX_GCC_VERSION_CHECK]
* [link build_system.cmake_variables.HPX_GENERIC_COROUTINE_CONTEXT HPX_GENERIC_COROUTINE_CONTEXT]
* [link build_system.cmake_variables.HPX_HIDDEN_VISIBILITY HPX_HIDDEN_VISIBILITY]
* [link build_system.cmake_variables.HPX_MALLOC HPX_MALLOC]
* [link build_system.cmake_variables.HPX_NATIVE_TLS HPX_NATIVE_TLS]
Expand All @@ -44,7 +43,6 @@ The options are split into these categories:
* [link build_system.cmake_variables.HPX_UTIL_FUNCTION HPX_UTIL_FUNCTION]
* [link build_system.cmake_variables.HPX_UTIL_TUPLE HPX_UTIL_TUPLE]
* [link build_system.cmake_variables.HPX_WAVE_ADDITIONAL_INCLUDE_DIRS HPX_WAVE_ADDITIONAL_INCLUDE_DIRS]
* [link build_system.cmake_variables.HPX_WITH_BOOST_ALL_DYNAMIC_LINK HPX_WITH_BOOST_ALL_DYNAMIC_LINK]
* [link build_system.cmake_variables.HPX_WITH_COMPRESSION_BZIP2 HPX_WITH_COMPRESSION_BZIP2]
* [link build_system.cmake_variables.HPX_WITH_COMPRESSION_SNAPPY HPX_WITH_COMPRESSION_SNAPPY]
* [link build_system.cmake_variables.HPX_WITH_COMPRESSION_ZLIB HPX_WITH_COMPRESSION_ZLIB]
Expand All @@ -61,7 +59,6 @@ The options are split into these categories:
[[[#build_system.cmake_variables.HPX_COMPILER_WARNINGS] `HPX_COMPILER_WARNINGS:BOOL`][Enable compiler warnings (default: ON)]]
[[[#build_system.cmake_variables.HPX_FULL_RPATH] `HPX_FULL_RPATH:BOOL`][Build and link HPX libraries and executables with full RPATHs (default: ON)]]
[[[#build_system.cmake_variables.HPX_GCC_VERSION_CHECK] `HPX_GCC_VERSION_CHECK:BOOL`][Ignore version reported by gcc (default: ON)]]
[[[#build_system.cmake_variables.HPX_GENERIC_COROUTINE_CONTEXT] `HPX_GENERIC_COROUTINE_CONTEXT:BOOL`][Use Boost.Context as the underlying coroutines context switch implementation.]]
[[[#build_system.cmake_variables.HPX_HIDDEN_VISIBILITY] `HPX_HIDDEN_VISIBILITY:BOOL`][Use -fvisibility=hidden for builds on platforms which support it (default ON)]]
[[[#build_system.cmake_variables.HPX_MALLOC] `HPX_MALLOC:STRING`][Define which allocator should be linked in. Options are: system, tcmalloc, jemalloc and tbbmalloc (default is: tcmalloc)]]
[[[#build_system.cmake_variables.HPX_NATIVE_TLS] `HPX_NATIVE_TLS:BOOL`][Use native TLS support if available (default: ON)]]
Expand All @@ -72,7 +69,6 @@ The options are split into these categories:
[[[#build_system.cmake_variables.HPX_UTIL_FUNCTION] `HPX_UTIL_FUNCTION:BOOL`][Use hpx::util::function instead of boost::function or std::function (default: ON)]]
[[[#build_system.cmake_variables.HPX_UTIL_TUPLE] `HPX_UTIL_TUPLE:BOOL`][Use hpx::util::tuple instead of boost::tuple or std::tuple (default: ON)]]
[[[#build_system.cmake_variables.HPX_WAVE_ADDITIONAL_INCLUDE_DIRS] `HPX_WAVE_ADDITIONAL_INCLUDE_DIRS:STRING`][Additional (compiler specific) include directories for the wave preprocessing tool.]]
[[[#build_system.cmake_variables.HPX_WITH_BOOST_ALL_DYNAMIC_LINK] `HPX_WITH_BOOST_ALL_DYNAMIC_LINK:BOOL`][Add BOOST_ALL_DYN_LINK to compile flags]]
[[[#build_system.cmake_variables.HPX_WITH_COMPRESSION_BZIP2] `HPX_WITH_COMPRESSION_BZIP2:BOOL`][Enable bzip2 compression for parcel data (default: OFF).]]
[[[#build_system.cmake_variables.HPX_WITH_COMPRESSION_SNAPPY] `HPX_WITH_COMPRESSION_SNAPPY:BOOL`][Enable snappy compression for parcel data (default: OFF).]]
[[[#build_system.cmake_variables.HPX_WITH_COMPRESSION_ZLIB] `HPX_WITH_COMPRESSION_ZLIB:BOOL`][Enable zlib compression for parcel data (default: OFF).]]
Expand Down
14 changes: 13 additions & 1 deletion external/cache/boost/cache/local_cache.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ namespace boost { namespace cache
typename CacheStorage = std::map<Key, Entry>,
typename Statistics = statistics::no_statistics
>
class local_cache : boost::noncopyable
class local_cache
{
///////////////////////////////////////////////////////////////////////
// The UpdatePolicy Concept expects to get passed references to
Expand All @@ -86,6 +86,8 @@ namespace boost { namespace cache
Func f_; // user supplied UpdatePolicy
};

HPX_MOVABLE_BUT_NOT_COPYABLE(local_cache);

public:
typedef Key key_type;
typedef Entry entry_type;
Expand Down Expand Up @@ -134,6 +136,16 @@ namespace boost { namespace cache
update_policy_(up), insert_policy_(ip)
{}

local_cache(local_cache&& other)
: max_size_(other.max_size_)
, current_size_(other.current_size_)
, store_(std::move(other.store_))
, entry_heap_(std::move(other.entry_heap_))
, update_policy_(std::move(other.update_policy_.f_))
, insert_policy_(std::move(other.insert_policy_))
, statistics_(std::move(other.statistics_))
{}

///////////////////////////////////////////////////////////////////////
/// \brief Return current size of the cache.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <hpx/util/decay.hpp>

#include <boost/mpl/at.hpp>
#include <boost/fusion/container/vector.hpp>

namespace hpx { namespace lcos { namespace server { namespace detail
{
Expand Down
13 changes: 9 additions & 4 deletions hpx/hpx_fwd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,10 @@ namespace hpx
// NOTE: we do not export the symbol here as id_type was already exported and generates a warning on gcc otherwise
struct id_type;
struct HPX_API_EXPORT address;
class HPX_API_EXPORT locality;

HPX_API_EXPORT resolver_client& get_agas_client();

typedef boost::uint64_t address_type;
}

///////////////////////////////////////////////////////////////////////////
Expand All @@ -124,6 +125,10 @@ namespace hpx
connection_last
};

class HPX_API_EXPORT locality;

typedef std::vector<locality> endpoints_type;

class HPX_API_EXPORT parcel;
class HPX_API_EXPORT parcelport;
class HPX_API_EXPORT parcelhandler;
Expand All @@ -148,7 +153,7 @@ namespace hpx

HPX_API_EXPORT policies::message_handler* get_message_handler(
parcelhandler* ph, char const* name, char const* type, std::size_t num,
std::size_t interval, naming::locality const& l, connection_type t,
std::size_t interval, locality const& l,
error_code& ec = throws);

HPX_API_EXPORT void do_background_work();
Expand Down Expand Up @@ -523,8 +528,8 @@ namespace hpx
HPX_API_EXPORT runtime& get_runtime();
HPX_API_EXPORT runtime* get_runtime_ptr();

/// The function \a get_locality returns a reference to the locality
HPX_API_EXPORT naming::locality const& get_locality();
/// The function \a get_locality returns a reference to the locality prefix
HPX_API_EXPORT naming::gid_type const& get_locality();

/// The function \a get_runtime_instance_number returns a unique number
/// associated with the runtime instance the current thread is running in.
Expand Down
1 change: 0 additions & 1 deletion hpx/include/naming.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

#include <hpx/hpx_fwd.hpp>
#include <hpx/runtime/naming/address.hpp>
#include <hpx/runtime/naming/locality.hpp>
#include <hpx/runtime/naming/name.hpp>
#include <hpx/runtime/naming/resolver_client.hpp>
#include <hpx/runtime/naming/unmanaged.hpp>
Expand Down
Loading

0 comments on commit 3c0973d

Please sign in to comment.