Skip to content

Commit c91c752

Browse files
author
STE||AR Group
committed
Merge remote-tracking branch 'origin/master' into release
2 parents e27f418 + 8a8cec8 commit c91c752

File tree

13 files changed

+97
-26
lines changed

13 files changed

+97
-26
lines changed

.circleci/config.yml

+31
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,31 @@ jobs:
771771
- store_artifacts:
772772
path: tests.unit.util
773773

774+
tests.unit.libs:
775+
<<: *defaults
776+
steps:
777+
- attach_workspace:
778+
at: /hpx
779+
- run:
780+
name: Building Unit Tests
781+
command: |
782+
ninja -j2 -k 0 tests.unit.preprocessor
783+
- run:
784+
name: Running Unit Tests
785+
when: always
786+
command: |
787+
ulimit -c unlimited
788+
ctest -T test --no-compress-output --output-on-failure -R tests.unit.preprocessor
789+
- run:
790+
<<: *convert_xml
791+
- run:
792+
<<: *move_core_dump
793+
- run:
794+
<<: *move_debug_log
795+
- store_test_results:
796+
path: tests.unit.libs
797+
- store_artifacts:
798+
path: tests.unit.libs
774799
tests.regressions:
775800
<<: *defaults
776801
steps:
@@ -1178,6 +1203,8 @@ workflows:
11781203
<<: *core_dependency
11791204
- tests.unit.util:
11801205
<<: *core_dependency
1206+
- tests.unit.libs:
1207+
<<: *core_dependency
11811208
- tests.regressions:
11821209
<<: *core_dependency
11831210
- tests.performance:
@@ -1206,6 +1233,8 @@ workflows:
12061233
<<: *core_dependency
12071234
- tests.headers.util:
12081235
<<: *core_dependency
1236+
- tests.headers.libs:
1237+
<<: *core_dependency
12091238
- examples:
12101239
<<: *core_dependency
12111240
- tests.unit.build:
@@ -1240,6 +1269,7 @@ workflows:
12401269
- tests.unit.threads
12411270
- tests.unit.traits
12421271
- tests.unit.util
1272+
- tests.unit.libs
12431273
- tests.headers.compat
12441274
- tests.headers.components
12451275
- tests.headers.compute
@@ -1252,6 +1282,7 @@ workflows:
12521282
- tests.headers.runtime
12531283
- tests.headers.traits
12541284
- tests.headers.util
1285+
- tests.headers.libs
12551286
- tests.performance
12561287
- tests.regressions
12571288
- examples

CMakeLists.txt

-9
Original file line numberDiff line numberDiff line change
@@ -1855,15 +1855,6 @@ set(HPX_DEBUG_POSTFIX "d")
18551855
################################################################################
18561856
# Add libraries
18571857
################################################################################
1858-
if(HPX_WITH_STATIC_LINKING)
1859-
if(MSVC)
1860-
# The MSVC linker can't handle a static library as large as we get when
1861-
# statically linking the main HPX library
1862-
set(hpx_libs_link_mode SHARED)
1863-
endif()
1864-
else()
1865-
set(hpx_libs_link_mode ${hpx_library_link_mode})
1866-
endif()
18671858
add_subdirectory(libs)
18681859

18691860
################################################################################

hpx/lcos/local/latch.hpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ namespace hpx { namespace lcos { namespace local
5555
/// Postconditions: counter_ == count.
5656
///
5757
explicit latch(std::ptrdiff_t count)
58-
: mtx_(), cond_(), counter_(count), notified_(count == 0)
58+
: mtx_(), cond_(), notified_(count == 0), counter_(count)
5959
{
6060
}
6161

@@ -187,8 +187,9 @@ namespace hpx { namespace lcos { namespace local
187187
private:
188188
mutable util::cache_line_data<mutex_type> mtx_;
189189
mutable util::cache_line_data<local::detail::condition_variable> cond_;
190-
std::atomic<std::ptrdiff_t> counter_;
191190
bool notified_;
191+
protected:
192+
std::atomic<std::ptrdiff_t> counter_;
192193
};
193194
}}}
194195

