Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
STE||AR Group committed May 3, 2019
2 parents e27f418 + 8a8cec8 commit c91c752
Show file tree
Hide file tree
Showing 13 changed files with 97 additions and 26 deletions.
31 changes: 31 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,31 @@ jobs:
- store_artifacts:
path: tests.unit.util

tests.unit.libs:
<<: *defaults
steps:
- attach_workspace:
at: /hpx
- run:
name: Building Unit Tests
command: |
ninja -j2 -k 0 tests.unit.preprocessor
- run:
name: Running Unit Tests
when: always
command: |
ulimit -c unlimited
ctest -T test --no-compress-output --output-on-failure -R tests.unit.preprocessor
- run:
<<: *convert_xml
- run:
<<: *move_core_dump
- run:
<<: *move_debug_log
- store_test_results:
path: tests.unit.libs
- store_artifacts:
path: tests.unit.libs
tests.regressions:
<<: *defaults
steps:
Expand Down Expand Up @@ -1178,6 +1203,8 @@ workflows:
<<: *core_dependency
- tests.unit.util:
<<: *core_dependency
- tests.unit.libs:
<<: *core_dependency
- tests.regressions:
<<: *core_dependency
- tests.performance:
Expand Down Expand Up @@ -1206,6 +1233,8 @@ workflows:
<<: *core_dependency
- tests.headers.util:
<<: *core_dependency
- tests.headers.libs:
<<: *core_dependency
- examples:
<<: *core_dependency
- tests.unit.build:
Expand Down Expand Up @@ -1240,6 +1269,7 @@ workflows:
- tests.unit.threads
- tests.unit.traits
- tests.unit.util
- tests.unit.libs
- tests.headers.compat
- tests.headers.components
- tests.headers.compute
Expand All @@ -1252,6 +1282,7 @@ workflows:
- tests.headers.runtime
- tests.headers.traits
- tests.headers.util
- tests.headers.libs
- tests.performance
- tests.regressions
- examples
Expand Down
9 changes: 0 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1855,15 +1855,6 @@ set(HPX_DEBUG_POSTFIX "d")
################################################################################
# Add libraries
################################################################################
if(HPX_WITH_STATIC_LINKING)
if(MSVC)
# The MSVC linker can't handle a static library as large as we get when
# statically linking the main HPX library
set(hpx_libs_link_mode SHARED)
endif()
else()
set(hpx_libs_link_mode ${hpx_library_link_mode})
endif()
add_subdirectory(libs)

################################################################################
Expand Down
5 changes: 3 additions & 2 deletions hpx/lcos/local/latch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ namespace hpx { namespace lcos { namespace local
/// Postconditions: counter_ == count.
///
explicit latch(std::ptrdiff_t count)
: mtx_(), cond_(), counter_(count), notified_(count == 0)
: mtx_(), cond_(), notified_(count == 0), counter_(count)
{
}

Expand Down Expand Up @@ -187,8 +187,9 @@ namespace hpx { namespace lcos { namespace local
private:
mutable util::cache_line_data<mutex_type> mtx_;
mutable util::cache_line_data<local::detail::condition_variable> cond_;
std::atomic<std::ptrdiff_t> counter_;
bool notified_;
protected:
std::atomic<std::ptrdiff_t> counter_;
};
}}}

Expand Down
5 changes: 5 additions & 0 deletions hpx/parallel/util/numa_allocator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ namespace hpx { namespace parallel { namespace util
}
hpx::wait_all(first_touch);

for (auto && f : first_touch)
{
f.get(); // rethrow exceptions
}

// return the overall memory block
return p;
}
Expand Down
10 changes: 9 additions & 1 deletion hpx/runtime/threads/policies/scheduler_mode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,16 @@ namespace hpx { namespace threads { namespace policies
reduce_thread_priority |
delay_exit |
enable_stealing |
enable_idle_backoff
enable_idle_backoff,
///< This option represents the default mode.
all_flags =
do_background_work |
reduce_thread_priority |
delay_exit |
fast_idle_mode |
enable_elasticity |
enable_stealing |
enable_idle_backoff
};
}}}

Expand Down
2 changes: 1 addition & 1 deletion libs/_example/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# 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 (NOT HPX_WITH_TESTS AND HPX_TOP_LEVEL)
if (NOT HPX_WITH_TESTS)
return()
endif()
if (NOT HPX__EXAMPLE_WITH_TESTS)
Expand Down
11 changes: 9 additions & 2 deletions libs/create_library_skeleton.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,14 @@
list(APPEND CMAKE_MODULE_PATH "${{CMAKE_CURRENT_SOURCE_DIR}}/cmake")
option(HPX_{lib_name_upper}_WITH_TESTS "Include tests for {lib_name}" On)
include(HPX_AddDefinitions)
include(HPX_Option)
hpx_option(HPX_{lib_name_upper}_WITH_TESTS
BOOL
"Build HPX {lib_name} module tests. (default: ON)"
ON ADVANCED
CATEGORY "Modules")
message(STATUS "{lib_name}: Configuring")
Expand All @@ -87,7 +94,7 @@
'''

tests_cmakelists_template = cmake_header + f'''
if (NOT HPX_WITH_TESTS AND HPX_TOP_LEVEL)
if (NOT HPX_WITH_TESTS)
return()
endif()
if (NOT HPX_{lib_name_upper}_WITH_TESTS)
Expand Down
8 changes: 6 additions & 2 deletions libs/preprocessor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ project(HPX.preprocessor CXX)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

