Skip to content

Commit 420b0f4

Browse files
committed
Merge branch 'develop'
2 parents 0a14eb8 + ae58c4c commit 420b0f4

37 files changed

+132
-134
lines changed

CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@ set (CMAKE_CXX_STANDARD 20)
88
include (set_max_warning_level)
99
set_max_warning_level ()
1010

11-
# Necessary to suppress the ... changes the meaning of symbol ...
12-
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
13-
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")
14-
endif ()
15-
1611
################################################## Options ##################################################
1712
option(MPI_BUILD_TESTS "Build tests." OFF)
1813
option(MPI_USE_EXCEPTIONS "Use exceptions." OFF)

include/mpi/core/communicators/cartesian_communicator.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ class cartesian_communicator : public topological_communicator
142142
std::array<std::int32_t, 2> shift (const std::int32_t dimension, const std::int32_t displacement = 1) const
143143
{
144144
std::array<std::int32_t, 2> result {};
145-
MPI_CHECK_ERROR_CODE(MPI_Cart_shift, (native_, dimension, displacement, &result[0], &result[1]))
145+
MPI_CHECK_ERROR_CODE(MPI_Cart_shift, (native_, dimension, displacement, result.data(), &result[1]))
146146
return result;
147147
}
148148
};

include/mpi/core/communicators/communicator.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -227,14 +227,14 @@ class communicator
227227
}
228228

229229
[[nodiscard]]
230-
group group () const
230+
mpi::group group () const
231231
{
232232
mpi::group result(MPI_GROUP_NULL, true);
233233
MPI_CHECK_ERROR_CODE(MPI_Comm_group, (native_, &result.native_))
234234
return result;
235235
}
236236
[[nodiscard]]
237-
topology topology () const
237+
mpi::topology topology () const
238238
{
239239
std::int32_t result;
240240
MPI_CHECK_ERROR_CODE(MPI_Topo_test, (native_, &result))
@@ -276,7 +276,7 @@ class communicator
276276
{
277277
std::string result(MPI_MAX_OBJECT_NAME, '\n');
278278
std::int32_t length(0);
279-
MPI_CHECK_ERROR_CODE(MPI_Comm_get_name, (native_, &result[0], &length))
279+
MPI_CHECK_ERROR_CODE(MPI_Comm_get_name, (native_, result.data(), &length))
280280
result.resize(static_cast<std::size_t>(length));
281281
return result;
282282
}
@@ -286,7 +286,7 @@ class communicator
286286
}
287287

