Skip to content

Commit bc1d23b

Browse files
committed
Adapting HPX modules of levels 16, 17, and 18 to C++ modules
Signed-off-by: Hartmut Kaiser <hartmut.kaiser@gmail.com>
1 parent 4053778 commit bc1d23b

67 files changed

Lines changed: 384 additions & 344 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.

libs/core/affinity/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ include(HPX_AddModule)
2626
add_hpx_module(
2727
core affinity
2828
GLOBAL_HEADER_GEN ON
29+
GLOBAL_HEADER_MODULE_GEN ON
2930
SOURCES ${affinity_sources}
3031
HEADERS ${affinity_headers}
3132
COMPAT_HEADERS ${affinity_compat_headers}

libs/core/affinity/include/hpx/affinity/affinity_data.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#pragma once
88

99
#include <hpx/config.hpp>
10-
#include <hpx/topology/topology.hpp>
10+
#include <hpx/modules/topology.hpp>
1111

1212
#include <atomic>
1313
#include <cstddef>
@@ -21,7 +21,7 @@ namespace hpx::threads::policies::detail {
2121
///////////////////////////////////////////////////////////////////////////
2222
// Structure holding the information related to thread affinity selection
2323
// for the shepherd threads of this instance
24-
struct HPX_CORE_EXPORT affinity_data
24+
HPX_CXX_EXPORT struct HPX_CORE_EXPORT affinity_data
2525
{
2626
affinity_data();
2727

libs/core/affinity/include/hpx/affinity/parse_affinity_options.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
#include <hpx/config.hpp>
1414
#include <hpx/modules/errors.hpp>
15-
#include <hpx/topology/cpu_mask.hpp>
15+
#include <hpx/modules/topology.hpp>
1616

1717
#include <cstddef>
1818
#include <string>
@@ -22,14 +22,14 @@
2222

2323
namespace hpx::threads {
2424

25-
HPX_CORE_EXPORT void parse_affinity_options(std::string const& spec,
26-
std::vector<mask_type>& affinities, std::size_t used_cores,
27-
std::size_t max_cores, std::size_t num_threads,
25+
HPX_CXX_EXPORT HPX_CORE_EXPORT void parse_affinity_options(
26+
std::string const& spec, std::vector<mask_type>& affinities,
27+
std::size_t used_cores, std::size_t max_cores, std::size_t num_threads,
2828
std::vector<std::size_t>& num_pus, bool use_process_mask,
2929
error_code& ec = throws);
3030

3131
// backwards compatibility helper
32-
inline void parse_affinity_options(std::string const& spec,
32+
HPX_CXX_EXPORT inline void parse_affinity_options(std::string const& spec,
3333
std::vector<mask_type>& affinities, error_code& ec = throws)
3434
{
3535
std::vector<std::size_t> num_pus;

libs/core/affinity/src/affinity_data.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
#include <hpx/affinity/parse_affinity_options.hpp>
99
#include <hpx/assert.hpp>
1010
#include <hpx/modules/errors.hpp>
11-
#include <hpx/topology/cpu_mask.hpp>
12-
#include <hpx/topology/topology.hpp>
11+
#include <hpx/modules/topology.hpp>
1312

1413
#include <algorithm>
1514
#include <atomic>

libs/core/affinity/src/parse_affinity_options.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <hpx/assert.hpp>
1111
#include <hpx/modules/datastructures.hpp>
1212
#include <hpx/modules/errors.hpp>
13-
#include <hpx/topology/topology.hpp>
13+
#include <hpx/modules/topology.hpp>
1414

1515
#include <hwloc.h>
1616

libs/core/command_line_handling_local/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2019-2024 The STE||AR-Group
1+
# Copyright (c) 2019-2025 The STE||AR-Group
22
#
33
# SPDX-License-Identifier: BSL-1.0
44
# Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -62,6 +62,7 @@ include(HPX_AddModule)
6262
add_hpx_module(
6363
core command_line_handling_local
6464
GLOBAL_HEADER_GEN ON
65+
GLOBAL_HEADER_MODULE_GEN ON
6566
SOURCES ${command_line_handling_local_sources}
6667
HEADERS ${command_line_handling_local_headers}
6768
DEPENDENCIES ${command_line_handling_local_dependencies}

libs/core/command_line_handling_local/include/hpx/command_line_handling_local/command_line_handling_local.hpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
namespace hpx::local::detail {
2222

2323
///////////////////////////////////////////////////////////////////////////
24-
struct HPX_CORE_EXPORT command_line_handling
24+
HPX_CXX_EXPORT struct HPX_CORE_EXPORT command_line_handling
2525
{
2626
command_line_handling(hpx::util::runtime_configuration rtcfg,
2727
std::vector<std::string> ini_config,
@@ -89,25 +89,26 @@ namespace hpx::local::detail {
8989
};
9090

9191
///////////////////////////////////////////////////////////////////////////
92-
HPX_CORE_EXPORT std::string runtime_configuration_string(
92+
HPX_CXX_EXPORT HPX_CORE_EXPORT std::string runtime_configuration_string(
9393
command_line_handling const& cfg);
9494

95-
HPX_CORE_EXPORT std::vector<std::string> prepend_options(
95+
HPX_CXX_EXPORT HPX_CORE_EXPORT std::vector<std::string> prepend_options(
9696
std::vector<std::string>&& args, std::string&& options);
9797

98-
HPX_CORE_EXPORT std::string convert_to_log_file(std::string const& dest);
98+
HPX_CXX_EXPORT HPX_CORE_EXPORT std::string convert_to_log_file(
99+
std::string const& dest);
99100

100-
HPX_CORE_EXPORT std::size_t handle_num_cores_default(
101+
HPX_CXX_EXPORT HPX_CORE_EXPORT std::size_t handle_num_cores_default(
101102
util::manage_config& cfgmap,
102103
hpx::program_options::variables_map const& vm, std::size_t num_threads,
103104
std::size_t num_default_cores);
104105

105-
HPX_CORE_EXPORT std::size_t get_number_of_default_threads(
106+
HPX_CXX_EXPORT HPX_CORE_EXPORT std::size_t get_number_of_default_threads(
106107
bool use_process_mask);
107-
HPX_CORE_EXPORT std::size_t get_number_of_default_cores(
108+
HPX_CXX_EXPORT HPX_CORE_EXPORT std::size_t get_number_of_default_cores(
108109
bool use_process_mask);
109110

110-
HPX_CORE_EXPORT void print_config(
111+
HPX_CXX_EXPORT HPX_CORE_EXPORT void print_config(
111112
std::vector<std::string> const& ini_config);
112113
} // namespace hpx::local::detail
113114

libs/core/command_line_handling_local/include/hpx/command_line_handling_local/json_config_file.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717

1818
namespace hpx::local::detail {
1919

20-
HPX_CORE_EXPORT std::vector<std::string> read_json_config_file_options(
20+
HPX_CXX_EXPORT HPX_CORE_EXPORT std::vector<std::string>
21+
read_json_config_file_options(
2122
std::string const& filename, util::commandline_error_mode error_mode);
2223

2324
} // namespace hpx::local::detail

libs/core/command_line_handling_local/include/hpx/command_line_handling_local/late_command_line_handling_local.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,23 @@
1616

1717
namespace hpx::local::detail {
1818

19-
HPX_CORE_EXPORT int handle_late_commandline_options(
19+
HPX_CXX_EXPORT HPX_CORE_EXPORT int handle_late_commandline_options(
2020
util::runtime_configuration& ini,
2121
hpx::program_options::options_description const& options,
2222
void (*handle_print_bind)(std::size_t) = nullptr);
2323

24-
HPX_CORE_EXPORT void set_unknown_commandline_options(
24+
HPX_CXX_EXPORT HPX_CORE_EXPORT void set_unknown_commandline_options(
2525
util::runtime_configuration& ini,
2626
std::vector<std::string> const& still_unregistered_options);
2727

28-
HPX_CORE_EXPORT bool handle_full_help(
28+
HPX_CXX_EXPORT HPX_CORE_EXPORT bool handle_full_help(
2929
util::runtime_configuration const& ini,
3030
hpx::program_options::options_description const& options);
31-
HPX_CORE_EXPORT bool handle_late_options(
31+
HPX_CXX_EXPORT HPX_CORE_EXPORT bool handle_late_options(
3232
util::runtime_configuration const& ini,
3333
hpx::program_options::variables_map const& vm,
3434
void (*handle_print_bind)(std::size_t) = nullptr);
3535

36-
HPX_CORE_EXPORT std::string get_full_commandline(
36+
HPX_CXX_EXPORT HPX_CORE_EXPORT std::string get_full_commandline(
3737
util::runtime_configuration const& ini);
3838
} // namespace hpx::local::detail

libs/core/command_line_handling_local/include/hpx/command_line_handling_local/parse_command_line_local.hpp

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -18,39 +18,38 @@
1818

1919
namespace hpx::util {
2020

21-
enum class commandline_error_mode : std::uint8_t
22-
{
21+
HPX_CXX_EXPORT enum class commandline_error_mode : std::uint8_t {
2322
return_on_error = 1,
2423
rethrow_on_error = 2,
2524
allow_unregistered = 3,
2625
ignore_aliases = 0x40,
2726
report_missing_config_file = 0x80
2827
};
2928

30-
constexpr bool as_bool(commandline_error_mode val) noexcept
29+
HPX_CXX_EXPORT constexpr bool as_bool(commandline_error_mode val) noexcept
3130
{
3231
return static_cast<int>(val) != 0;
3332
}
3433

35-
constexpr int operator~(commandline_error_mode val) noexcept
34+
HPX_CXX_EXPORT constexpr int operator~(commandline_error_mode val) noexcept
3635
{
3736
return ~static_cast<int>(val);
3837
}
3938

40-
constexpr commandline_error_mode operator&(
39+
HPX_CXX_EXPORT constexpr commandline_error_mode operator&(
4140
commandline_error_mode lhs, commandline_error_mode rhs) noexcept
4241
{
4342
return static_cast<commandline_error_mode>(
4443
static_cast<int>(lhs) & static_cast<int>(rhs));
4544
}
4645

47-
constexpr commandline_error_mode operator&(
46+
HPX_CXX_EXPORT constexpr commandline_error_mode operator&(
4847
commandline_error_mode lhs, int rhs) noexcept
4948
{
5049
return static_cast<commandline_error_mode>(static_cast<int>(lhs) & rhs);
5150
}
5251

53-
constexpr commandline_error_mode operator|(
52+
HPX_CXX_EXPORT constexpr commandline_error_mode operator|(
5453
commandline_error_mode lhs, commandline_error_mode rhs) noexcept
5554
{
5655
return static_cast<commandline_error_mode>(
@@ -68,11 +67,12 @@ namespace hpx::util {
6867

6968
namespace hpx::local::detail {
7069

71-
HPX_CORE_EXPORT std::string enquote(std::string arg);
70+
HPX_CXX_EXPORT HPX_CORE_EXPORT std::string enquote(std::string arg);
7271

73-
HPX_CORE_EXPORT std::string trim_whitespace(std::string const& s);
72+
HPX_CXX_EXPORT HPX_CORE_EXPORT std::string trim_whitespace(
73+
std::string const& s);
7474

75-
struct HPX_CORE_EXPORT option_parser
75+
HPX_CXX_EXPORT struct HPX_CORE_EXPORT option_parser
7676
{
7777
option_parser(util::section const& ini, bool ignore_aliases) noexcept;
7878

@@ -83,17 +83,17 @@ namespace hpx::local::detail {
8383
bool ignore_aliases_;
8484
};
8585

86-
HPX_CORE_EXPORT
87-
hpx::program_options::basic_command_line_parser<char>&
88-
get_commandline_parser(
89-
hpx::program_options::basic_command_line_parser<char>& p,
90-
util::commandline_error_mode mode);
86+
HPX_CXX_EXPORT HPX_CORE_EXPORT
87+
hpx::program_options::basic_command_line_parser<char>&
88+
get_commandline_parser(
89+
hpx::program_options::basic_command_line_parser<char>& p,
90+
util::commandline_error_mode mode);
9191

92-
HPX_CORE_EXPORT std::vector<std::string> read_config_file_options(
92+
HPX_CXX_EXPORT HPX_CORE_EXPORT std::vector<std::string>
93+
read_config_file_options(
9394
std::string const& filename, util::commandline_error_mode error_mode);
9495

95-
enum class options_type
96-
{
96+
HPX_CXX_EXPORT enum class options_type {
9797
commandline_options,
9898
hpx_options,
9999
hidden_options,
@@ -104,35 +104,37 @@ namespace hpx::local::detail {
104104
desc_cmdline
105105
};
106106

107-
using options_map =
107+
HPX_CXX_EXPORT using options_map =
108108
std::map<options_type, hpx::program_options::options_description>;
109109

110-
HPX_CORE_EXPORT options_map compose_local_options();
111-
HPX_CORE_EXPORT void compose_all_options(
110+
HPX_CXX_EXPORT HPX_CORE_EXPORT options_map compose_local_options();
111+
HPX_CXX_EXPORT HPX_CORE_EXPORT void compose_all_options(
112112
hpx::program_options::options_description const& app_options,
113113
options_map& all_options);
114114

115-
HPX_CORE_EXPORT std::string reconstruct_command_line(
115+
HPX_CXX_EXPORT HPX_CORE_EXPORT std::string reconstruct_command_line(
116116
int argc, char* argv[]);
117117

118-
HPX_CORE_EXPORT bool parse_commandline(util::section const& rtcfg,
119-
options_map& all_options,
118+
HPX_CXX_EXPORT HPX_CORE_EXPORT bool parse_commandline(
119+
util::section const& rtcfg, options_map& all_options,
120120
hpx::program_options::options_description const& app_options,
121121
std::vector<std::string> const& args,
122122
hpx::program_options::variables_map& vm,
123123
util::commandline_error_mode error_mode,
124124
hpx::program_options::options_description* visible,
125125
std::vector<std::string>* unregistered_options);
126126

127-
HPX_CORE_EXPORT bool parse_commandline(hpx::util::section const& rtcfg,
127+
HPX_CXX_EXPORT HPX_CORE_EXPORT bool parse_commandline(
128+
hpx::util::section const& rtcfg,
128129
hpx::program_options::options_description const& app_options,
129130
std::string const& cmdline, hpx::program_options::variables_map& vm,
130131
util::commandline_error_mode error_mode =
131132
util::commandline_error_mode::return_on_error,
132133
hpx::program_options::options_description* visible = nullptr,
133134
std::vector<std::string>* unregistered_options = nullptr);
134135

135-
HPX_CORE_EXPORT bool parse_commandline(hpx::util::section const& rtcfg,
136+
HPX_CXX_EXPORT HPX_CORE_EXPORT bool parse_commandline(
137+
hpx::util::section const& rtcfg,
136138
hpx::program_options::options_description const& app_options,
137139
std::string const& arg0, std::vector<std::string> const& args,
138140
hpx::program_options::variables_map& vm,

0 commit comments

Comments
 (0)