option(HPX_PREPROCESSOR_WITH_TESTS "Include tests for preprocessor" On)

include(HPX_AddDefinitions)
include(HPX_Option)

hpx_option(HPX_PREPROCESSOR_WITH_TESTS
BOOL
"Build HPX preprocessor module tests. (default: ON)"
ON ADVANCED
CATEGORY "Modules")

hpx_option(HPX_PREPROCESSOR_WITH_DEPRECATION_WARNINGS
BOOL
"Enable warnings for deprecated facilities. (default: ${HPX_WITH_DEPRECATION_WARNINGS})"
Expand Down
2 changes: 1 addition & 1 deletion libs/preprocessor/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# 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 (NOT HPX_WITH_TESTS AND HPX_TOP_LEVEL)
if (NOT HPX_WITH_TESTS)
return()
endif()
if (NOT HPX_PREPROCESSOR_WITH_TESTS)
Expand Down
15 changes: 7 additions & 8 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -300,15 +300,14 @@ foreach(_plugin ${HPX_STATIC_PARCELPORT_PLUGINS})
endforeach()

# integrate the hpx modules with the main library
set(_modules hpx_preprocessor)
foreach(_module ${_modules})
foreach(_module ${HPX_LIBS})
# add module binaries as PRIVATE dependencies to the core hpx library to
# avoid dependent applicatons have to link against those
target_link_libraries(hpx ${HPX_TLL_PRIVATE} ${_module})
target_link_libraries(hpx ${HPX_TLL_PRIVATE} hpx_${_module})

# add module include directories as PUBLIC to core hpx library to enable
# compilation against indirectly included headers
get_target_property(_module_includes ${_module} INTERFACE_INCLUDE_DIRECTORIES)
get_target_property(_module_includes hpx_${_module} INTERFACE_INCLUDE_DIRECTORIES)
target_include_directories(hpx PUBLIC ${_module_includes})
endforeach()

Expand Down Expand Up @@ -355,10 +354,10 @@ if(NOT HPX_WITH_STATIC_LINKING)
endif()
target_include_directories(hpx_init PRIVATE $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>)

foreach(_module ${_modules})
foreach(_module ${HPX_LIBS})
# add module include directories as PRIVATE to the hpx_init library to
# enable its compilation against indirectly included headers
get_target_property(_module_includes ${_module} INTERFACE_INCLUDE_DIRECTORIES)
get_target_property(_module_includes hpx_${_module} INTERFACE_INCLUDE_DIRECTORIES)
target_include_directories(hpx_init PRIVATE ${_module_includes})
endforeach()

Expand Down Expand Up @@ -402,10 +401,10 @@ if(HPX_WITH_DYNAMIC_HPX_MAIN AND (("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") OR (

target_include_directories(hpx_wrap PRIVATE $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>)

foreach(_module ${_modules})
foreach(_module ${HPX_LIBS})
# add module include directories as PRIVATE to the hpx_wrap library to
# enable its compilation against indirectly included headers
get_target_property(_module_includes ${_module} INTERFACE_INCLUDE_DIRECTORIES)
get_target_property(_module_includes hpx_${_module} INTERFACE_INCLUDE_DIRECTORIES)
target_include_directories(hpx_wrap PRIVATE ${_module_includes})
endforeach()

Expand Down
14 changes: 14 additions & 0 deletions src/runtime/threads/policies/scheduler_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <memory>
#include <mutex>
#include <set>
#include <string>
#include <utility>
#include <vector>

Expand All @@ -51,6 +52,19 @@ namespace hpx { namespace threads { namespace policies
, parent_pool_(nullptr)
, background_thread_count_(0)
{
// if there is a cfg setting for the default_scheduler_mode, use that
// instead of the built-in default
std::string default_scheduler_mode = hpx::get_config_entry(
"hpx.default_scheduler_mode", std::string());

if (!default_scheduler_mode.empty())
{
mode = scheduler_mode(hpx::util::safe_lexical_cast<std::size_t>(
default_scheduler_mode));
HPX_ASSERT_MSG((mode & ~scheduler_mode::all_flags) == 0,
"hpx.default_scheduler_mode contains unknown scheduler modes");
}

set_scheduler_mode(mode);

#if defined(HPX_HAVE_THREAD_MANAGER_IDLE_BACKOFF)
Expand Down
10 changes: 10 additions & 0 deletions src/runtime/threads/topology.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,16 @@ namespace hpx { namespace threads
hwloc_bitmap_free(cpuset);
return mask;
}
else
{
std::string errstr = std::strerror(errno);

lk.unlock();
HPX_THROW_EXCEPTION(no_success,
"topology::get_thread_affinity_mask_from_lva",
"failed calling 'hwloc_get_area_membind_nodeset', "
"reported error: " + errstr);
}
}

hwloc_bitmap_free(nodeset);
Expand Down
1 change: 1 addition & 0 deletions src/util/runtime_configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ namespace hpx { namespace util
"max_idle_backoff_time = ${HPX_MAX_IDLE_BACKOFF_TIME:"
HPX_PP_STRINGIZE(HPX_PP_EXPAND(HPX_IDLE_BACKOFF_TIME_MAX)) "}",
#endif
"default_scheduler_mode = ${HPX_DEFAULT_SCHEDULER_MODE}",

/// If HPX_HAVE_ATTACH_DEBUGGER_ON_TEST_FAILURE is set,
/// then apply the test-failure value as default.
Expand Down

0 comments on commit c91c752

Please sign in to comment.