@@ -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
0 commit comments