Skip to content

Commit 4920e09

Browse files
committed
Adapting HPX modules from level 11 to C++ modules
Signed-off-by: Hartmut Kaiser <hartmut.kaiser@gmail.com>
1 parent 3bd934a commit 4920e09

156 files changed

Lines changed: 589 additions & 561 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Copyright (c) 2020 Mikael Simberg
2-
# Copyright (c) 2007-2024 Hartmut Kaiser
2+
# Copyright (c) 2007-2025 Hartmut Kaiser
33
# Copyright (c) 2011-2014 Thomas Heller
44
# Copyright (c) 2024 Isidoros Tsaousis-Seiras
55
# Copyright (c) 2007-2008 Chirag Dekate
@@ -1710,6 +1710,12 @@ if(HPX_WITH_TUPLE_RVALUE_SWAP)
17101710
hpx_add_config_define(HPX_HAVE_TUPLE_RVALUE_SWAP)
17111711
endif()
17121712

1713+
hpx_option(
1714+
HPX_WITH_MODULE_COMPATIBILITY_HEADERS BOOL
1715+
"Generate backwards-compatibility headers for HPX Modules (default: OFF)" OFF
1716+
ADVANCED
1717+
)
1718+
17131719
# ##############################################################################
17141720
# Special diagnostic flags, do not enable by default, only if needed
17151721
hpx_option(

cmake/HPX_AddModule.cmake

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ function(add_hpx_module libname modulename)
106106
hpx_debug("Add module ${modulename}: SOURCE_ROOT: ${SOURCE_ROOT}")
107107
hpx_debug("Add module ${modulename}: HEADER_ROOT: ${HEADER_ROOT}")
108108

109-
if(${modulename}_COMPAT_HEADERS)
109+
if(HPX_WITH_MODULE_COMPATIBILITY_HEADERS AND ${modulename}_COMPAT_HEADERS)
110110
set(COMPAT_HEADER_ROOT "${CMAKE_CURRENT_BINARY_DIR}/include_compatibility")
111111
file(MAKE_DIRECTORY ${COMPAT_HEADER_ROOT})
112112
hpx_debug(
@@ -123,7 +123,7 @@ function(add_hpx_module libname modulename)
123123
list(TRANSFORM ${modulename}_HEADERS PREPEND ${HEADER_ROOT}/ OUTPUT_VARIABLE
124124
headers
125125
)
126-
if(${modulename}_COMPAT_HEADERS)
126+
if(HPX_WITH_MODULE_COMPATIBILITY_HEADERS AND ${modulename}_COMPAT_HEADERS)
127127
string(REPLACE ";=>;" "=>" ${modulename}_COMPAT_HEADERS
128128
"${${modulename}_COMPAT_HEADERS}"
129129
)
@@ -499,7 +499,7 @@ function(add_hpx_module libname modulename)
499499
target_link_libraries(hpx_${modulename} PUBLIC hpx_config_registry)
500500
endif()
501501

502-
if(${modulename}_COMPAT_HEADERS)
502+
if(HPX_WITH_MODULE_COMPATIBILITY_HEADERS AND ${modulename}_COMPAT_HEADERS)
503503
target_include_directories(
504504
hpx_${modulename} PUBLIC $<BUILD_INTERFACE:${COMPAT_HEADER_ROOT}>
505505
)
@@ -533,7 +533,7 @@ function(add_hpx_module libname modulename)
533533
CLASS "Source Files"
534534
TARGETS ${sources}
535535
)
536-
if(${modulename}_COMPAT_HEADERS)
536+
if(HPX_WITH_MODULE_COMPATIBILITY_HEADERS AND ${modulename}_COMPAT_HEADERS)
537537
add_hpx_source_group(
538538
NAME hpx_${modulename}
539539
ROOT ${COMPAT_HEADER_ROOT}/hpx
@@ -603,7 +603,7 @@ function(add_hpx_module libname modulename)
603603
)
604604

605605
# Install the compatibility headers from the source
606-
if(${modulename}_COMPAT_HEADERS)
606+
if(HPX_WITH_MODULE_COMPATIBILITY_HEADERS AND ${modulename}_COMPAT_HEADERS)
607607
install(
608608
DIRECTORY ${COMPAT_HEADER_ROOT}/hpx
609609
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}

cmake/templates/std_headers.hpp.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
@cxx_standard_headers@
1616
// Some standard headers include the following headers.
17+
#include <filesystem>
1718
#include <numeric>
1819

1920
#if defined(HPX_HAVE_CXX20_COROUTINES)
@@ -45,3 +46,5 @@
4546
#include <excpt.h>
4647
#undef exception_info
4748
#endif
49+
50+
#include <asio.hpp>

components/iostreams/include/hpx/components/iostreams/ostream.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
#include <hpx/components/client_base.hpp>
1515
#include <hpx/components/iostreams/manipulators.hpp>
1616
#include <hpx/components/iostreams/server/output_stream.hpp>
17-
#include <hpx/lock_registration/detail/register_locks.hpp>
1817
#include <hpx/modules/async_distributed.hpp>
18+
#include <hpx/modules/lock_registration.hpp>
1919
#include <hpx/modules/type_support.hpp>
2020

2121
#include <boost/iostreams/stream.hpp>

components/iostreams/src/server/output_stream.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ namespace hpx::iostreams::server {
6565
// enough.
6666
hpx::id_type this_id = this->get_id();
6767
#if ASIO_VERSION >= 103400
68-
asio::post(hpx::get_thread_pool("io_pool")->get_io_service(),
68+
::asio::post(hpx::get_thread_pool("io_pool")->get_io_service(),
6969
hpx::bind_front(&output_stream::call_write_async, this, locality_id,
7070
count, HPX_MOVE(in), HPX_MOVE(this_id)));
7171
#else
@@ -94,7 +94,7 @@ namespace hpx::iostreams::server {
9494
// Perform the IO in another OS thread.
9595
detail::buffer in(buf_in);
9696
#if ASIO_VERSION >= 103400
97-
asio::post(hpx::get_thread_pool("io_pool")->get_io_service(),
97+
::asio::post(hpx::get_thread_pool("io_pool")->get_io_service(),
9898
hpx::bind_front(&output_stream::call_write_sync, this, locality_id,
9999
count, std::ref(in),
100100
threads::thread_id_ref_type(threads::get_outer_self_id())));

components/parcel_plugins/coalescing/src/coalescing_message_handler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
#include <hpx/modules/errors.hpp>
1212
#include <hpx/modules/format.hpp>
1313
#include <hpx/modules/functional.hpp>
14+
#include <hpx/modules/plugin.hpp>
1415
#include <hpx/modules/runtime_local.hpp>
1516
#include <hpx/modules/thread_support.hpp>
1617
#include <hpx/modules/timing.hpp>
1718
#include <hpx/modules/util.hpp>
18-
#include <hpx/plugin/traits/plugin_config_data.hpp>
1919

2020
#include <hpx/parcel_coalescing/counter_registry.hpp>
2121
#include <hpx/parcel_coalescing/message_handler.hpp>

components/performance_counters/papi/src/util/papi.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ namespace hpx { namespace performance_counters { namespace papi {
294294
// list available events with descriptions
295295
void list_events(std::string const& scope)
296296
{
297-
using asio::ip::host_name;
297+
using ::asio::ip::host_name;
298298

299299
std::string host(host_name());
300300
// print header

components/process/include/hpx/components/process/util/mitigate.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
namespace hpx { namespace components { namespace process { namespace util {
2121

2222
#if defined(HPX_WINDOWS)
23-
typedef asio::windows::stream_handle pipe_end;
23+
typedef ::asio::windows::stream_handle pipe_end;
2424
#else
25-
typedef asio::posix::stream_descriptor pipe_end;
25+
typedef ::asio::posix::stream_descriptor pipe_end;
2626
#endif
2727

2828
inline const char* zero_device()

examples/async_io/async_io_low_level.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ hpx::future<int> async_io(char const* string_to_write)
4040

4141
// ... and schedule the handler to run on one of its OS-threads.
4242
#if ASIO_VERSION >= 103400
43-
asio::post(
43+
::asio::post(
4444
pool->get_io_service(), hpx::bind(&do_async_io, string_to_write, p));
4545
#else
4646
pool->get_io_service().post(hpx::bind(&do_async_io, string_to_write, p));

libs/core/algorithms/include/hpx/parallel/util/detail/chunk_size_iterator.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include <hpx/modules/concepts.hpp>
1313
#include <hpx/modules/datastructures.hpp>
1414
#include <hpx/modules/iterator_support.hpp>
15-
#include <hpx/util/min.hpp>
15+
#include <hpx/modules/util.hpp>
1616

1717
#include <algorithm>
1818
#include <cstddef>

0 commit comments

Comments
 (0)