hpx/parallel/util/numa_allocator.hpp

+5
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ namespace hpx { namespace parallel { namespace util
124124
}
125125
hpx::wait_all(first_touch);
126126

127+
for (auto && f : first_touch)
128+
{
129+
f.get(); // rethrow exceptions
130+
}
131+
127132
// return the overall memory block
128133
return p;
129134
}

hpx/runtime/threads/policies/scheduler_mode.hpp

+9-1
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,16 @@ namespace hpx { namespace threads { namespace policies
4141
reduce_thread_priority |
4242
delay_exit |
4343
enable_stealing |
44-
enable_idle_backoff
44+
enable_idle_backoff,
4545
///< This option represents the default mode.
46+
all_flags =
47+
do_background_work |
48+
reduce_thread_priority |
49+
delay_exit |
50+
fast_idle_mode |
51+
enable_elasticity |
52+
enable_stealing |
53+
enable_idle_backoff
4654
};
4755
}}}
4856

libs/_example/tests/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Distributed under the Boost Software License, Version 1.0. (See accompanying
44
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
55

6-
if (NOT HPX_WITH_TESTS AND HPX_TOP_LEVEL)
6+
if (NOT HPX_WITH_TESTS)
77
return()
88
endif()
99
if (NOT HPX__EXAMPLE_WITH_TESTS)

libs/create_library_skeleton.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,14 @@
6767
6868
list(APPEND CMAKE_MODULE_PATH "${{CMAKE_CURRENT_SOURCE_DIR}}/cmake")
6969
70-
option(HPX_{lib_name_upper}_WITH_TESTS "Include tests for {lib_name}" On)
70+
include(HPX_AddDefinitions)
71+
include(HPX_Option)
72+
73+
hpx_option(HPX_{lib_name_upper}_WITH_TESTS
74+
BOOL
75+
"Build HPX {lib_name} module tests. (default: ON)"
76+
ON ADVANCED
77+
CATEGORY "Modules")
7178
7279
message(STATUS "{lib_name}: Configuring")
7380
@@ -87,7 +94,7 @@
8794
'''
8895

8996
tests_cmakelists_template = cmake_header + f'''
90-
if (NOT HPX_WITH_TESTS AND HPX_TOP_LEVEL)
97+
if (NOT HPX_WITH_TESTS)
9198
return()
9299
endif()
93100
if (NOT HPX_{lib_name_upper}_WITH_TESTS)

libs/preprocessor/CMakeLists.txt

+6-2
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,15 @@ project(HPX.preprocessor CXX)
99

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

12-
option(HPX_PREPROCESSOR_WITH_TESTS "Include tests for preprocessor" On)
13-
1412
include(HPX_AddDefinitions)
1513
include(HPX_Option)
1614

15+
hpx_option(HPX_PREPROCESSOR_WITH_TESTS
16+
BOOL
17+
"Build HPX preprocessor module tests. (default: ON)"
18+
ON ADVANCED
19+
CATEGORY "Modules")
20+
1721
hpx_option(HPX_PREPROCESSOR_WITH_DEPRECATION_WARNINGS
1822
BOOL
1923
"Enable warnings for deprecated facilities. (default: ${HPX_WITH_DEPRECATION_WARNINGS})"

libs/preprocessor/tests/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Distributed under the Boost Software License, Version 1.0. (See accompanying
44
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
55

6-
if (NOT HPX_WITH_TESTS AND HPX_TOP_LEVEL)
6+
if (NOT HPX_WITH_TESTS)
77
return()
88
endif()
99
if (NOT HPX_PREPROCESSOR_WITH_TESTS)

src/CMakeLists.txt

+7-8
Original file line numberDiff line numberDiff line change
@@ -300,15 +300,14 @@ foreach(_plugin ${HPX_STATIC_PARCELPORT_PLUGINS})
300300
endforeach()
301301

302302
# integrate the hpx modules with the main library
303-
set(_modules hpx_preprocessor)
304-
foreach(_module ${_modules})
303+
foreach(_module ${HPX_LIBS})
305304
# add module binaries as PRIVATE dependencies to the core hpx library to
306305
# avoid dependent applicatons have to link against those
307-
target_link_libraries(hpx ${HPX_TLL_PRIVATE} ${_module})
306+
target_link_libraries(hpx ${HPX_TLL_PRIVATE} hpx_${_module})
308307

309308
# add module include directories as PUBLIC to core hpx library to enable
310309
# compilation against indirectly included headers
311-
get_target_property(_module_includes ${_module} INTERFACE_INCLUDE_DIRECTORIES)
310+
get_target_property(_module_includes hpx_${_module} INTERFACE_INCLUDE_DIRECTORIES)
312311
target_include_directories(hpx PUBLIC ${_module_includes})
313312
endforeach()
314313

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

358-
foreach(_module ${_modules})
357+
foreach(_module ${HPX_LIBS})
359358
# add module include directories as PRIVATE to the hpx_init library to
360359
# enable its compilation against indirectly included headers
361-
get_target_property(_module_includes ${_module} INTERFACE_INCLUDE_DIRECTORIES)
360+
get_target_property(_module_includes hpx_${_module} INTERFACE_INCLUDE_DIRECTORIES)
362361
target_include_directories(hpx_init PRIVATE ${_module_includes})
363362
endforeach()
364363

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

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

405-
foreach(_module ${_modules})
404+
foreach(_module ${HPX_LIBS})
406405
# add module include directories as PRIVATE to the hpx_wrap library to
407406
# enable its compilation against indirectly included headers
408-
get_target_property(_module_includes ${_module} INTERFACE_INCLUDE_DIRECTORIES)
407+
get_target_property(_module_includes hpx_${_module} INTERFACE_INCLUDE_DIRECTORIES)
409408
target_include_directories(hpx_wrap PRIVATE ${_module_includes})
410409
endforeach()
411410

src/runtime/threads/policies/scheduler_base.cpp

+14
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include <memory>
3535
#include <mutex>
3636
#include <set>
37+
#include <string>
3738
#include <utility>
3839
#include <vector>
3940

@@ -51,6 +52,19 @@ namespace hpx { namespace threads { namespace policies
5152
, parent_pool_(nullptr)
5253
, background_thread_count_(0)
5354
{
55+
// if there is a cfg setting for the default_scheduler_mode, use that
56+
// instead of the built-in default
57+
std::string default_scheduler_mode = hpx::get_config_entry(
58+
"hpx.default_scheduler_mode", std::string());
59+
60+
if (!default_scheduler_mode.empty())
61+
{
62+
mode = scheduler_mode(hpx::util::safe_lexical_cast<std::size_t>(
63+
default_scheduler_mode));
64+
HPX_ASSERT_MSG((mode & ~scheduler_mode::all_flags) == 0,
65+
"hpx.default_scheduler_mode contains unknown scheduler modes");
66+
}
67+
5468
set_scheduler_mode(mode);
5569

5670
#if defined(HPX_HAVE_THREAD_MANAGER_IDLE_BACKOFF)

src/runtime/threads/topology.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,16 @@ namespace hpx { namespace threads
552552
hwloc_bitmap_free(cpuset);
553553
return mask;
554554
}
555+
else
556+
{
557+
std::string errstr = std::strerror(errno);
558+
559+
lk.unlock();
560+
HPX_THROW_EXCEPTION(no_success,
561+
"topology::get_thread_affinity_mask_from_lva",
562+
"failed calling 'hwloc_get_area_membind_nodeset', "
563+
"reported error: " + errstr);
564+
}
555565
}
556566

557567
hwloc_bitmap_free(nodeset);

src/util/runtime_configuration.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ namespace hpx { namespace util
200200
"max_idle_backoff_time = ${HPX_MAX_IDLE_BACKOFF_TIME:"
201201
HPX_PP_STRINGIZE(HPX_PP_EXPAND(HPX_IDLE_BACKOFF_TIME_MAX)) "}",
202202
#endif
203+
"default_scheduler_mode = ${HPX_DEFAULT_SCHEDULER_MODE}",
203204

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

0 commit comments

Comments
 (0)