diff --git a/src/vt/messaging/active.cc b/src/vt/messaging/active.cc index 4185fa87af..6fd8fd3f87 100644 --- a/src/vt/messaging/active.cc +++ b/src/vt/messaging/active.cc @@ -184,7 +184,7 @@ trace::TraceEventIDType ActiveMessenger::makeTraceCreationSend( } MsgSizeType ActiveMessenger::packMsg( - MessageType* msg, MsgSizeType size, void* ptr, MsgSizeType ptr_bytes + MessageType* msg, MsgSizeType size, std::byte* ptr, MsgSizeType ptr_bytes ) { vt_debug_print( verbose, active, @@ -260,7 +260,7 @@ EventType ActiveMessenger::sendMsgBytesWithPut( ); } if (direct_buf_pack) { - new_msg_size = packMsg(msg, base.size(), put_ptr, put_size); + new_msg_size = packMsg(msg, base.size(), reinterpret_cast(put_ptr), put_size); } else { auto const& env_tag = envelopeGetPutTag(msg->env); auto const& ret = sendData( @@ -670,7 +670,7 @@ bool ActiveMessenger::tryProcessDataMsgRecv() { } bool ActiveMessenger::recvDataMsgBuffer( - int nchunks, void* const user_buf, TagType const& tag, + int nchunks, std::byte* const user_buf, TagType const& tag, NodeType const& node, bool const& enqueue, ActionType dealloc, ContinuationDeleterType next, bool is_user_buf ) { @@ -681,7 +681,7 @@ bool ActiveMessenger::recvDataMsgBuffer( } bool ActiveMessenger::recvDataMsgBuffer( - int nchunks, void* const user_buf, PriorityType priority, TagType const& tag, + int nchunks, std::byte* const user_buf, PriorityType priority, TagType const& tag, NodeType const& node, bool const& enqueue, ActionType dealloc_user_buf, ContinuationDeleterType next, bool is_user_buf ) { @@ -702,9 +702,9 @@ bool ActiveMessenger::recvDataMsgBuffer( if (flag == 1) { MPI_Get_count(&stat, MPI_BYTE, &num_probe_bytes); - char* buf = user_buf == nullptr ? - static_cast(thePool()->alloc(num_probe_bytes)) : - static_cast(user_buf); + std::byte* buf = user_buf == nullptr ? + reinterpret_cast(thePool()->alloc(num_probe_bytes)) : + user_buf; NodeType const sender = stat.MPI_SOURCE; @@ -730,7 +730,7 @@ bool ActiveMessenger::recvDataMsgBuffer( std::forward_as_tuple(tag), std::forward_as_tuple( PendingRecvType{ - nchunks, reinterpret_cast(user_buf), next, dealloc_user_buf, node, priority, + nchunks, user_buf, next, dealloc_user_buf, node, priority, is_user_buf } ) @@ -743,7 +743,7 @@ void ActiveMessenger::recvDataDirect( int nchunks, TagType const tag, NodeType const from, MsgSizeType len, ContinuationDeleterType next ) { - char* buf = static_cast(thePool()->alloc(len)); + std::byte* buf = reinterpret_cast(thePool()->alloc(len)); recvDataDirect( nchunks, buf, tag, from, len, default_priority, nullptr, next, false @@ -751,7 +751,7 @@ void ActiveMessenger::recvDataDirect( } void ActiveMessenger::recvDataDirect( - int nchunks, void* const buf, TagType const tag, NodeType const from, + int nchunks, std::byte* const buf, TagType const tag, NodeType const from, MsgSizeType len, PriorityType prio, ActionType dealloc, ContinuationDeleterType next, bool is_user_buf ) { @@ -760,7 +760,7 @@ void ActiveMessenger::recvDataDirect( std::vector reqs; reqs.resize(nchunks); - char* cbuf = static_cast(buf); + char* cbuf = reinterpret_cast(buf); MsgSizeType remainder = len; auto const max_per_send = theConfig()->vt_max_mpi_send_size; for (int i = 0; i < nchunks; i++) { @@ -801,7 +801,7 @@ void ActiveMessenger::recvDataDirect( } InProgressDataIRecv recv{ - reinterpret_cast(cbuf), len, from, std::move(reqs), is_user_buf ? reinterpret_cast(buf) : nullptr, dealloc, + reinterpret_cast(cbuf), len, from, std::move(reqs), is_user_buf ? buf : nullptr, dealloc, next, prio }; diff --git a/src/vt/messaging/active.h b/src/vt/messaging/active.h index af0f1c4296..7dc06d164c 100644 --- a/src/vt/messaging/active.h +++ b/src/vt/messaging/active.h @@ -1235,7 +1235,7 @@ struct ActiveMessenger : runtime::component::PollableComponent * \return the new size of the message */ MsgSizeType packMsg( - MessageType* msg, MsgSizeType size, void* ptr, MsgSizeType ptr_bytes + MessageType* msg, MsgSizeType size, std::byte* ptr, MsgSizeType ptr_bytes ); /** @@ -1335,7 +1335,7 @@ struct ActiveMessenger : runtime::component::PollableComponent * \return whether the data is ready or pending */ bool recvDataMsgBuffer( - int nchunks, void* const user_buf, PriorityType priority, TagType const& tag, + int nchunks, std::byte* const user_buf, PriorityType priority, TagType const& tag, NodeType const& node = uninitialized_destination, bool const& enqueue = true, ActionType dealloc_user_buf = nullptr, ContinuationDeleterType next = nullptr, bool is_user_buf = false @@ -1357,7 +1357,7 @@ struct ActiveMessenger : runtime::component::PollableComponent * \return whether the data is ready or pending */ bool recvDataMsgBuffer( - int nchunks, void* const user_buf, TagType const& tag, + int nchunks, std::byte* const user_buf, TagType const& tag, NodeType const& node = uninitialized_destination, bool const& enqueue = true, ActionType dealloc_user_buf = nullptr, ContinuationDeleterType next = nullptr, bool is_user_buf = false @@ -1377,7 +1377,7 @@ struct ActiveMessenger : runtime::component::PollableComponent * \param[in] is_user_buf is a user buffer that require user deallocation */ void recvDataDirect( - int nchunks, void* const buf, TagType const tag, NodeType const from, + int nchunks, std::byte* const buf, TagType const tag, NodeType const from, MsgSizeType len, PriorityType prio, ActionType dealloc = nullptr, ContinuationDeleterType next = nullptr, bool is_user_buf = false ); diff --git a/src/vt/rdma/rdma.cc b/src/vt/rdma/rdma.cc index d5ad0924da..d6d79596bc 100644 --- a/src/vt/rdma/rdma.cc +++ b/src/vt/rdma/rdma.cc @@ -135,7 +135,7 @@ RDMAManager::RDMAManager() ); } else { theMsg()->recvDataMsgBuffer( - msg->nchunks, get_ptr, msg->mpi_tag_to_recv, msg->send_back, true, + msg->nchunks, reinterpret_cast(get_ptr), msg->mpi_tag_to_recv, msg->send_back, true, [get_ptr_action]{ vt_debug_print( normal, rdma, @@ -241,7 +241,7 @@ RDMAManager::RDMAManager() msg->offset != no_byte ? static_cast(put_ptr) + msg->offset : put_ptr; // do a direct recv into the user buffer theMsg()->recvDataMsgBuffer( - msg->nchunks, put_ptr_offset, recv_tag, recv_node, true, []{}, + msg->nchunks, reinterpret_cast(put_ptr_offset), recv_tag, recv_node, true, []{}, [=](RDMA_GetType ptr, ActionType deleter){ vt_debug_print( normal, rdma,