#include "src/kernel/actor/SimcallObserver.hpp"
#include <simgrid/s4u/Activity.hpp>
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix);
+#define SIMIX_H_NO_DEPRECATED_WARNING // avoid deprecation warning on include (remove with XBT_ATTRIB_DEPRECATED_v335)
+#include <simgrid/simix.h>
+
+XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(ker_simcall);
/**
* @ingroup simix_comm_management
*/
-void simcall_comm_send(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff,
- size_t src_buff_size, bool (*match_fun)(void*, void*, simgrid::kernel::activity::CommImpl*),
+void simcall_comm_send(simgrid::kernel::actor::ActorImpl* sender, smx_mailbox_t mbox, double task_size, double rate,
+ void* 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) // XBT_ATTRIB_DEPRECATED_v335
{
* @ingroup simix_comm_management
*/
simgrid::kernel::activity::ActivityImplPtr
-simcall_comm_isend(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff,
- size_t src_buff_size, bool (*match_fun)(void*, void*, simgrid::kernel::activity::CommImpl*),
- void (*clean_fun)(void*), void (*copy_data_fun)(simgrid::kernel::activity::CommImpl*, void*, size_t),
- void* data, bool detached) // XBT_ATTRIB_DEPRECATED_v335
+simcall_comm_isend(simgrid::kernel::actor::ActorImpl* sender, smx_mailbox_t mbox, double task_size, double rate,
+ void* src_buff, size_t src_buff_size,
+ bool (*match_fun)(void*, void*, simgrid::kernel::activity::CommImpl*), void (*clean_fun)(void*),
+ void (*copy_data_fun)(simgrid::kernel::activity::CommImpl*, void*, size_t), void* data,
+ bool detached) // XBT_ATTRIB_DEPRECATED_v335
{
/* checking for infinite values */
xbt_assert(std::isfinite(task_size), "task_size is not finite!");
/**
* @ingroup simix_comm_management
*/
-void simcall_comm_recv(smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size,
- bool (*match_fun)(void*, void*, simgrid::kernel::activity::CommImpl*),
+void simcall_comm_recv(simgrid::kernel::actor::ActorImpl* receiver, smx_mailbox_t mbox, void* 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) // XBT_ATTRIB_DEPRECATED_v335
{
* @ingroup simix_comm_management
*/
simgrid::kernel::activity::ActivityImplPtr
-simcall_comm_irecv(smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size,
- bool (*match_fun)(void*, void*, simgrid::kernel::activity::CommImpl*),
+simcall_comm_irecv(simgrid::kernel::actor::ActorImpl* receiver, smx_mailbox_t mbox, void* 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) // XBT_ATTRIB_DEPRECATED_v335
{
return false;
}
-static void simcall(simgrid::simix::Simcall call, std::function<void()> const& code)
+static void simcall(simgrid::kernel::actor::Simcall::Type call, std::function<void()> const& code)
{
auto self = simgrid::kernel::actor::ActorImpl::self();
self->simcall_.call_ = call;
self->simcall_.code_ = &code;
if (not simgrid::kernel::EngineImpl::get_instance()->is_maestro(self)) {
- XBT_DEBUG("Yield process '%s' on simcall %s", self->get_cname(), SIMIX_simcall_name(self->simcall_));
+ XBT_DEBUG("Yield process '%s' on simcall %s", self->get_cname(), self->simcall_.get_cname());
self->yield();
} else {
self->simcall_handle(0);
simgrid::kernel::actor::ActorImpl::self()->simcall_.observer_ = observer;
// The function `code` is called in kernel mode (either because we are already in maestor or after a context switch)
// and simcall_answer() is called
- simcall(simgrid::simix::Simcall::RUN_ANSWERED, code);
+ simcall(simgrid::kernel::actor::Simcall::Type::RUN_ANSWERED, code);
simgrid::kernel::actor::ActorImpl::self()->simcall_.observer_ = nullptr;
}
simgrid::kernel::actor::ActorImpl::self()->simcall_.observer_ = observer;
// The function `code` is called in kernel mode (either because we are already in maestor or after a context switch)
// BUT simcall_answer IS NOT CALLED
- simcall(simgrid::simix::Simcall::RUN_BLOCKING, code);
+ simcall(simgrid::kernel::actor::Simcall::Type::RUN_BLOCKING, code);
simgrid::kernel::actor::ActorImpl::self()->simcall_.observer_ = nullptr;
}