From 826366cbffbdff8141ac74dae93880b21d6b7d69 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sat, 19 Feb 2022 19:42:22 +0100 Subject: [PATCH] Kill Simcall::COMM_RECV, COMM_IRECV, COMM_SEND and COMM_ISEND --- src/kernel/activity/CommImpl.cpp | 48 --- src/simix/libsmx.cpp | 28 +- src/simix/popping_accessors.hpp | 488 ------------------------------- src/simix/popping_bodies.cpp | 28 -- src/simix/popping_enum.hpp | 6 +- src/simix/popping_generated.cpp | 22 -- src/simix/simcalls.in | 4 - src/simix/simcalls.py | 1 - 8 files changed, 21 insertions(+), 604 deletions(-) diff --git a/src/kernel/activity/CommImpl.cpp b/src/kernel/activity/CommImpl.cpp index 3759f4c14e..32b8ae65e1 100644 --- a/src/kernel/activity/CommImpl.cpp +++ b/src/kernel/activity/CommImpl.cpp @@ -19,54 +19,6 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_network, kernel, "Kernel 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, unsigned char* src_buff, size_t src_buff_size, - bool (*match_fun)(void*, void*, simgrid::kernel::activity::CommImpl*), - void (*copy_data_fun)(simgrid::kernel::activity::CommImpl*, void*, size_t), - void* data, double timeout) -{ - simgrid::kernel::actor::CommIsendSimcall observer(src, mbox, task_size, rate, src_buff, src_buff_size, match_fun, - nullptr, copy_data_fun, data, false); - simgrid::kernel::activity::ActivityImplPtr comm = simgrid::kernel::activity::CommImpl::isend(&observer); - comm->wait_for(simcall->issuer_, timeout); -} - -XBT_PRIVATE simgrid::kernel::activity::ActivityImplPtr simcall_HANDLER_comm_isend( - 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, - bool (*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) -{ - simgrid::kernel::actor::CommIsendSimcall observer(src_proc, mbox, task_size, rate, src_buff, src_buff_size, match_fun, - clean_fun, copy_data_fun, data, detached); - return simgrid::kernel::activity::CommImpl::isend(&observer); -} - -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, - bool (*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) -{ - simgrid::kernel::actor::CommIrecvSimcall observer(receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, - data, rate); - simgrid::kernel::activity::ActivityImplPtr comm = simgrid::kernel::activity::CommImpl::irecv(&observer); - comm->wait_for(simcall->issuer_, timeout); -} - -XBT_PRIVATE simgrid::kernel::activity::ActivityImplPtr -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, bool (*match_fun)(void*, void*, simgrid::kernel::activity::CommImpl*), - void (*copy_data_fun)(simgrid::kernel::activity::CommImpl*, void*, size_t), void* data, - double rate) -{ - simgrid::kernel::actor::CommIrecvSimcall observer(receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, - data, rate); - return simgrid::kernel::activity::CommImpl::irecv(&observer); -} - void simcall_HANDLER_comm_wait(smx_simcall_t simcall, simgrid::kernel::activity::CommImpl* comm, double timeout) { comm->wait_for(simcall->issuer_, timeout); diff --git a/src/simix/libsmx.cpp b/src/simix/libsmx.cpp index 3d7a70de64..87d14653ee 100644 --- a/src/simix/libsmx.cpp +++ b/src/simix/libsmx.cpp @@ -62,8 +62,13 @@ 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, static_cast(src_buff), src_buff_size, - match_fun, copy_data_fun, data, timeout); + simgrid::kernel::actor::CommIsendSimcall observer(sender, mbox, task_size, rate, + static_cast(src_buff), src_buff_size, match_fun, + nullptr, copy_data_fun, data, false); + simgrid::kernel::actor::simcall_blocking([&observer, timeout] { + simgrid::kernel::activity::ActivityImplPtr comm = simgrid::kernel::activity::CommImpl::isend(&observer); + comm->wait_for(observer.get_issuer(), timeout); + }); } } @@ -82,8 +87,10 @@ simcall_comm_isend(smx_actor_t sender, smx_mailbox_t mbox, double task_size, dou xbt_assert(mbox, "No rendez-vous point defined for isend"); - 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); + simgrid::kernel::actor::CommIsendSimcall observer(sender, mbox, task_size, rate, + static_cast(src_buff), src_buff_size, match_fun, + clean_fun, copy_data_fun, data, detached); + return simgrid::kernel::actor::simcall([&observer] { return simgrid::kernel::activity::CommImpl::isend(&observer); }); } /** @@ -117,8 +124,12 @@ void simcall_comm_recv(smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff, comm = nullptr; } else { - simcall_BODY_comm_recv(receiver, mbox, static_cast(dst_buff), dst_buff_size, match_fun, - copy_data_fun, data, timeout, rate); + simgrid::kernel::actor::CommIrecvSimcall observer(receiver, mbox, static_cast(dst_buff), + dst_buff_size, match_fun, copy_data_fun, data, rate); + simgrid::kernel::actor::simcall_blocking([&observer, timeout] { + simgrid::kernel::activity::ActivityImplPtr comm = simgrid::kernel::activity::CommImpl::irecv(&observer); + comm->wait_for(observer.get_issuer(), timeout); + }); } } /** @@ -131,8 +142,9 @@ simcall_comm_irecv(smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff, siz { xbt_assert(mbox, "No rendez-vous point defined for irecv"); - return simcall_BODY_comm_irecv(receiver, mbox, static_cast(dst_buff), dst_buff_size, match_fun, - copy_data_fun, data, rate); + simgrid::kernel::actor::CommIrecvSimcall observer(receiver, mbox, static_cast(dst_buff), + dst_buff_size, match_fun, copy_data_fun, data, rate); + return simgrid::kernel::actor::simcall([&observer] { return simgrid::kernel::activity::CommImpl::irecv(&observer); }); } /** diff --git a/src/simix/popping_accessors.hpp b/src/simix/popping_accessors.hpp index 5c30dffc19..bad3633310 100644 --- a/src/simix/popping_accessors.hpp +++ b/src/simix/popping_accessors.hpp @@ -15,490 +15,6 @@ */ #include "src/simix/popping_private.hpp" -static inline smx_actor_t simcall_comm_recv__get__receiver(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal(simcall->args_[0]); -} -static inline smx_actor_t simcall_comm_recv__getraw__receiver(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->args_[0]); -} -static inline void simcall_comm_recv__set__receiver(smx_simcall_t simcall, smx_actor_t arg) -{ - simgrid::simix::marshal(simcall->args_[0], arg); -} -static inline smx_mailbox_t simcall_comm_recv__get__mbox(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal(simcall->args_[1]); -} -static inline smx_mailbox_t simcall_comm_recv__getraw__mbox(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->args_[1]); -} -static inline void simcall_comm_recv__set__mbox(smx_simcall_t simcall, smx_mailbox_t arg) -{ - simgrid::simix::marshal(simcall->args_[1], arg); -} -static inline unsigned char* simcall_comm_recv__get__dst_buff(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal(simcall->args_[2]); -} -static inline unsigned char* simcall_comm_recv__getraw__dst_buff(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->args_[2]); -} -static inline void simcall_comm_recv__set__dst_buff(smx_simcall_t simcall, unsigned char* arg) -{ - simgrid::simix::marshal(simcall->args_[2], arg); -} -static inline size_t* simcall_comm_recv__get__dst_buff_size(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal(simcall->args_[3]); -} -static inline size_t* simcall_comm_recv__getraw__dst_buff_size(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->args_[3]); -} -static inline void simcall_comm_recv__set__dst_buff_size(smx_simcall_t simcall, size_t* arg) -{ - simgrid::simix::marshal(simcall->args_[3], arg); -} -static inline simix_match_func_t simcall_comm_recv__get__match_fun(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal(simcall->args_[4]); -} -static inline simix_match_func_t simcall_comm_recv__getraw__match_fun(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->args_[4]); -} -static inline void simcall_comm_recv__set__match_fun(smx_simcall_t simcall, simix_match_func_t arg) -{ - simgrid::simix::marshal(simcall->args_[4], arg); -} -static inline simix_copy_data_func_t simcall_comm_recv__get__copy_data_fun(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal(simcall->args_[5]); -} -static inline simix_copy_data_func_t simcall_comm_recv__getraw__copy_data_fun(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->args_[5]); -} -static inline void simcall_comm_recv__set__copy_data_fun(smx_simcall_t simcall, simix_copy_data_func_t arg) -{ - simgrid::simix::marshal(simcall->args_[5], arg); -} -static inline void* simcall_comm_recv__get__data(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal(simcall->args_[6]); -} -static inline void* simcall_comm_recv__getraw__data(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->args_[6]); -} -static inline void simcall_comm_recv__set__data(smx_simcall_t simcall, void* arg) -{ - simgrid::simix::marshal(simcall->args_[6], arg); -} -static inline double simcall_comm_recv__get__timeout(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal(simcall->args_[7]); -} -static inline double simcall_comm_recv__getraw__timeout(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->args_[7]); -} -static inline void simcall_comm_recv__set__timeout(smx_simcall_t simcall, double arg) -{ - simgrid::simix::marshal(simcall->args_[7], arg); -} -static inline double simcall_comm_recv__get__rate(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal(simcall->args_[8]); -} -static inline double simcall_comm_recv__getraw__rate(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->args_[8]); -} -static inline void simcall_comm_recv__set__rate(smx_simcall_t simcall, double arg) -{ - simgrid::simix::marshal(simcall->args_[8], arg); -} - -static inline smx_actor_t simcall_comm_irecv__get__receiver(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal(simcall->args_[0]); -} -static inline smx_actor_t simcall_comm_irecv__getraw__receiver(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->args_[0]); -} -static inline void simcall_comm_irecv__set__receiver(smx_simcall_t simcall, smx_actor_t arg) -{ - simgrid::simix::marshal(simcall->args_[0], arg); -} -static inline smx_mailbox_t simcall_comm_irecv__get__mbox(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal(simcall->args_[1]); -} -static inline smx_mailbox_t simcall_comm_irecv__getraw__mbox(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->args_[1]); -} -static inline void simcall_comm_irecv__set__mbox(smx_simcall_t simcall, smx_mailbox_t arg) -{ - simgrid::simix::marshal(simcall->args_[1], arg); -} -static inline unsigned char* simcall_comm_irecv__get__dst_buff(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal(simcall->args_[2]); -} -static inline unsigned char* simcall_comm_irecv__getraw__dst_buff(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->args_[2]); -} -static inline void simcall_comm_irecv__set__dst_buff(smx_simcall_t simcall, unsigned char* arg) -{ - simgrid::simix::marshal(simcall->args_[2], arg); -} -static inline size_t* simcall_comm_irecv__get__dst_buff_size(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal(simcall->args_[3]); -} -static inline size_t* simcall_comm_irecv__getraw__dst_buff_size(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->args_[3]); -} -static inline void simcall_comm_irecv__set__dst_buff_size(smx_simcall_t simcall, size_t* arg) -{ - simgrid::simix::marshal(simcall->args_[3], arg); -} -static inline simix_match_func_t simcall_comm_irecv__get__match_fun(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal(simcall->args_[4]); -} -static inline simix_match_func_t simcall_comm_irecv__getraw__match_fun(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->args_[4]); -} -static inline void simcall_comm_irecv__set__match_fun(smx_simcall_t simcall, simix_match_func_t arg) -{ - simgrid::simix::marshal(simcall->args_[4], arg); -} -static inline simix_copy_data_func_t simcall_comm_irecv__get__copy_data_fun(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal(simcall->args_[5]); -} -static inline simix_copy_data_func_t simcall_comm_irecv__getraw__copy_data_fun(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->args_[5]); -} -static inline void simcall_comm_irecv__set__copy_data_fun(smx_simcall_t simcall, simix_copy_data_func_t arg) -{ - simgrid::simix::marshal(simcall->args_[5], arg); -} -static inline void* simcall_comm_irecv__get__data(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal(simcall->args_[6]); -} -static inline void* simcall_comm_irecv__getraw__data(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->args_[6]); -} -static inline void simcall_comm_irecv__set__data(smx_simcall_t simcall, void* arg) -{ - simgrid::simix::marshal(simcall->args_[6], arg); -} -static inline double simcall_comm_irecv__get__rate(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal(simcall->args_[7]); -} -static inline double simcall_comm_irecv__getraw__rate(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->args_[7]); -} -static inline void simcall_comm_irecv__set__rate(smx_simcall_t simcall, double arg) -{ - simgrid::simix::marshal(simcall->args_[7], arg); -} -static inline boost::intrusive_ptr simcall_comm_irecv__get__result(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal>(simcall->result_); -} -static inline simgrid::kernel::activity::ActivityImpl* simcall_comm_irecv__getraw__result(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->result_); -} -static inline void simcall_comm_irecv__set__result(smx_simcall_t simcall, boost::intrusive_ptr result) -{ - simgrid::simix::marshal>(simcall->result_, result); -} - -static inline smx_actor_t simcall_comm_send__get__sender(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal(simcall->args_[0]); -} -static inline smx_actor_t simcall_comm_send__getraw__sender(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->args_[0]); -} -static inline void simcall_comm_send__set__sender(smx_simcall_t simcall, smx_actor_t arg) -{ - simgrid::simix::marshal(simcall->args_[0], arg); -} -static inline smx_mailbox_t simcall_comm_send__get__mbox(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal(simcall->args_[1]); -} -static inline smx_mailbox_t simcall_comm_send__getraw__mbox(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->args_[1]); -} -static inline void simcall_comm_send__set__mbox(smx_simcall_t simcall, smx_mailbox_t arg) -{ - simgrid::simix::marshal(simcall->args_[1], arg); -} -static inline double simcall_comm_send__get__task_size(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal(simcall->args_[2]); -} -static inline double simcall_comm_send__getraw__task_size(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->args_[2]); -} -static inline void simcall_comm_send__set__task_size(smx_simcall_t simcall, double arg) -{ - simgrid::simix::marshal(simcall->args_[2], arg); -} -static inline double simcall_comm_send__get__rate(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal(simcall->args_[3]); -} -static inline double simcall_comm_send__getraw__rate(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->args_[3]); -} -static inline void simcall_comm_send__set__rate(smx_simcall_t simcall, double arg) -{ - simgrid::simix::marshal(simcall->args_[3], arg); -} -static inline unsigned char* simcall_comm_send__get__src_buff(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal(simcall->args_[4]); -} -static inline unsigned char* simcall_comm_send__getraw__src_buff(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->args_[4]); -} -static inline void simcall_comm_send__set__src_buff(smx_simcall_t simcall, unsigned char* arg) -{ - simgrid::simix::marshal(simcall->args_[4], arg); -} -static inline size_t simcall_comm_send__get__src_buff_size(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal(simcall->args_[5]); -} -static inline size_t simcall_comm_send__getraw__src_buff_size(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->args_[5]); -} -static inline void simcall_comm_send__set__src_buff_size(smx_simcall_t simcall, size_t arg) -{ - simgrid::simix::marshal(simcall->args_[5], arg); -} -static inline simix_match_func_t simcall_comm_send__get__match_fun(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal(simcall->args_[6]); -} -static inline simix_match_func_t simcall_comm_send__getraw__match_fun(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->args_[6]); -} -static inline void simcall_comm_send__set__match_fun(smx_simcall_t simcall, simix_match_func_t arg) -{ - simgrid::simix::marshal(simcall->args_[6], arg); -} -static inline simix_copy_data_func_t simcall_comm_send__get__copy_data_fun(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal(simcall->args_[7]); -} -static inline simix_copy_data_func_t simcall_comm_send__getraw__copy_data_fun(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->args_[7]); -} -static inline void simcall_comm_send__set__copy_data_fun(smx_simcall_t simcall, simix_copy_data_func_t arg) -{ - simgrid::simix::marshal(simcall->args_[7], arg); -} -static inline void* simcall_comm_send__get__data(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal(simcall->args_[8]); -} -static inline void* simcall_comm_send__getraw__data(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->args_[8]); -} -static inline void simcall_comm_send__set__data(smx_simcall_t simcall, void* arg) -{ - simgrid::simix::marshal(simcall->args_[8], arg); -} -static inline double simcall_comm_send__get__timeout(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal(simcall->args_[9]); -} -static inline double simcall_comm_send__getraw__timeout(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->args_[9]); -} -static inline void simcall_comm_send__set__timeout(smx_simcall_t simcall, double arg) -{ - simgrid::simix::marshal(simcall->args_[9], arg); -} - -static inline smx_actor_t simcall_comm_isend__get__sender(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal(simcall->args_[0]); -} -static inline smx_actor_t simcall_comm_isend__getraw__sender(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->args_[0]); -} -static inline void simcall_comm_isend__set__sender(smx_simcall_t simcall, smx_actor_t arg) -{ - simgrid::simix::marshal(simcall->args_[0], arg); -} -static inline smx_mailbox_t simcall_comm_isend__get__mbox(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal(simcall->args_[1]); -} -static inline smx_mailbox_t simcall_comm_isend__getraw__mbox(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->args_[1]); -} -static inline void simcall_comm_isend__set__mbox(smx_simcall_t simcall, smx_mailbox_t arg) -{ - simgrid::simix::marshal(simcall->args_[1], arg); -} -static inline double simcall_comm_isend__get__task_size(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal(simcall->args_[2]); -} -static inline double simcall_comm_isend__getraw__task_size(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->args_[2]); -} -static inline void simcall_comm_isend__set__task_size(smx_simcall_t simcall, double arg) -{ - simgrid::simix::marshal(simcall->args_[2], arg); -} -static inline double simcall_comm_isend__get__rate(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal(simcall->args_[3]); -} -static inline double simcall_comm_isend__getraw__rate(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->args_[3]); -} -static inline void simcall_comm_isend__set__rate(smx_simcall_t simcall, double arg) -{ - simgrid::simix::marshal(simcall->args_[3], arg); -} -static inline unsigned char* simcall_comm_isend__get__src_buff(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal(simcall->args_[4]); -} -static inline unsigned char* simcall_comm_isend__getraw__src_buff(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->args_[4]); -} -static inline void simcall_comm_isend__set__src_buff(smx_simcall_t simcall, unsigned char* arg) -{ - simgrid::simix::marshal(simcall->args_[4], arg); -} -static inline size_t simcall_comm_isend__get__src_buff_size(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal(simcall->args_[5]); -} -static inline size_t simcall_comm_isend__getraw__src_buff_size(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->args_[5]); -} -static inline void simcall_comm_isend__set__src_buff_size(smx_simcall_t simcall, size_t arg) -{ - simgrid::simix::marshal(simcall->args_[5], arg); -} -static inline simix_match_func_t simcall_comm_isend__get__match_fun(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal(simcall->args_[6]); -} -static inline simix_match_func_t simcall_comm_isend__getraw__match_fun(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->args_[6]); -} -static inline void simcall_comm_isend__set__match_fun(smx_simcall_t simcall, simix_match_func_t arg) -{ - simgrid::simix::marshal(simcall->args_[6], arg); -} -static inline simix_clean_func_t simcall_comm_isend__get__clean_fun(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal(simcall->args_[7]); -} -static inline simix_clean_func_t simcall_comm_isend__getraw__clean_fun(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->args_[7]); -} -static inline void simcall_comm_isend__set__clean_fun(smx_simcall_t simcall, simix_clean_func_t arg) -{ - simgrid::simix::marshal(simcall->args_[7], arg); -} -static inline simix_copy_data_func_t simcall_comm_isend__get__copy_data_fun(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal(simcall->args_[8]); -} -static inline simix_copy_data_func_t simcall_comm_isend__getraw__copy_data_fun(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->args_[8]); -} -static inline void simcall_comm_isend__set__copy_data_fun(smx_simcall_t simcall, simix_copy_data_func_t arg) -{ - simgrid::simix::marshal(simcall->args_[8], arg); -} -static inline void* simcall_comm_isend__get__data(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal(simcall->args_[9]); -} -static inline void* simcall_comm_isend__getraw__data(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->args_[9]); -} -static inline void simcall_comm_isend__set__data(smx_simcall_t simcall, void* arg) -{ - simgrid::simix::marshal(simcall->args_[9], arg); -} -static inline bool simcall_comm_isend__get__detached(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal(simcall->args_[10]); -} -static inline bool simcall_comm_isend__getraw__detached(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->args_[10]); -} -static inline void simcall_comm_isend__set__detached(smx_simcall_t simcall, bool arg) -{ - simgrid::simix::marshal(simcall->args_[10], arg); -} -static inline boost::intrusive_ptr simcall_comm_isend__get__result(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal>(simcall->result_); -} -static inline simgrid::kernel::activity::ActivityImpl* simcall_comm_isend__getraw__result(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->result_); -} -static inline void simcall_comm_isend__set__result(smx_simcall_t simcall, boost::intrusive_ptr result) -{ - simgrid::simix::marshal>(simcall->result_, result); -} - static inline simgrid::kernel::activity::CommImpl** simcall_comm_waitany__get__comms(smx_simcall_t simcall) { return simgrid::simix::unmarshal(simcall->args_[0]); @@ -601,9 +117,5 @@ static inline void simcall_run_blocking__set__code(smx_simcall_t simcall, std::f /* The prototype of all simcall handlers, automatically generated for you */ -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_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_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); diff --git a/src/simix/popping_bodies.cpp b/src/simix/popping_bodies.cpp index 3cdd0c0bb5..0bdfa2536c 100644 --- a/src/simix/popping_bodies.cpp +++ b/src/simix/popping_bodies.cpp @@ -41,34 +41,6 @@ inline static R simcall(Simcall call, T const&... t) return simgrid::simix::unmarshal(self->simcall_.result_); } -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 (false) /* Go to that function to follow the code flow through the simcall barrier */ - simcall_HANDLER_comm_recv(&simgrid::kernel::actor::ActorImpl::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); -} - -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 (false) /* Go to that function to follow the code flow through the simcall barrier */ - simcall_HANDLER_comm_irecv(&simgrid::kernel::actor::ActorImpl::self()->simcall_, 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 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 (false) /* Go to that function to follow the code flow through the simcall barrier */ - simcall_HANDLER_comm_send(&simgrid::kernel::actor::ActorImpl::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); -} - -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 (false) /* Go to that function to follow the code flow through the simcall barrier */ - simcall_HANDLER_comm_isend(&simgrid::kernel::actor::ActorImpl::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, 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 ssize_t simcall_BODY_comm_waitany(simgrid::kernel::activity::CommImpl** comms, size_t count, double timeout) { if (false) /* Go to that function to follow the code flow through the simcall barrier */ diff --git a/src/simix/popping_enum.hpp b/src/simix/popping_enum.hpp index aac349c039..423e8e90eb 100644 --- a/src/simix/popping_enum.hpp +++ b/src/simix/popping_enum.hpp @@ -21,16 +21,12 @@ namespace simix { */ enum class Simcall { NONE, - COMM_RECV, - COMM_IRECV, - COMM_SEND, - COMM_ISEND, COMM_WAITANY, COMM_WAIT, RUN_KERNEL, RUN_BLOCKING, }; -constexpr int NUM_SIMCALLS = 9; +constexpr int NUM_SIMCALLS = 5; } // namespace simix } // namespace simgrid diff --git a/src/simix/popping_generated.cpp b/src/simix/popping_generated.cpp index 637e267fa6..580a3de61e 100644 --- a/src/simix/popping_generated.cpp +++ b/src/simix/popping_generated.cpp @@ -30,10 +30,6 @@ using simgrid::simix::Simcall; /** @brief Simcalls' names (generated from src/simix/simcalls.in) */ constexpr std::array simcall_names{{ "Simcall::NONE", - "Simcall::COMM_RECV", - "Simcall::COMM_IRECV", - "Simcall::COMM_SEND", - "Simcall::COMM_ISEND", "Simcall::COMM_WAITANY", "Simcall::COMM_WAIT", "Simcall::RUN_KERNEL", @@ -53,24 +49,6 @@ void simgrid::kernel::actor::ActorImpl::simcall_handle(int times_considered) if (context_->wannadie()) return; switch (simcall_.call_) { - 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])); - 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]))); - simcall_answer(); - 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])); - 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]))); - simcall_answer(); - break; - case Simcall::COMM_WAITANY: simcall_HANDLER_comm_waitany(&simcall_, simgrid::simix::unmarshal(simcall_.args_[0]), simgrid::simix::unmarshal(simcall_.args_[1]), simgrid::simix::unmarshal(simcall_.args_[2])); break; diff --git a/src/simix/simcalls.in b/src/simix/simcalls.in index 4fe1426942..05db4ee393 100644 --- a/src/simix/simcalls.in +++ b/src/simix/simcalls.in @@ -35,10 +35,6 @@ # Last but not the least, you should declare the new simix call in # ./include/simgrid/simix.h (otherwise you will get a warning at compile time) -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); -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); ssize_t comm_waitany(simgrid::kernel::activity::CommImpl** comms, size_t count, double timeout) [[block]]; void comm_wait(simgrid::kernel::activity::CommImpl* comm, double timeout) [[block]]; diff --git a/src/simix/simcalls.py b/src/simix/simcalls.py index b278080f02..78e2c94929 100755 --- a/src/simix/simcalls.py +++ b/src/simix/simcalls.py @@ -338,7 +338,6 @@ def main(): fd.write('void simgrid::kernel::actor::ActorImpl::simcall_handle(int times_considered)\n') fd.write('{\n') fd.write(' XBT_DEBUG("Handling simcall %p: %s", &simcall_, SIMIX_simcall_name(simcall_));\n') - fd.write(' simcall_.mc_value_ = times_considered;\n') fd.write(' if (simcall_.observer_ != nullptr)\n') fd.write(' simcall_.observer_->prepare(times_considered);\n') -- 2.20.1