288288
[[nodiscard]]
289-
information information () const
289+
mpi::information information () const
290290
{
291291
mpi::information result(MPI_INFO_NULL, true);
292292
MPI_CHECK_ERROR_CODE(MPI_Comm_get_info, (native_, &result.native_))
@@ -553,7 +553,7 @@ class communicator
553553
request partitioned_send (const std::int32_t partitions, const void* data, const count size, const data_type& data_type, const std::int32_t destination, const std::int32_t tag = 0, const mpi::information& info = mpi::information()) const
554554
{
555555
request result(MPI_REQUEST_NULL, true, true);
556-
MPI_CHECK_ERROR_CODE(MPI_Psend_init, (data, partitions, size, data_type.native(), destination, tag, native_, info.native(), &result.native_))
556+
MPI_CHECK_ERROR_CODE(MPI_Psend_init, (const_cast<void*>(data), partitions, size, data_type.native(), destination, tag, native_, info.native(), &result.native_)) // Note: Several implementations require the const_cast.
557557
return result;
558558
}
559559
template <typename type> [[nodiscard]]
@@ -1083,7 +1083,7 @@ class communicator
10831083
received_type& received,
10841084
const bool resize = false) const
10851085
{
1086-
std::int32_t local_size (container_adapter<sent_type>::size(sent));
1086+
const std::int32_t local_size (container_adapter<sent_type>::size(sent));
10871087
std::vector<std::int32_t> received_sizes(size());
10881088
all_gather(local_size, received_sizes);
10891089

@@ -1108,7 +1108,7 @@ class communicator
11081108
{
11091109
using adapter = container_adapter<type>;
11101110

1111-
std::int32_t local_size (adapter::size(data));
1111+
const std::int32_t local_size (adapter::size(data));
11121112
std::vector<std::int32_t> received_sizes(size());
11131113
all_gather(local_size, received_sizes);
11141114

include/mpi/core/communicators/distributed_graph_communicator.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class distributed_graph_communicator : public topological_communicator
7373
}
7474

7575
[[nodiscard]]
76-
neighbor_counts neighbor_counts () const
76+
mpi::neighbor_counts neighbor_counts () const
7777
{
7878
mpi::neighbor_counts result {};
7979
MPI_CHECK_ERROR_CODE(MPI_Dist_graph_neighbors_count, (native_, &result.source_count, &result.destination_count, reinterpret_cast<std::int32_t*>(&result.weighted)))

include/mpi/core/communicators/graph_communicator.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ class graph_communicator : public topological_communicator
5050
std::array<std::int32_t, 2> counts () const
5151
{
5252
std::array<std::int32_t, 2> result {};
53-
MPI_CHECK_ERROR_CODE(MPI_Graphdims_get, (native_, &result[0], &result[1]))
53+
MPI_CHECK_ERROR_CODE(MPI_Graphdims_get, (native_, result.data(), &result[1]))
5454
return result;
5555
}
5656
[[nodiscard]]
57-
graph graph () const
57+
mpi::graph graph () const
5858
{
5959
const auto count = counts();
6060

include/mpi/core/communicators/topological_communicator.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ class topological_communicator : public communicator
306306
received_type& received,
307307
const bool resize = false) const
308308
{
309-
std::int32_t local_size (container_adapter<sent_type>::size(sent));
309+
const std::int32_t local_size (container_adapter<sent_type>::size(sent));
310310
std::vector<std::int32_t> received_sizes(incoming_neighbor_count());
311311
neighbor_all_gather(local_size, received_sizes);
312312

include/mpi/core/environment.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ inline std::string processor_name ()
6666
{
6767
std::string result(MPI_MAX_PROCESSOR_NAME, '\n');
6868
std::int32_t size (0);
69-
MPI_CHECK_ERROR_CODE(MPI_Get_processor_name, (&result[0], &size))
69+
MPI_CHECK_ERROR_CODE(MPI_Get_processor_name, (result.data(), &size))
7070
result.resize(static_cast<std::size_t>(size));
7171
return result;
7272
}

include/mpi/core/error/error_class.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class error_class
4747
{
4848
std::string result(MPI_MAX_ERROR_STRING, '\n');
4949
std::int32_t length(0);
50-
MPI_Error_string(native_, &result[0], &length);
50+
MPI_Error_string(native_, result.data(), &length);
5151
result.resize(static_cast<std::size_t>(length));
5252
return result;
5353
}

include/mpi/core/information.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ class information
158158
return {std::nullopt};
159159

160160
std::string result(size, '\n');
161-
MPI_CHECK_ERROR_CODE(MPI_Info_get, (native_, key.c_str(), size, &result[0], &exists))
161+
MPI_CHECK_ERROR_CODE(MPI_Info_get, (native_, key.c_str(), size, result.data(), &exists))
162162

163163
return result;
164164
}
@@ -167,7 +167,7 @@ class information
167167
std::string key_at (const std::int32_t index) const
168168
{
169169
std::string result(MPI_MAX_INFO_KEY, '\n');
170-
MPI_CHECK_ERROR_CODE(MPI_Info_get_nthkey, (native_, index, &result[0]))
170+
MPI_CHECK_ERROR_CODE(MPI_Info_get_nthkey, (native_, index, result.data()))
171171
return result;
172172
}
173173
[[nodiscard]]

include/mpi/core/port.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class port
1515
explicit port (const information& info = information())
1616
: managed_(true), name_(MPI_MAX_PORT_NAME, '\n')
1717
{
18-
MPI_CHECK_ERROR_CODE(MPI_Open_port, (info.native(), &name_[0]))
18+
MPI_CHECK_ERROR_CODE(MPI_Open_port, (info.native(), name_.data()))
1919
}
2020
explicit port (std::string name, const bool managed = false)
2121
: managed_(managed), name_(std::move(name))

0 commit comments

Comments
 (0)