From bb6334038c8818cd48491012b60666f2f5ab94d9 Mon Sep 17 00:00:00 2001 From: Frederic Suter Date: Sat, 13 Apr 2019 17:50:40 +0200 Subject: [PATCH] please sonar: replace void* by unsigned char* for raw buffer --- src/kernel/activity/CommImpl.cpp | 14 +++---- src/kernel/activity/CommImpl.hpp | 14 +++---- src/simix/libsmx.cpp | 17 ++++---- src/simix/popping_accessors.hpp | 69 +++++++++++++++++++------------- src/simix/popping_bodies.cpp | 34 ++++++++++++---- src/simix/popping_generated.cpp | 41 +++++++++++++++++-- src/simix/simcalls.in | 8 ++-- 7 files changed, 130 insertions(+), 67 deletions(-) diff --git a/src/kernel/activity/CommImpl.cpp b/src/kernel/activity/CommImpl.cpp index 9817117bc7..1410e40bfe 100644 --- a/src/kernel/activity/CommImpl.cpp +++ b/src/kernel/activity/CommImpl.cpp @@ -19,7 +19,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_network, simix, "SIMIX network-related synchronization"); XBT_PRIVATE void simcall_HANDLER_comm_send(smx_simcall_t simcall, smx_actor_t src, smx_mailbox_t mbox, double task_size, - double rate, void* src_buff, size_t src_buff_size, + double rate, unsigned char* src_buff, size_t src_buff_size, int (*match_fun)(void*, void*, simgrid::kernel::activity::CommImpl*), void (*copy_data_fun)(simgrid::kernel::activity::CommImpl*, void*, size_t), void* data, double timeout) @@ -31,8 +31,8 @@ XBT_PRIVATE void simcall_HANDLER_comm_send(smx_simcall_t simcall, smx_actor_t sr } XBT_PRIVATE smx_activity_t simcall_HANDLER_comm_isend( - smx_simcall_t /*simcall*/, smx_actor_t src_proc, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, - size_t src_buff_size, int (*match_fun)(void*, void*, simgrid::kernel::activity::CommImpl*), + smx_simcall_t /*simcall*/, smx_actor_t src_proc, smx_mailbox_t mbox, double task_size, double rate, + unsigned char* src_buff, size_t src_buff_size, int (*match_fun)(void*, void*, simgrid::kernel::activity::CommImpl*), void (*clean_fun)(void*), // used to free the synchro in case of problem after a detached send void (*copy_data_fun)(simgrid::kernel::activity::CommImpl*, void*, size_t), // used to copy data if not default one void* data, bool detached) @@ -97,7 +97,7 @@ XBT_PRIVATE smx_activity_t simcall_HANDLER_comm_isend( } XBT_PRIVATE void simcall_HANDLER_comm_recv(smx_simcall_t simcall, smx_actor_t receiver, smx_mailbox_t mbox, - void* dst_buff, size_t* dst_buff_size, + unsigned char* dst_buff, size_t* dst_buff_size, int (*match_fun)(void*, void*, simgrid::kernel::activity::CommImpl*), void (*copy_data_fun)(simgrid::kernel::activity::CommImpl*, void*, size_t), void* data, double timeout, double rate) @@ -109,7 +109,7 @@ XBT_PRIVATE void simcall_HANDLER_comm_recv(smx_simcall_t simcall, smx_actor_t re } XBT_PRIVATE smx_activity_t simcall_HANDLER_comm_irecv( - smx_simcall_t /*simcall*/, smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, + smx_simcall_t /*simcall*/, smx_actor_t receiver, smx_mailbox_t mbox, unsigned char* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, void (*copy_data_fun)(simgrid::kernel::activity::CommImpl*, void*, size_t), void* data, double rate) { @@ -380,14 +380,14 @@ CommImpl& CommImpl::set_rate(double rate) return *this; } -CommImpl& CommImpl::set_src_buff(void* buff, size_t size) +CommImpl& CommImpl::set_src_buff(unsigned char* buff, size_t size) { src_buff_ = buff; src_buff_size_ = size; return *this; } -CommImpl& CommImpl::set_dst_buff(void* buff, size_t* size) +CommImpl& CommImpl::set_dst_buff(unsigned char* buff, size_t* size) { dst_buff_ = buff; dst_buff_size_ = size; diff --git a/src/kernel/activity/CommImpl.hpp b/src/kernel/activity/CommImpl.hpp index 777d826547..559fd9de46 100644 --- a/src/kernel/activity/CommImpl.hpp +++ b/src/kernel/activity/CommImpl.hpp @@ -27,8 +27,8 @@ public: CommImpl& set_type(CommImpl::Type type); CommImpl& set_size(double size); - CommImpl& set_src_buff(void* buff, size_t size); - CommImpl& set_dst_buff(void* buff, size_t* size); + CommImpl& set_src_buff(unsigned char* buff, size_t size); + CommImpl& set_dst_buff(unsigned char* buff, size_t* size); CommImpl& set_rate(double rate); double get_rate() { return rate_; } @@ -64,11 +64,11 @@ expectations of the other side, too. See */ actor::ActorImplPtr dst_actor_ = nullptr; /* Data to be transfered */ - void* src_buff_ = nullptr; - void* dst_buff_ = nullptr; - size_t src_buff_size_ = 0; - size_t* dst_buff_size_ = nullptr; - bool copied = false; /* whether the data were already copied */ + unsigned char* src_buff_ = nullptr; + unsigned char* dst_buff_ = nullptr; + size_t src_buff_size_ = 0; + size_t* dst_buff_size_ = nullptr; + bool copied = false; /* whether the data were already copied */ void* src_data_ = nullptr; /* User data associated to the communication */ void* dst_data_ = nullptr; diff --git a/src/simix/libsmx.cpp b/src/simix/libsmx.cpp index b44eb2d597..278a3ecdea 100644 --- a/src/simix/libsmx.cpp +++ b/src/simix/libsmx.cpp @@ -95,8 +95,8 @@ void simcall_comm_send(smx_actor_t sender, smx_mailbox_t mbox, double task_size, comm = nullptr; } else { - simcall_BODY_comm_send(sender, mbox, task_size, rate, src_buff, src_buff_size, - match_fun, copy_data_fun, data, timeout); + simcall_BODY_comm_send(sender, mbox, task_size, rate, static_cast(src_buff), src_buff_size, + match_fun, copy_data_fun, data, timeout); } } @@ -116,9 +116,8 @@ smx_activity_t simcall_comm_isend(smx_actor_t sender, smx_mailbox_t mbox, double xbt_assert(mbox, "No rendez-vous point defined for isend"); - return simcall_BODY_comm_isend(sender, mbox, task_size, rate, src_buff, - src_buff_size, match_fun, - clean_fun, copy_data_fun, data, detached); + return simcall_BODY_comm_isend(sender, mbox, task_size, rate, static_cast(src_buff), src_buff_size, + match_fun, clean_fun, copy_data_fun, data, detached); } /** @@ -141,8 +140,8 @@ void simcall_comm_recv(smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff, comm = nullptr; } else { - simcall_BODY_comm_recv(receiver, mbox, dst_buff, dst_buff_size, - match_fun, copy_data_fun, data, timeout, rate); + simcall_BODY_comm_recv(receiver, mbox, static_cast(dst_buff), dst_buff_size, match_fun, + copy_data_fun, data, timeout, rate); } } /** @@ -155,8 +154,8 @@ smx_activity_t simcall_comm_irecv(smx_actor_t receiver, smx_mailbox_t mbox, void { xbt_assert(mbox, "No rendez-vous point defined for irecv"); - return simcall_BODY_comm_irecv(receiver, mbox, dst_buff, dst_buff_size, - match_fun, copy_data_fun, data, rate); + return simcall_BODY_comm_irecv(receiver, mbox, static_cast(dst_buff), dst_buff_size, match_fun, + copy_data_fun, data, rate); } /** diff --git a/src/simix/popping_accessors.hpp b/src/simix/popping_accessors.hpp index 5ce7bc898e..98a6521a6f 100644 --- a/src/simix/popping_accessors.hpp +++ b/src/simix/popping_accessors.hpp @@ -188,17 +188,17 @@ static inline void simcall_comm_send__set__rate(smx_simcall_t simcall, double ar { simgrid::simix::marshal(simcall->args[3], arg); } -static inline void* simcall_comm_send__get__src_buff(smx_simcall_t simcall) +static inline unsigned char* simcall_comm_send__get__src_buff(smx_simcall_t simcall) { - return simgrid::simix::unmarshal(simcall->args[4]); + return simgrid::simix::unmarshal(simcall->args[4]); } -static inline void* simcall_comm_send__getraw__src_buff(smx_simcall_t simcall) +static inline unsigned char* simcall_comm_send__getraw__src_buff(smx_simcall_t simcall) { - return simgrid::simix::unmarshal_raw(simcall->args[4]); + return simgrid::simix::unmarshal_raw(simcall->args[4]); } -static inline void simcall_comm_send__set__src_buff(smx_simcall_t simcall, void* arg) +static inline void simcall_comm_send__set__src_buff(smx_simcall_t simcall, unsigned char* arg) { - simgrid::simix::marshal(simcall->args[4], arg); + simgrid::simix::marshal(simcall->args[4], arg); } static inline size_t simcall_comm_send__get__src_buff_size(smx_simcall_t simcall) { @@ -309,17 +309,17 @@ static inline void simcall_comm_isend__set__rate(smx_simcall_t simcall, double a { simgrid::simix::marshal(simcall->args[3], arg); } -static inline void* simcall_comm_isend__get__src_buff(smx_simcall_t simcall) +static inline unsigned char* simcall_comm_isend__get__src_buff(smx_simcall_t simcall) { - return simgrid::simix::unmarshal(simcall->args[4]); + return simgrid::simix::unmarshal(simcall->args[4]); } -static inline void* simcall_comm_isend__getraw__src_buff(smx_simcall_t simcall) +static inline unsigned char* simcall_comm_isend__getraw__src_buff(smx_simcall_t simcall) { - return simgrid::simix::unmarshal_raw(simcall->args[4]); + return simgrid::simix::unmarshal_raw(simcall->args[4]); } -static inline void simcall_comm_isend__set__src_buff(smx_simcall_t simcall, void* arg) +static inline void simcall_comm_isend__set__src_buff(smx_simcall_t simcall, unsigned char* arg) { - simgrid::simix::marshal(simcall->args[4], arg); + simgrid::simix::marshal(simcall->args[4], arg); } static inline size_t simcall_comm_isend__get__src_buff_size(smx_simcall_t simcall) { @@ -430,17 +430,17 @@ static inline void simcall_comm_recv__set__mbox(smx_simcall_t simcall, smx_mailb { simgrid::simix::marshal(simcall->args[1], arg); } -static inline void* simcall_comm_recv__get__dst_buff(smx_simcall_t simcall) +static inline unsigned char* simcall_comm_recv__get__dst_buff(smx_simcall_t simcall) { - return simgrid::simix::unmarshal(simcall->args[2]); + return simgrid::simix::unmarshal(simcall->args[2]); } -static inline void* simcall_comm_recv__getraw__dst_buff(smx_simcall_t simcall) +static inline unsigned char* simcall_comm_recv__getraw__dst_buff(smx_simcall_t simcall) { - return simgrid::simix::unmarshal_raw(simcall->args[2]); + return simgrid::simix::unmarshal_raw(simcall->args[2]); } -static inline void simcall_comm_recv__set__dst_buff(smx_simcall_t simcall, void* arg) +static inline void simcall_comm_recv__set__dst_buff(smx_simcall_t simcall, unsigned char* arg) { - simgrid::simix::marshal(simcall->args[2], arg); + simgrid::simix::marshal(simcall->args[2], arg); } static inline size_t* simcall_comm_recv__get__dst_buff_size(smx_simcall_t simcall) { @@ -539,17 +539,17 @@ static inline void simcall_comm_irecv__set__mbox(smx_simcall_t simcall, smx_mail { simgrid::simix::marshal(simcall->args[1], arg); } -static inline void* simcall_comm_irecv__get__dst_buff(smx_simcall_t simcall) +static inline unsigned char* simcall_comm_irecv__get__dst_buff(smx_simcall_t simcall) { - return simgrid::simix::unmarshal(simcall->args[2]); + return simgrid::simix::unmarshal(simcall->args[2]); } -static inline void* simcall_comm_irecv__getraw__dst_buff(smx_simcall_t simcall) +static inline unsigned char* simcall_comm_irecv__getraw__dst_buff(smx_simcall_t simcall) { - return simgrid::simix::unmarshal_raw(simcall->args[2]); + return simgrid::simix::unmarshal_raw(simcall->args[2]); } -static inline void simcall_comm_irecv__set__dst_buff(smx_simcall_t simcall, void* arg) +static inline void simcall_comm_irecv__set__dst_buff(smx_simcall_t simcall, unsigned char* arg) { - simgrid::simix::marshal(simcall->args[2], arg); + simgrid::simix::marshal(simcall->args[2], arg); } static inline size_t* simcall_comm_irecv__get__dst_buff_size(smx_simcall_t simcall) { @@ -1030,10 +1030,23 @@ XBT_PRIVATE void simcall_HANDLER_process_join(smx_simcall_t simcall, smx_actor_t XBT_PRIVATE void simcall_HANDLER_process_sleep(smx_simcall_t simcall, double duration); XBT_PRIVATE void simcall_HANDLER_execution_wait(smx_simcall_t simcall, simgrid::kernel::activity::ExecImpl* execution); XBT_PRIVATE void simcall_HANDLER_execution_test(smx_simcall_t simcall, simgrid::kernel::activity::ExecImpl* execution); -XBT_PRIVATE void simcall_HANDLER_comm_send(smx_simcall_t simcall, smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout); -XBT_PRIVATE boost::intrusive_ptr simcall_HANDLER_comm_isend(smx_simcall_t simcall, smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data, bool detached); -XBT_PRIVATE void simcall_HANDLER_comm_recv(smx_simcall_t simcall, smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout, double rate); -XBT_PRIVATE boost::intrusive_ptr simcall_HANDLER_comm_irecv(smx_simcall_t simcall, smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double rate); +XBT_PRIVATE void simcall_HANDLER_comm_send(smx_simcall_t simcall, smx_actor_t sender, smx_mailbox_t mbox, + double task_size, double rate, unsigned char* src_buff, size_t src_buff_size, + simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, + void* data, double timeout); +XBT_PRIVATE boost::intrusive_ptr +simcall_HANDLER_comm_isend(smx_simcall_t simcall, smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, + unsigned char* src_buff, size_t src_buff_size, simix_match_func_t match_fun, + simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data, + bool detached); +XBT_PRIVATE void simcall_HANDLER_comm_recv(smx_simcall_t simcall, smx_actor_t receiver, smx_mailbox_t mbox, + unsigned char* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, + simix_copy_data_func_t copy_data_fun, void* data, double timeout, + double rate); +XBT_PRIVATE boost::intrusive_ptr +simcall_HANDLER_comm_irecv(smx_simcall_t simcall, smx_actor_t receiver, smx_mailbox_t mbox, unsigned char* dst_buff, + size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, + void* data, double rate); XBT_PRIVATE void simcall_HANDLER_comm_waitany(smx_simcall_t simcall, simgrid::kernel::activity::CommImpl** comms, size_t count, double timeout); XBT_PRIVATE void simcall_HANDLER_comm_wait(smx_simcall_t simcall, simgrid::kernel::activity::CommImpl* comm, double timeout); XBT_PRIVATE void simcall_HANDLER_comm_test(smx_simcall_t simcall, simgrid::kernel::activity::CommImpl* comm); diff --git a/src/simix/popping_bodies.cpp b/src/simix/popping_bodies.cpp index 8888f2ae89..348a3e24ce 100644 --- a/src/simix/popping_bodies.cpp +++ b/src/simix/popping_bodies.cpp @@ -74,32 +74,50 @@ inline static bool simcall_BODY_execution_test(simgrid::kernel::activity::ExecIm return simcall(SIMCALL_EXECUTION_TEST, execution); } -inline static void simcall_BODY_comm_send(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout) +inline static void simcall_BODY_comm_send(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, + unsigned char* src_buff, size_t src_buff_size, simix_match_func_t match_fun, + simix_copy_data_func_t copy_data_fun, void* data, double timeout) { if (0) /* Go to that function to follow the code flow through the simcall barrier */ simcall_HANDLER_comm_send(&SIMIX_process_self()->simcall, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, copy_data_fun, data, timeout); - return simcall(SIMCALL_COMM_SEND, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, copy_data_fun, data, timeout); + return simcall(SIMCALL_COMM_SEND, sender, mbox, task_size, rate, src_buff, + src_buff_size, match_fun, copy_data_fun, data, timeout); } -inline static boost::intrusive_ptr simcall_BODY_comm_isend(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data, bool detached) +inline static boost::intrusive_ptr +simcall_BODY_comm_isend(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, unsigned char* src_buff, + size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun, + simix_copy_data_func_t copy_data_fun, void* data, bool detached) { if (0) /* Go to that function to follow the code flow through the simcall barrier */ simcall_HANDLER_comm_isend(&SIMIX_process_self()->simcall, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, clean_fun, copy_data_fun, data, detached); - return simcall, smx_actor_t, smx_mailbox_t, double, double, void*, size_t, simix_match_func_t, simix_clean_func_t, simix_copy_data_func_t, void*, bool>(SIMCALL_COMM_ISEND, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, clean_fun, copy_data_fun, data, detached); + return simcall, smx_actor_t, smx_mailbox_t, double, + double, unsigned char*, size_t, simix_match_func_t, simix_clean_func_t, simix_copy_data_func_t, void*, + bool>(SIMCALL_COMM_ISEND, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, clean_fun, + copy_data_fun, data, detached); } -inline static void simcall_BODY_comm_recv(smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout, double rate) +inline static void simcall_BODY_comm_recv(smx_actor_t receiver, smx_mailbox_t mbox, unsigned char* dst_buff, + size_t* dst_buff_size, simix_match_func_t match_fun, + simix_copy_data_func_t copy_data_fun, void* data, double timeout, double rate) { if (0) /* Go to that function to follow the code flow through the simcall barrier */ simcall_HANDLER_comm_recv(&SIMIX_process_self()->simcall, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, timeout, rate); - return simcall(SIMCALL_COMM_RECV, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, timeout, rate); + return simcall(SIMCALL_COMM_RECV, receiver, mbox, dst_buff, dst_buff_size, match_fun, + copy_data_fun, data, timeout, rate); } -inline static boost::intrusive_ptr simcall_BODY_comm_irecv(smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double rate) +inline static boost::intrusive_ptr +simcall_BODY_comm_irecv(smx_actor_t receiver, smx_mailbox_t mbox, unsigned char* dst_buff, size_t* dst_buff_size, + simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double rate) { if (0) /* Go to that function to follow the code flow through the simcall barrier */ simcall_HANDLER_comm_irecv(&SIMIX_process_self()->simcall, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, rate); - return simcall, smx_actor_t, smx_mailbox_t, void*, size_t*, simix_match_func_t, simix_copy_data_func_t, void*, double>(SIMCALL_COMM_IRECV, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, rate); + return simcall, smx_actor_t, smx_mailbox_t, + unsigned char*, size_t*, simix_match_func_t, simix_copy_data_func_t, void*, double>( + SIMCALL_COMM_IRECV, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, rate); } inline static int simcall_BODY_comm_waitany(simgrid::kernel::activity::CommImpl** comms, size_t count, double timeout) diff --git a/src/simix/popping_generated.cpp b/src/simix/popping_generated.cpp index 71542d49b6..2d55ceb3b9 100644 --- a/src/simix/popping_generated.cpp +++ b/src/simix/popping_generated.cpp @@ -84,20 +84,53 @@ case SIMCALL_EXECUTION_TEST: break; case SIMCALL_COMM_SEND: - simcall_HANDLER_comm_send(simcall, simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1]), simgrid::simix::unmarshal(simcall->args[2]), simgrid::simix::unmarshal(simcall->args[3]), simgrid::simix::unmarshal(simcall->args[4]), simgrid::simix::unmarshal(simcall->args[5]), simgrid::simix::unmarshal(simcall->args[6]), simgrid::simix::unmarshal(simcall->args[7]), simgrid::simix::unmarshal(simcall->args[8]), simgrid::simix::unmarshal(simcall->args[9])); + simcall_HANDLER_comm_send( + simcall, simgrid::simix::unmarshal(simcall->args[0]), + simgrid::simix::unmarshal(simcall->args[1]), simgrid::simix::unmarshal(simcall->args[2]), + simgrid::simix::unmarshal(simcall->args[3]), simgrid::simix::unmarshal(simcall->args[4]), + simgrid::simix::unmarshal(simcall->args[5]), + simgrid::simix::unmarshal(simcall->args[6]), + simgrid::simix::unmarshal(simcall->args[7]), + simgrid::simix::unmarshal(simcall->args[8]), simgrid::simix::unmarshal(simcall->args[9])); break; case SIMCALL_COMM_ISEND: - simgrid::simix::marshal>(simcall->result, simcall_HANDLER_comm_isend(simcall, simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1]), simgrid::simix::unmarshal(simcall->args[2]), simgrid::simix::unmarshal(simcall->args[3]), simgrid::simix::unmarshal(simcall->args[4]), simgrid::simix::unmarshal(simcall->args[5]), simgrid::simix::unmarshal(simcall->args[6]), simgrid::simix::unmarshal(simcall->args[7]), simgrid::simix::unmarshal(simcall->args[8]), simgrid::simix::unmarshal(simcall->args[9]), simgrid::simix::unmarshal(simcall->args[10]))); + simgrid::simix::marshal>( + simcall->result, simcall_HANDLER_comm_isend(simcall, simgrid::simix::unmarshal(simcall->args[0]), + simgrid::simix::unmarshal(simcall->args[1]), + simgrid::simix::unmarshal(simcall->args[2]), + simgrid::simix::unmarshal(simcall->args[3]), + simgrid::simix::unmarshal(simcall->args[4]), + simgrid::simix::unmarshal(simcall->args[5]), + simgrid::simix::unmarshal(simcall->args[6]), + simgrid::simix::unmarshal(simcall->args[7]), + simgrid::simix::unmarshal(simcall->args[8]), + simgrid::simix::unmarshal(simcall->args[9]), + simgrid::simix::unmarshal(simcall->args[10]))); SIMIX_simcall_answer(simcall); break; case SIMCALL_COMM_RECV: - simcall_HANDLER_comm_recv(simcall, simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1]), simgrid::simix::unmarshal(simcall->args[2]), simgrid::simix::unmarshal(simcall->args[3]), simgrid::simix::unmarshal(simcall->args[4]), simgrid::simix::unmarshal(simcall->args[5]), simgrid::simix::unmarshal(simcall->args[6]), simgrid::simix::unmarshal(simcall->args[7]), simgrid::simix::unmarshal(simcall->args[8])); + simcall_HANDLER_comm_recv( + simcall, simgrid::simix::unmarshal(simcall->args[0]), + simgrid::simix::unmarshal(simcall->args[1]), + simgrid::simix::unmarshal(simcall->args[2]), simgrid::simix::unmarshal(simcall->args[3]), + simgrid::simix::unmarshal(simcall->args[4]), + simgrid::simix::unmarshal(simcall->args[5]), + simgrid::simix::unmarshal(simcall->args[6]), simgrid::simix::unmarshal(simcall->args[7]), + simgrid::simix::unmarshal(simcall->args[8])); break; case SIMCALL_COMM_IRECV: - simgrid::simix::marshal>(simcall->result, simcall_HANDLER_comm_irecv(simcall, simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1]), simgrid::simix::unmarshal(simcall->args[2]), simgrid::simix::unmarshal(simcall->args[3]), simgrid::simix::unmarshal(simcall->args[4]), simgrid::simix::unmarshal(simcall->args[5]), simgrid::simix::unmarshal(simcall->args[6]), simgrid::simix::unmarshal(simcall->args[7]))); + simgrid::simix::marshal>( + simcall->result, simcall_HANDLER_comm_irecv(simcall, simgrid::simix::unmarshal(simcall->args[0]), + simgrid::simix::unmarshal(simcall->args[1]), + simgrid::simix::unmarshal(simcall->args[2]), + simgrid::simix::unmarshal(simcall->args[3]), + simgrid::simix::unmarshal(simcall->args[4]), + simgrid::simix::unmarshal(simcall->args[5]), + simgrid::simix::unmarshal(simcall->args[6]), + simgrid::simix::unmarshal(simcall->args[7]))); SIMIX_simcall_answer(simcall); break; diff --git a/src/simix/simcalls.in b/src/simix/simcalls.in index b450dfeb9f..10d0ee03cb 100644 --- a/src/simix/simcalls.in +++ b/src/simix/simcalls.in @@ -42,10 +42,10 @@ int process_sleep(double duration) [[block]]; int execution_wait(simgrid::kernel::activity::ExecImpl* execution) [[block]]; bool execution_test(simgrid::kernel::activity::ExecImpl* execution) [[block]]; -void comm_send(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout) [[block]]; -boost::intrusive_ptr comm_isend(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data, bool detached); -void comm_recv(smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout, double rate) [[block]]; -boost::intrusive_ptr comm_irecv(smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double rate); +void comm_send(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, unsigned char* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout) [[block]]; +boost::intrusive_ptr comm_isend(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, unsigned char* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data, bool detached); +void comm_recv(smx_actor_t receiver, smx_mailbox_t mbox, unsigned char* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout, double rate) [[block]]; +boost::intrusive_ptr comm_irecv(smx_actor_t receiver, smx_mailbox_t mbox, unsigned char* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double rate); int comm_waitany(simgrid::kernel::activity::CommImpl** comms, size_t count, double timeout) [[block]]; void comm_wait(simgrid::kernel::activity::CommImpl* comm, double timeout) [[block]]; bool comm_test(simgrid::kernel::activity::CommImpl* comm) [[block]]; -- 2.20.1