teshsuite/smpi/type-struct/type-struct
teshsuite/smpi/type-vector/type-vector
teshsuite/s4u/actor/actor
+teshsuite/s4u/comm-pt2pt/comm-pt2pt
teshsuite/s4u/concurrent_rw/concurrent_rw
teshsuite/s4u/host_on_off_wait/host_on_off_wait
teshsuite/s4u/listen_async/listen_async
namespace kernel {
namespace activity {
class ActivityImpl;
+ using ActivityImplPtr = boost::intrusive_ptr<ActivityImpl>;
XBT_PUBLIC(void) intrusive_ptr_add_ref(ActivityImpl* activity);
XBT_PUBLIC(void) intrusive_ptr_release(ActivityImpl* activity);
+
+ class CommImpl;
+ using CommImplPtr = boost::intrusive_ptr<CommImpl>;
+ class ExecImpl;
+ using ExecImplPtr = boost::intrusive_ptr<ExecImpl>;
+ class IoImpl;
+ using IoImplPtr = boost::intrusive_ptr<IoImpl>;
+ class RawImpl;
+ using RawImplPtr = boost::intrusive_ptr<RawImpl>;
+ class SleepImpl;
+ using SleepImplPtr = boost::intrusive_ptr<SleepImpl>;
}
namespace routing {
class NetPoint;
}
}
namespace simix {
+ class ActorImpl;
+ using ActorImplPtr = boost::intrusive_ptr<ActorImpl>;
class Host;
}
namespace surf {
typedef simgrid::s4u::File s4u_File;
typedef simgrid::s4u::Storage s4u_Storage;
typedef simgrid::s4u::NetZone s4u_NetZone;
-typedef simgrid::kernel::activity::ActivityImpl* smx_activity_t;
+typedef boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> smx_activity_t;
typedef simgrid::kernel::routing::NetPoint routing_NetPoint;
typedef simgrid::surf::Resource surf_Resource;
typedef simgrid::trace_mgr::trace tmgr_Trace;
void *getUserData() { return userData_; }
private:
- simgrid::kernel::activity::ActivityImpl *pimpl_ = nullptr;
+ simgrid::kernel::activity::ActivityImplPtr pimpl_ = nullptr;
e_s4u_activity_state_t state_ = inited;
double remains_ = 0;
void *userData_ = nullptr;
virtual ~Comm();
- /*! take a range of s4u::Comm* (last excluded) and return when one of them is finished. The return value is an
+ /*! take a range of s4u::CommPtr (last excluded) and return when one of them is finished. The return value is an
* iterator on the finished Comms. */
template <class I> static I wait_any(I first, I last)
{
// Map to dynar<Synchro*>:
- xbt_dynar_t comms = xbt_dynar_new(sizeof(simgrid::kernel::activity::ActivityImpl*), NULL);
+ xbt_dynar_t comms = xbt_dynar_new(sizeof(simgrid::kernel::activity::ActivityImpl*), [](void*ptr){
+ intrusive_ptr_release(*(simgrid::kernel::activity::ActivityImpl**)ptr);
+ });
for (I iter = first; iter != last; iter++) {
- Comm& comm = **iter;
- if (comm.state_ == inited)
- comm.start();
- xbt_assert(comm.state_ == started);
- xbt_dynar_push_as(comms, simgrid::kernel::activity::ActivityImpl*, comm.pimpl_);
+ CommPtr comm = *iter;
+ if (comm->state_ == inited)
+ comm->start();
+ xbt_assert(comm->state_ == started);
+ simgrid::kernel::activity::ActivityImpl* ptr = comm->pimpl_.get();
+ intrusive_ptr_add_ref(ptr);
+ xbt_dynar_push_as(comms, simgrid::kernel::activity::ActivityImpl*, ptr);
}
// Call the underlying simcall:
int idx = simcall_comm_waitany(comms, -1);
(*res)->state_ = finished;
return res;
}
- /*! Same as wait_any, but with a timeout. If wait_any_for return because of the timeout last is returned.*/
+ /*! Same as wait_any, but with a timeout. If the timeout occurs, parameter last is returned.*/
template <class I> static I wait_any_for(I first, I last, double timeout)
{
// Map to dynar<Synchro*>:
- xbt_dynar_t comms = xbt_dynar_new(sizeof(simgrid::kernel::activity::ActivityImpl*), NULL);
+ xbt_dynar_t comms = xbt_dynar_new(sizeof(simgrid::kernel::activity::ActivityImpl*), [](void*ptr){
+ intrusive_ptr_release(*(simgrid::kernel::activity::ActivityImpl**)ptr);
+ });
for (I iter = first; iter != last; iter++) {
- Comm& comm = **iter;
- if (comm.state_ == inited)
- comm.start();
- xbt_assert(comm.state_ == started);
- xbt_dynar_push_as(comms, simgrid::kernel::activity::ActivityImpl*, comm.pimpl_);
+ CommPtr comm = *iter;
+ if (comm->state_ == inited)
+ comm->start();
+ xbt_assert(comm->state_ == started);
+ simgrid::kernel::activity::ActivityImpl* ptr = comm->pimpl_.get();
+ intrusive_ptr_add_ref(ptr);
+ xbt_dynar_push_as(comms, simgrid::kernel::activity::ActivityImpl*, ptr);
}
// Call the underlying simcall:
int idx = simcall_comm_waitany(comms, timeout);
#include "src/kernel/activity/ActivityImpl.hpp"
+XBT_LOG_EXTERNAL_CATEGORY(simix_process);
+
namespace simgrid {
namespace kernel {
namespace activity {
ActivityImpl::ActivityImpl() = default;
ActivityImpl::~ActivityImpl() = default;
-void ActivityImpl::ref()
-{
- // Atomic operation! Do not split in two instructions!
- xbt_assert(refcount_ != 0);
- refcount_++;
-}
-
-void ActivityImpl::unref()
-{
- xbt_assert(refcount_ > 0,
- "This activity has a negative refcount! You can only call test() or wait() once per activity.");
- refcount_--;
- if (refcount_ == 0)
- delete this;
-}
-
// boost::intrusive_ptr<Activity> support:
void intrusive_ptr_add_ref(simgrid::kernel::activity::ActivityImpl* activity)
{
- activity->ref();
+ xbt_assert(activity->refcount_ >= 0);
+ activity->refcount_++;
+ XBT_CDEBUG(simix_process, "%p->refcount++ ~> %d", activity, (int)activity->refcount_);
+ if (XBT_LOG_ISENABLED(simix_process, xbt_log_priority_trace))
+ xbt_backtrace_display_current();
}
void intrusive_ptr_release(simgrid::kernel::activity::ActivityImpl* activity)
{
- activity->unref();
+ XBT_CDEBUG(simix_process, "%p->refcount-- ~> %d", activity, ((int)activity->refcount_) - 1);
+ xbt_assert(activity->refcount_ >= 0);
+ activity->refcount_--;
+ if (XBT_LOG_ISENABLED(simix_process, xbt_log_priority_trace))
+ xbt_backtrace_display_current();
+ if (activity->refcount_ <= 0)
+ delete activity;
}
}
}
virtual void resume()=0;
virtual void post() =0; // What to do when a simcall terminates
- /** @brief Increases the refcount */
- void ref();
- /** @brief Reduces the refcount */
- void unref();
-
- // boost::intrusive_ptr<Activity> support:
+ // boost::intrusive_ptr<ActivityImpl> support:
friend void intrusive_ptr_add_ref(ActivityImpl * activity);
friend void intrusive_ptr_release(ActivityImpl * activity);
private:
- std::atomic_int_fast32_t refcount_{1};
+ std::atomic_int_fast32_t refcount_{0};
};
}}} // namespace simgrid::kernel::activity
state = SIMIX_WAITING;
src_data = nullptr;
dst_data = nullptr;
- intrusive_ptr_add_ref(this);
XBT_DEBUG("Create comm activity %p", this);
}
if (state == SIMIX_WAITING) {
mbox->remove(this);
state = SIMIX_CANCELED;
- this->unref();
} else if (not MC_is_active() /* when running the MC there are no surf actions */
&& not MC_record_replay_is_active() && (state == SIMIX_READY || state == SIMIX_RUNNING)) {
/* if there are simcalls associated with the synchro, then answer them */
if (not simcalls.empty()) {
SIMIX_comm_finish(this);
- this->unref();
}
}
if (name)
this->name = name;
this->state = SIMIX_RUNNING;
+ XBT_DEBUG("Create exec %p", this);
}
simgrid::kernel::activity::ExecImpl::~ExecImpl()
surf_exec->unref();
if (timeoutDetector)
timeoutDetector->unref();
+ XBT_DEBUG("Destroy exec %p", this);
}
void simgrid::kernel::activity::ExecImpl::suspend()
{
/** @brief Pushes a communication activity into a mailbox
* @param comm What to add
*/
-void MailboxImpl::push(activity::CommImpl* comm)
+void MailboxImpl::push(activity::CommImplPtr comm)
{
- this->comm_queue.push_back(comm);
comm->mbox = this;
+ this->comm_queue.push_back(std::move(comm));
}
/** @brief Removes a communication activity from a mailbox
*/
void MailboxImpl::remove(smx_activity_t activity)
{
- simgrid::kernel::activity::CommImpl* comm = static_cast<simgrid::kernel::activity::CommImpl*>(activity);
+ simgrid::kernel::activity::CommImplPtr comm =
+ boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(activity);
+ xbt_assert(comm->mbox == this, "Comm %p is in mailbox %s, not mailbox %s", comm,
+ (comm->mbox ? comm->mbox->name_ : "(null)"), this->name_);
comm->mbox = nullptr;
for (auto it = this->comm_queue.begin(); it != this->comm_queue.end(); it++)
if (*it == comm) {
this->comm_queue.erase(it);
return;
}
- xbt_die("Cannot remove the comm %p that is not part of the mailbox %s", comm, this->name_);
+ xbt_die("Comm %p not found in mailbox %s", comm, this->name_);
}
}
}
static MailboxImpl* byNameOrNull(const char* name);
static MailboxImpl* byNameOrCreate(const char* name);
void setReceiver(s4u::ActorPtr actor);
- void push(activity::CommImpl* comm);
+ void push(activity::CommImplPtr comm);
void remove(smx_activity_t activity);
simgrid::s4u::Mailbox piface_; // Our interface
char* name_;
- boost::intrusive_ptr<simgrid::simix::ActorImpl> permanent_receiver; // process which the mailbox is attached to
+ simgrid::simix::ActorImplPtr permanent_receiver; // process which the mailbox is attached to
boost::circular_buffer_space_optimized<smx_activity_t> comm_queue;
boost::circular_buffer_space_optimized<smx_activity_t> done_comm_queue; // messages already received in the permanent receive mode
};
#include "src/surf/surf_interface.hpp"
#include "src/simix/smx_private.h"
-void simgrid::kernel::activity::Io::suspend()
+void simgrid::kernel::activity::IoImpl::suspend()
{
if (surf_io)
surf_io->suspend();
}
-void simgrid::kernel::activity::Io::resume()
+void simgrid::kernel::activity::IoImpl::resume()
{
if (surf_io)
surf_io->resume();
}
-void simgrid::kernel::activity::Io::post()
+void simgrid::kernel::activity::IoImpl::post()
{
for (smx_simcall_t simcall : simcalls) {
switch (simcall->call) {
namespace kernel {
namespace activity {
- XBT_PUBLIC_CLASS Io : public ActivityImpl {
- public:
- void suspend() override;
- void resume() override;
- void post() override;
-
- sg_host_t host = nullptr;
- surf_action_t surf_io = nullptr;
+XBT_PUBLIC_CLASS IoImpl : public ActivityImpl
+{
+public:
+ void suspend() override;
+ void resume() override;
+ void post() override;
+
+ sg_host_t host = nullptr;
+ surf_action_t surf_io = nullptr;
};
}}} // namespace simgrid::kernel::activity
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_synchro);
-simgrid::kernel::activity::Raw::~Raw()
+simgrid::kernel::activity::RawImpl::~RawImpl()
{
sleep->unref();
}
-void simgrid::kernel::activity::Raw::suspend()
+void simgrid::kernel::activity::RawImpl::suspend()
{
/* The suspension of raw synchros is delayed to when the process is rescheduled. */
}
-void simgrid::kernel::activity::Raw::resume()
+void simgrid::kernel::activity::RawImpl::resume()
{
/* I cannot resume raw synchros directly. This is delayed to when the process is rescheduled at
* the end of the synchro. */
}
-void simgrid::kernel::activity::Raw::post()
+void simgrid::kernel::activity::RawImpl::post()
{
XBT_IN("(%p)",this);
if (sleep->getState() == simgrid::surf::Action::State::failed)
namespace activity {
/** Used to implement mutexes, semaphores and conditions */
- XBT_PUBLIC_CLASS Raw : public ActivityImpl {
- public:
- ~Raw() override;
- void suspend() override;
- void resume() override;
- void post() override;
-
- surf_action_t sleep = nullptr;
+XBT_PUBLIC_CLASS RawImpl : public ActivityImpl
+{
+public:
+ ~RawImpl() override;
+ void suspend() override;
+ void resume() override;
+ void post() override;
+
+ surf_action_t sleep = nullptr;
};
}}} // namespace simgrid::kernel::activity
if (call_type == MC_CALL_TYPE_SEND) {
/* Create comm pattern */
pattern->type = simgrid::mc::PatternCommunicationType::send;
- pattern->comm_addr = simcall_comm_isend__get__result(request);
+ pattern->comm_addr = static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_isend__getraw__result(request));
simgrid::mc::Remote<simgrid::kernel::activity::CommImpl> temp_synchro;
mc_model_checker->process().read(temp_synchro,
}
} else if (call_type == MC_CALL_TYPE_RECV) {
pattern->type = simgrid::mc::PatternCommunicationType::receive;
- pattern->comm_addr = simcall_comm_irecv__get__result(request);
+ pattern->comm_addr = static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_irecv__getraw__result(request));
simgrid::smpi::Request mpi_request;
mc_model_checker->process().read(&mpi_request,
{
/* FIXME: check also that src and dst processes are not suspended */
simgrid::kernel::activity::CommImpl* act =
- static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_wait__get__comm(req));
+ static_cast<simgrid::kernel::activity::CommImpl*>(&*simcall_comm_wait__get__comm(req));
#if SIMGRID_HAVE_MC
// Fetch from MCed memory:
case SIMCALL_COMM_WAITANY: {
xbt_dynar_t comms;
simgrid::kernel::activity::CommImpl* act =
- static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_wait__get__comm(req));
+ static_cast<simgrid::kernel::activity::CommImpl*>(&*simcall_comm_wait__get__comm(req));
#if SIMGRID_HAVE_MC
s_xbt_dynar_t comms_buffer;
{
simgrid::mc::RemotePtr<simgrid::kernel::activity::CommImpl> comm_addr = nullptr;
if (call_type == MC_CALL_TYPE_WAIT)
- comm_addr = remote(static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_wait__get__comm(req)));
+ comm_addr = remote(static_cast<simgrid::kernel::activity::CommImpl*>(
+ simgrid::simix::unmarshal<simgrid::kernel::activity::ActivityImpl*>(req->result)));
+
else {
simgrid::kernel::activity::CommImpl* addr;
// comm_addr = REMOTE(xbt_dynar_get_as(simcall_comm_waitany__get__comms(req), value, smx_synchro_t)):
{
switch (r->call ) {
case SIMCALL_COMM_WAIT:
- return static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_wait__get__comm(r));
+ return static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_wait__getraw__comm(r));
case SIMCALL_COMM_TEST:
- return static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_test__get__comm(r));
+ return static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_test__getraw__comm(r));
default:
return nullptr;
}
case SIMCALL_COMM_WAIT: {
simgrid::kernel::activity::CommImpl* remote_act =
- static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_wait__get__comm(req));
+ static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_wait__getraw__comm(req));
char* p;
if (value == -1) {
type = "WaitTimeout";
case SIMCALL_COMM_TEST: {
simgrid::kernel::activity::CommImpl* remote_act =
- static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_test__get__comm(req));
+ static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_test__getraw__comm(req));
simgrid::mc::Remote<simgrid::kernel::activity::CommImpl> temp_synchro;
simgrid::kernel::activity::CommImpl* act;
if (use_remote_comm) {
read_element(mc_model_checker->process(),
&remote_sync, remote(simcall_comm_waitany__get__comms(req)), value,
sizeof(remote_sync));
- char* p = pointer_to_string(remote_sync);
+ char* p = pointer_to_string(&*remote_sync);
args = bprintf("comm=%s (%d of %lu)",
p, value + 1, xbt_dynar_length(&comms));
xbt_free(p);
bool request_is_enabled_by_idx(smx_simcall_t req, unsigned int idx)
{
- smx_activity_t remote_act = nullptr;
+ simgrid::kernel::activity::ActivityImpl* remote_act = nullptr;
switch (req->call) {
case SIMCALL_COMM_WAIT:
/* FIXME: check also that src and dst processes are not suspended */
- remote_act = simcall_comm_wait__get__comm(req);
+ remote_act = simcall_comm_wait__getraw__comm(req);
break;
case SIMCALL_COMM_WAITANY: {
- read_element(
- mc_model_checker->process(), &remote_act,
- remote(simcall_comm_waitany__get__comms(req)),
- idx, sizeof(remote_act));
+ read_element(mc_model_checker->process(), &remote_act, remote(simcall_comm_waitany__getraw__comms(req)), idx,
+ sizeof(remote_act));
}
break;
case SIMCALL_COMM_TESTANY:
- remote_act = mc_model_checker->process().read(remote(
- simcall_comm_testany__get__comms(req) + idx));
+ remote_act = mc_model_checker->process().read(remote(simcall_comm_testany__getraw__comms(req) + idx));
break;
default:
else
label = simgrid::xbt::string_printf("[(%lu)] WaitTimeout", issuer->pid);
} else {
- smx_activity_t remote_act = simcall_comm_wait__get__comm(req);
+ simgrid::kernel::activity::ActivityImpl* remote_act = simcall_comm_wait__getraw__comm(req);
simgrid::mc::Remote<simgrid::kernel::activity::CommImpl> temp_comm;
mc_model_checker->process().read(temp_comm,
remote(static_cast<simgrid::kernel::activity::CommImpl*>(remote_act)));
}
case SIMCALL_COMM_TEST: {
- smx_activity_t remote_act = simcall_comm_test__get__comm(req);
+ simgrid::kernel::activity::ActivityImpl* remote_act = simcall_comm_test__getraw__comm(req);
simgrid::mc::Remote<simgrid::kernel::activity::CommImpl> temp_comm;
mc_model_checker->process().read(temp_comm, remote(static_cast<simgrid::kernel::activity::CommImpl*>(remote_act)));
simgrid::kernel::activity::CommImpl* comm = temp_comm.getBuffer();
case SIMCALL_COMM_WAIT: {
simgrid::mc::RemotePtr<simgrid::kernel::activity::CommImpl> remote_act =
- remote(static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_wait__get__comm(&actor->simcall)));
+ remote(static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_wait__getraw__comm(&actor->simcall)));
simgrid::mc::Remote<simgrid::kernel::activity::CommImpl> temp_act;
mc_model_checker->process().read(temp_act, remote_act);
simgrid::kernel::activity::CommImpl* act = temp_act.getBuffer();
switch (req->call) {
case SIMCALL_COMM_WAITANY: {
state->internal_req.call = SIMCALL_COMM_WAIT;
- smx_activity_t remote_comm;
- read_element(mc_model_checker->process(),
- &remote_comm, remote(simcall_comm_waitany__get__comms(req)),
- state->transition.argument, sizeof(remote_comm));
+ simgrid::kernel::activity::ActivityImpl* remote_comm;
+ read_element(mc_model_checker->process(), &remote_comm, remote(simcall_comm_waitany__getraw__comms(req)),
+ state->transition.argument, sizeof(remote_comm));
mc_model_checker->process().read(state->internal_comm,
remote(static_cast<simgrid::kernel::activity::CommImpl*>(remote_comm)));
simcall_comm_wait__set__comm(&state->internal_req, state->internal_comm.getBuffer());
state->internal_req.call = SIMCALL_COMM_TEST;
if (state->transition.argument > 0) {
- smx_activity_t remote_comm = mc_model_checker->process().read(
- remote(simcall_comm_testany__get__comms(req) + state->transition.argument));
+ simgrid::kernel::activity::ActivityImpl* remote_comm = mc_model_checker->process().read(
+ remote(simcall_comm_testany__getraw__comms(req) + state->transition.argument));
mc_model_checker->process().read(state->internal_comm,
remote(static_cast<simgrid::kernel::activity::CommImpl*>(remote_comm)));
}
break;
case SIMCALL_COMM_WAIT:
- mc_model_checker->process().read_bytes(&state->internal_comm ,
- sizeof(state->internal_comm), remote(simcall_comm_wait__get__comm(req)));
+ mc_model_checker->process().read_bytes(&state->internal_comm, sizeof(state->internal_comm),
+ remote(simcall_comm_wait__getraw__comm(req)));
simcall_comm_wait__set__comm(&state->executed_req, state->internal_comm.getBuffer());
simcall_comm_wait__set__comm(&state->internal_req, state->internal_comm.getBuffer());
break;
case SIMCALL_COMM_TEST:
- mc_model_checker->process().read_bytes(&state->internal_comm,
- sizeof(state->internal_comm), remote(simcall_comm_test__get__comm(req)));
+ mc_model_checker->process().read_bytes(&state->internal_comm, sizeof(state->internal_comm),
+ remote(simcall_comm_test__getraw__comm(req)));
simcall_comm_test__set__comm(&state->executed_req, state->internal_comm.getBuffer());
simcall_comm_test__set__comm(&state->internal_req, state->internal_comm.getBuffer());
break;
struct PatternCommunication {
int num = 0;
- smx_activity_t comm_addr;
+ simgrid::kernel::activity::CommImpl* comm_addr;
PatternCommunicationType type = PatternCommunicationType::send;
unsigned long src_proc = 0;
unsigned long dst_proc = 0;
#include <xbt/ex.hpp>
+#include "src/kernel/activity/ExecImpl.hpp"
#include "src/msg/msg_private.h"
#include "src/simix/smx_private.h" /* MSG_task_listen looks inside the rdv directly. Not clean. */
simdata->setUsed();
if (simdata->host_nb > 0) {
- simdata->compute = static_cast<simgrid::kernel::activity::ExecImpl*>(simcall_execution_parallel_start(
- task->name, simdata->host_nb, simdata->host_list, simdata->flops_parallel_amount,
- simdata->bytes_parallel_amount, 1.0, -1.0, timeout));
- XBT_DEBUG("Parallel execution action created: %p", simdata->compute);
+ simdata->compute =
+ boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(simcall_execution_parallel_start(
+ task->name, simdata->host_nb, simdata->host_list, simdata->flops_parallel_amount,
+ simdata->bytes_parallel_amount, 1.0, -1.0, timeout));
+ XBT_DEBUG("Parallel execution action created: %p", simdata->compute.get());
} else {
- simdata->compute = static_cast<simgrid::kernel::activity::ExecImpl*>(
+ simdata->compute = boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(
simcall_execution_start(task->name, simdata->flops_amount, simdata->priority, simdata->bound));
}
simcall_set_category(simdata->compute, task->category);
/* Send it by calling SIMIX network layer */
smx_activity_t act = simcall_comm_isend(myself->getImpl(), mailbox->getImpl(), t_simdata->bytes_amount, t_simdata->rate,
task, sizeof(void *), match_fun, cleanup, nullptr, match_data,detached);
- t_simdata->comm = static_cast<simgrid::kernel::activity::CommImpl*>(act);
+ t_simdata->comm = boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(act);
msg_comm_t comm = nullptr;
if (not detached) {
if (finished && comm->task_received != nullptr) {
/* I am the receiver */
(*comm->task_received)->simdata->setNotUsed();
- comm->s_comm->unref();
}
}
catch (xbt_ex& e) {
int finished_index = -1;
/* Create the equivalent array with SIMIX objects: */
- std::vector<simgrid::kernel::activity::ActivityImpl*> s_comms;
+ std::vector<simgrid::kernel::activity::ActivityImplPtr> s_comms;
s_comms.reserve(xbt_dynar_length(comms));
msg_comm_t comm;
unsigned int cursor;
if (status == MSG_OK && comm->task_received != nullptr) {
/* I am the receiver */
(*comm->task_received)->simdata->setNotUsed();
- comm->s_comm->unref();
}
}
{
try {
simcall_comm_wait(comm->s_comm, timeout);
- comm->s_comm->unref();
if (comm->task_received != nullptr) {
/* I am the receiver */
int finished_index = -1;
/* create the equivalent dynar with SIMIX objects */
- xbt_dynar_t s_comms = xbt_dynar_new(sizeof(smx_activity_t), nullptr);
+ xbt_dynar_t s_comms = xbt_dynar_new(sizeof(smx_activity_t), [](void*ptr){
+ intrusive_ptr_release(*(simgrid::kernel::activity::ActivityImpl**)ptr);
+ });
msg_comm_t comm;
unsigned int cursor;
xbt_dynar_foreach(comms, cursor, comm) {
- xbt_dynar_push(s_comms, &comm->s_comm);
+ intrusive_ptr_add_ref(comm->s_comm.get());
+ xbt_dynar_push_as(s_comms, simgrid::kernel::activity::ActivityImpl*, comm->s_comm.get());
}
msg_error_t status = MSG_OK;
if (comm->task_received != nullptr) {
/* I am the receiver */
(*comm->task_received)->simdata->setNotUsed();
- comm->s_comm->unref();
}
return finished_index;
*/
void MSG_comm_copy_data_from_SIMIX(smx_activity_t synchro, void* buff, size_t buff_size)
{
- simgrid::kernel::activity::CommImpl* comm = static_cast<simgrid::kernel::activity::CommImpl*>(synchro);
+ simgrid::kernel::activity::CommImplPtr comm =
+ boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(synchro);
SIMIX_comm_copy_pointer_callback(comm, buff, buff_size);
t_simdata->rate, task, sizeof(void *), nullptr, nullptr, nullptr, task, 0);
if (TRACE_is_enabled())
simcall_set_category(comm, task->category);
- t_simdata->comm = static_cast<simgrid::kernel::activity::CommImpl*>(comm);
+ t_simdata->comm = boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(comm);
simcall_comm_wait(comm, timeout);
- comm->unref();
}
catch (xbt_ex& e) {
switch (e.category) {
int MSG_task_listen_from(const char *alias)
{
simgrid::s4u::MailboxPtr mbox = simgrid::s4u::Mailbox::byName(alias);
- simgrid::kernel::activity::CommImpl* comm = static_cast<simgrid::kernel::activity::CommImpl*>(mbox->front());
+ simgrid::kernel::activity::CommImplPtr comm =
+ boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(mbox->front());
if (not comm)
return -1;
typedef struct simdata_task {
~simdata_task()
{
- if (this->compute)
- this->compute->unref();
-
/* parallel tasks only */
xbt_free(this->host_list);
}
this->isused = false;
}
- simgrid::kernel::activity::ExecImpl* compute = nullptr; /* SIMIX modeling of computation */
- simgrid::kernel::activity::CommImpl* comm = nullptr; /* SIMIX modeling of communication */
+ simgrid::kernel::activity::ExecImplPtr compute = nullptr; /* SIMIX modeling of computation */
+ simgrid::kernel::activity::CommImplPtr comm = nullptr; /* SIMIX modeling of communication */
double bytes_amount = 0.0; /* Data size */
double flops_amount = 0.0; /* Computation size */
msg_process_t sender = nullptr;
XBT_INFO("pimpl_ is null");
xbt_backtrace_display_current();
}
- if (pimpl_)
- pimpl_->unref();
}
s4u::CommPtr Comm::send_init(s4u::MailboxPtr chan)
matchFunction_, cleanFunction_, copyDataFunction_,
userData_, detached_);
} else if (dstBuff_ != nullptr) { // Receiver side
+ xbt_assert(not detached_, "Receive cannot be detached");
pimpl_ = simcall_comm_irecv(receiver_, mailbox_->getImpl(), dstBuff_, &dstBuffSize_,
matchFunction_, copyDataFunction_,
userData_, rate_);
}
}
state_ = finished;
- if (pimpl_)
- pimpl_->unref();
}
void Comm::wait(double timeout) {
if (state_ == started) {
simcall_comm_wait(pimpl_, timeout);
state_ = finished;
- pimpl_->unref();
return;
}
userData_, timeout, rate_);
}
state_ = finished;
- if (pimpl_)
- pimpl_->unref();
}
void Comm::send_detached(MailboxPtr dest, void* data, int simulatedSize)
void Comm::cancel()
{
- simgrid::kernel::activity::CommImpl* commPimpl = static_cast<simgrid::kernel::activity::CommImpl*>(pimpl_);
+ simgrid::kernel::activity::CommImplPtr commPimpl =
+ boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(pimpl_);
commPimpl->cancel();
}
if(simcall_comm_test(pimpl_)){
state_ = finished;
- pimpl_->unref();
return true;
}
return false;
xbt_os_mutex_acquire(simix_global->mutex);
/* cancel non-blocking communications */
- smx_activity_t synchro = static_cast<smx_activity_t>(process->comms.front());
+ smx_activity_t synchro = process->comms.front();
while (not process->comms.empty()) {
- simgrid::kernel::activity::CommImpl* comm = static_cast<simgrid::kernel::activity::CommImpl*>(synchro);
+ simgrid::kernel::activity::CommImplPtr comm =
+ boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(synchro);
/* make sure no one will finish the comm after this process is destroyed,
* because src_proc or dst_proc would be an invalid pointer */
comm, comm->detached, (int)comm->state, comm->src_proc, comm->dst_proc);
comm->src_proc = nullptr;
- /* I'm not supposed to destroy a detached comm from the sender side, */
- if (comm->detached)
- XBT_DEBUG("Don't destroy it since it's a detached comm and I'm the sender");
- else
- comm->unref();
} else if (comm->dst_proc == process) {
XBT_DEBUG("Found an unfinished recv comm %p, state %d, src = %p, dst = %p",
comm, (int)comm->state, comm->src_proc, comm->dst_proc);
xbt_die("Communication synchro %p is in my list but I'm not the sender nor the receiver", synchro);
}
process->comms.pop_front();
- synchro = static_cast<smx_activity_t>(process->comms.front());
+ synchro = process->comms.front();
comm->cancel();
}
if (host->extension<simgrid::simix::Host>() == nullptr)
host->extension_set<simgrid::simix::Host>(new simgrid::simix::Host());
- /* Add the process to it's host process list */
+ /* Add the process to its host process list */
xbt_swag_insert(process, host->extension<simgrid::simix::Host>()->process_list);
XBT_DEBUG("Start context '%s'", process->name.c_str());
simix_global->process_list[process->pid] = process;
XBT_DEBUG("Inserting %s(%s) in the to_run list", process->cname(), host->cname());
xbt_dynar_push_as(simix_global->process_to_run, smx_actor_t, process);
+ intrusive_ptr_add_ref(process);
/* Tracing the process creation */
TRACE_msg_process_create(process->cname(), process->pid, process->host);
process->exception = nullptr;
/* destroy the blocking synchro if any */
- if (process->waiting_synchro) {
-
- simgrid::kernel::activity::ExecImpl* exec =
- dynamic_cast<simgrid::kernel::activity::ExecImpl*>(process->waiting_synchro);
- simgrid::kernel::activity::CommImpl* comm =
- dynamic_cast<simgrid::kernel::activity::CommImpl*>(process->waiting_synchro);
- simgrid::kernel::activity::SleepImpl* sleep =
- dynamic_cast<simgrid::kernel::activity::SleepImpl*>(process->waiting_synchro);
- simgrid::kernel::activity::Raw *raw = dynamic_cast<simgrid::kernel::activity::Raw*>(process->waiting_synchro);
- simgrid::kernel::activity::Io *io = dynamic_cast<simgrid::kernel::activity::Io*>(process->waiting_synchro);
+ if (process->waiting_synchro != nullptr) {
+
+ simgrid::kernel::activity::ExecImplPtr exec =
+ boost::dynamic_pointer_cast<simgrid::kernel::activity::ExecImpl>(process->waiting_synchro);
+ simgrid::kernel::activity::CommImplPtr comm =
+ boost::dynamic_pointer_cast<simgrid::kernel::activity::CommImpl>(process->waiting_synchro);
+ simgrid::kernel::activity::SleepImplPtr sleep =
+ boost::dynamic_pointer_cast<simgrid::kernel::activity::SleepImpl>(process->waiting_synchro);
+ simgrid::kernel::activity::RawImplPtr raw =
+ boost::dynamic_pointer_cast<simgrid::kernel::activity::RawImpl>(process->waiting_synchro);
+ simgrid::kernel::activity::IoImplPtr io =
+ boost::dynamic_pointer_cast<simgrid::kernel::activity::IoImpl>(process->waiting_synchro);
if (exec != nullptr) {
- exec->unref();
} else if (comm != nullptr) {
process->comms.remove(process->waiting_synchro);
auto i = boost::range::find(process->waiting_synchro->simcalls, &process->simcall);
if (i != process->waiting_synchro->simcalls.end())
process->waiting_synchro->simcalls.remove(&process->simcall);
- comm->unref();
} else if (sleep != nullptr) {
SIMIX_process_sleep_destroy(process->waiting_synchro);
} else if (raw != nullptr) {
SIMIX_synchro_stop_waiting(process, &process->simcall);
- delete process->waiting_synchro;
} else if (io != nullptr) {
SIMIX_io_destroy(process->waiting_synchro);
/* cancel the blocking synchro if any */
if (process->waiting_synchro) {
- simgrid::kernel::activity::ExecImpl* exec =
- dynamic_cast<simgrid::kernel::activity::ExecImpl*>(process->waiting_synchro);
+ simgrid::kernel::activity::ExecImplPtr exec =
+ boost::dynamic_pointer_cast<simgrid::kernel::activity::ExecImpl>(process->waiting_synchro);
if (exec != nullptr) {
SIMIX_execution_cancel(process->waiting_synchro);
}
- simgrid::kernel::activity::CommImpl* comm =
- dynamic_cast<simgrid::kernel::activity::CommImpl*>(process->waiting_synchro);
+ simgrid::kernel::activity::CommImplPtr comm =
+ boost::dynamic_pointer_cast<simgrid::kernel::activity::CommImpl>(process->waiting_synchro);
if (comm != nullptr) {
process->comms.remove(comm);
comm->cancel();
}
- simgrid::kernel::activity::SleepImpl* sleep =
- dynamic_cast<simgrid::kernel::activity::SleepImpl*>(process->waiting_synchro);
+ simgrid::kernel::activity::SleepImplPtr sleep =
+ boost::dynamic_pointer_cast<simgrid::kernel::activity::SleepImpl>(process->waiting_synchro);
if (sleep != nullptr) {
SIMIX_process_sleep_destroy(process->waiting_synchro);
if (not xbt_dynar_member(simix_global->process_to_run, &(process)) && process != SIMIX_process_self()) {
}
}
- simgrid::kernel::activity::Raw *raw = dynamic_cast<simgrid::kernel::activity::Raw*>(process->waiting_synchro);
+ simgrid::kernel::activity::RawImplPtr raw =
+ boost::dynamic_pointer_cast<simgrid::kernel::activity::RawImpl>(process->waiting_synchro);
if (raw != nullptr) {
SIMIX_synchro_stop_waiting(process, &process->simcall);
}
- simgrid::kernel::activity::Io *io = dynamic_cast<simgrid::kernel::activity::Io*>(process->waiting_synchro);
+ simgrid::kernel::activity::IoImplPtr io =
+ boost::dynamic_pointer_cast<simgrid::kernel::activity::IoImpl>(process->waiting_synchro);
if (io != nullptr) {
SIMIX_io_destroy(process->waiting_synchro);
}
simcall->issuer->waiting_synchro = sync;
}
-static int SIMIX_process_join_finish(smx_process_exit_status_t status, smx_activity_t synchro){
+static int SIMIX_process_join_finish(smx_process_exit_status_t status, void* synchro)
+{
simgrid::kernel::activity::SleepImpl* sleep = static_cast<simgrid::kernel::activity::SleepImpl*>(synchro);
if (sleep->surf_sleep) {
sleep->surf_sleep->unref();
sleep->surf_sleep = nullptr;
}
- sleep->unref();
// intrusive_ptr_release(process); // FIXME: We are leaking here. See comment in SIMIX_process_join()
return 0;
}
smx_activity_t SIMIX_process_join(smx_actor_t issuer, smx_actor_t process, double timeout)
{
smx_activity_t res = SIMIX_process_sleep(issuer, timeout);
- static_cast<simgrid::kernel::activity::ActivityImpl*>(res)->ref();
+ intrusive_ptr_add_ref(res.get());
/* We are leaking the process here, but if we don't take the ref, we get a "use after free".
* The correct solution would be to derivate the type SynchroSleep into a SynchroProcessJoin,
* but the code is not clean enough for now for this.
* The C API should first be properly replaced with the C++ one, which is a fair amount of work.
*/
intrusive_ptr_add_ref(process);
- SIMIX_process_on_exit(process, (int_f_pvoid_pvoid_t)SIMIX_process_join_finish, res);
+ SIMIX_process_on_exit(process, (int_f_pvoid_pvoid_t)SIMIX_process_join_finish, &*res);
return res;
}
simgrid::kernel::activity::SleepImpl* synchro = new simgrid::kernel::activity::SleepImpl();
synchro->host = host;
- synchro->surf_sleep = host->pimpl_cpu->sleep(duration);
+ synchro->surf_sleep = host->pimpl_cpu->sleep(duration);
synchro->surf_sleep->setData(synchro);
XBT_DEBUG("Create sleep synchronization %p", synchro);
void SIMIX_process_sleep_destroy(smx_activity_t synchro)
{
- XBT_DEBUG("Destroy synchro %p", synchro);
- simgrid::kernel::activity::SleepImpl* sleep = static_cast<simgrid::kernel::activity::SleepImpl*>(synchro);
+ XBT_DEBUG("Destroy sleep synchro %p", synchro.get());
+ simgrid::kernel::activity::SleepImplPtr sleep =
+ boost::dynamic_pointer_cast<simgrid::kernel::activity::SleepImpl>(synchro);
if (sleep->surf_sleep) {
sleep->surf_sleep->unref();
sleep->surf_sleep = nullptr;
- sleep->unref();
}
}
/* Refcounting */
private:
- std::atomic_int_fast32_t refcount_{1};
+ std::atomic_int_fast32_t refcount_{0};
+
public:
friend void intrusive_ptr_add_ref(ActorImpl* process)
{
void simcall_comm_cancel(smx_activity_t synchro)
{
simgrid::simix::kernelImmediate([synchro] {
- simgrid::kernel::activity::CommImpl* comm = static_cast<simgrid::kernel::activity::CommImpl*>(synchro);
+ simgrid::kernel::activity::CommImplPtr comm =
+ boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(synchro);
comm->cancel();
});
}
static inline smx_actor_t simcall_process_kill__get__process(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
}
+static inline smx_actor_t simcall_process_kill__getraw__process(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
+}
static inline void simcall_process_kill__set__process(smx_simcall_t simcall, smx_actor_t arg) {
simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
}
static inline int simcall_process_killall__get__reset_pid(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<int>(simcall->args[0]);
}
+static inline int simcall_process_killall__getraw__reset_pid(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<int>(simcall->args[0]);
+}
static inline void simcall_process_killall__set__reset_pid(smx_simcall_t simcall, int arg) {
simgrid::simix::marshal<int>(simcall->args[0], arg);
}
static inline smx_actor_t simcall_process_cleanup__get__process(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
}
+static inline smx_actor_t simcall_process_cleanup__getraw__process(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
+}
static inline void simcall_process_cleanup__set__process(smx_simcall_t simcall, smx_actor_t arg) {
simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
}
static inline smx_actor_t simcall_process_suspend__get__process(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
}
+static inline smx_actor_t simcall_process_suspend__getraw__process(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
+}
static inline void simcall_process_suspend__set__process(smx_simcall_t simcall, smx_actor_t arg) {
simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
}
static inline smx_actor_t simcall_process_resume__get__process(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
}
+static inline smx_actor_t simcall_process_resume__getraw__process(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
+}
static inline void simcall_process_resume__set__process(smx_simcall_t simcall, smx_actor_t arg) {
simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
}
static inline smx_actor_t simcall_process_set_host__get__process(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
}
+static inline smx_actor_t simcall_process_set_host__getraw__process(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
+}
static inline void simcall_process_set_host__set__process(smx_simcall_t simcall, smx_actor_t arg) {
simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
}
static inline sg_host_t simcall_process_set_host__get__dest(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<sg_host_t>(simcall->args[1]);
}
+static inline sg_host_t simcall_process_set_host__getraw__dest(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<sg_host_t>(simcall->args[1]);
+}
static inline void simcall_process_set_host__set__dest(smx_simcall_t simcall, sg_host_t arg) {
simgrid::simix::marshal<sg_host_t>(simcall->args[1], arg);
}
static inline smx_actor_t simcall_process_is_suspended__get__process(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
}
+static inline smx_actor_t simcall_process_is_suspended__getraw__process(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
+}
static inline void simcall_process_is_suspended__set__process(smx_simcall_t simcall, smx_actor_t arg) {
simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
}
static inline int simcall_process_is_suspended__get__result(smx_simcall_t simcall){
return simgrid::simix::unmarshal<int>(simcall->result);
}
+static inline int simcall_process_is_suspended__getraw__result(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<int>(simcall->result);
+}
static inline void simcall_process_is_suspended__set__result(smx_simcall_t simcall, int result){
simgrid::simix::marshal<int>(simcall->result, result);
}
static inline smx_actor_t simcall_process_join__get__process(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
}
+static inline smx_actor_t simcall_process_join__getraw__process(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
+}
static inline void simcall_process_join__set__process(smx_simcall_t simcall, smx_actor_t arg) {
simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
}
static inline double simcall_process_join__get__timeout(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<double>(simcall->args[1]);
}
+static inline double simcall_process_join__getraw__timeout(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<double>(simcall->args[1]);
+}
static inline void simcall_process_join__set__timeout(smx_simcall_t simcall, double arg) {
simgrid::simix::marshal<double>(simcall->args[1], arg);
}
static inline int simcall_process_join__get__result(smx_simcall_t simcall){
return simgrid::simix::unmarshal<int>(simcall->result);
}
+static inline int simcall_process_join__getraw__result(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<int>(simcall->result);
+}
static inline void simcall_process_join__set__result(smx_simcall_t simcall, int result){
simgrid::simix::marshal<int>(simcall->result, result);
}
static inline double simcall_process_sleep__get__duration(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<double>(simcall->args[0]);
}
+static inline double simcall_process_sleep__getraw__duration(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<double>(simcall->args[0]);
+}
static inline void simcall_process_sleep__set__duration(smx_simcall_t simcall, double arg) {
simgrid::simix::marshal<double>(simcall->args[0], arg);
}
static inline int simcall_process_sleep__get__result(smx_simcall_t simcall){
return simgrid::simix::unmarshal<int>(simcall->result);
}
+static inline int simcall_process_sleep__getraw__result(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<int>(simcall->result);
+}
static inline void simcall_process_sleep__set__result(smx_simcall_t simcall, int result){
simgrid::simix::marshal<int>(simcall->result, result);
}
static inline const char* simcall_execution_start__get__name(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<const char*>(simcall->args[0]);
}
+static inline const char* simcall_execution_start__getraw__name(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<const char*>(simcall->args[0]);
+}
static inline void simcall_execution_start__set__name(smx_simcall_t simcall, const char* arg) {
simgrid::simix::marshal<const char*>(simcall->args[0], arg);
}
static inline double simcall_execution_start__get__flops_amount(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<double>(simcall->args[1]);
}
+static inline double simcall_execution_start__getraw__flops_amount(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<double>(simcall->args[1]);
+}
static inline void simcall_execution_start__set__flops_amount(smx_simcall_t simcall, double arg) {
simgrid::simix::marshal<double>(simcall->args[1], arg);
}
static inline double simcall_execution_start__get__priority(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<double>(simcall->args[2]);
}
+static inline double simcall_execution_start__getraw__priority(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<double>(simcall->args[2]);
+}
static inline void simcall_execution_start__set__priority(smx_simcall_t simcall, double arg) {
simgrid::simix::marshal<double>(simcall->args[2], arg);
}
static inline double simcall_execution_start__get__bound(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<double>(simcall->args[3]);
}
+static inline double simcall_execution_start__getraw__bound(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<double>(simcall->args[3]);
+}
static inline void simcall_execution_start__set__bound(smx_simcall_t simcall, double arg) {
simgrid::simix::marshal<double>(simcall->args[3], arg);
}
-static inline smx_activity_t simcall_execution_start__get__result(smx_simcall_t simcall){
- return simgrid::simix::unmarshal<smx_activity_t>(simcall->result);
+static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
+simcall_execution_start__get__result(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->result);
}
-static inline void simcall_execution_start__set__result(smx_simcall_t simcall, smx_activity_t result){
- simgrid::simix::marshal<smx_activity_t>(simcall->result, result);
+static inline simgrid::kernel::activity::ActivityImpl* simcall_execution_start__getraw__result(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->result);
+}
+static inline void
+simcall_execution_start__set__result(smx_simcall_t simcall,
+ boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> result)
+{
+ simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->result, result);
}
static inline const char* simcall_execution_parallel_start__get__name(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<const char*>(simcall->args[0]);
}
+static inline const char* simcall_execution_parallel_start__getraw__name(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<const char*>(simcall->args[0]);
+}
static inline void simcall_execution_parallel_start__set__name(smx_simcall_t simcall, const char* arg) {
simgrid::simix::marshal<const char*>(simcall->args[0], arg);
}
static inline int simcall_execution_parallel_start__get__host_nb(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<int>(simcall->args[1]);
}
+static inline int simcall_execution_parallel_start__getraw__host_nb(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<int>(simcall->args[1]);
+}
static inline void simcall_execution_parallel_start__set__host_nb(smx_simcall_t simcall, int arg) {
simgrid::simix::marshal<int>(simcall->args[1], arg);
}
static inline sg_host_t* simcall_execution_parallel_start__get__host_list(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<sg_host_t*>(simcall->args[2]);
}
+static inline sg_host_t* simcall_execution_parallel_start__getraw__host_list(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<sg_host_t*>(simcall->args[2]);
+}
static inline void simcall_execution_parallel_start__set__host_list(smx_simcall_t simcall, sg_host_t* arg) {
simgrid::simix::marshal<sg_host_t*>(simcall->args[2], arg);
}
static inline double* simcall_execution_parallel_start__get__flops_amount(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<double*>(simcall->args[3]);
}
+static inline double* simcall_execution_parallel_start__getraw__flops_amount(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<double*>(simcall->args[3]);
+}
static inline void simcall_execution_parallel_start__set__flops_amount(smx_simcall_t simcall, double* arg) {
simgrid::simix::marshal<double*>(simcall->args[3], arg);
}
static inline double* simcall_execution_parallel_start__get__bytes_amount(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<double*>(simcall->args[4]);
}
+static inline double* simcall_execution_parallel_start__getraw__bytes_amount(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<double*>(simcall->args[4]);
+}
static inline void simcall_execution_parallel_start__set__bytes_amount(smx_simcall_t simcall, double* arg) {
simgrid::simix::marshal<double*>(simcall->args[4], arg);
}
static inline double simcall_execution_parallel_start__get__amount(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<double>(simcall->args[5]);
}
+static inline double simcall_execution_parallel_start__getraw__amount(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<double>(simcall->args[5]);
+}
static inline void simcall_execution_parallel_start__set__amount(smx_simcall_t simcall, double arg) {
simgrid::simix::marshal<double>(simcall->args[5], arg);
}
static inline double simcall_execution_parallel_start__get__rate(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<double>(simcall->args[6]);
}
+static inline double simcall_execution_parallel_start__getraw__rate(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<double>(simcall->args[6]);
+}
static inline void simcall_execution_parallel_start__set__rate(smx_simcall_t simcall, double arg) {
simgrid::simix::marshal<double>(simcall->args[6], arg);
}
static inline double simcall_execution_parallel_start__get__timeout(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<double>(simcall->args[7]);
}
+static inline double simcall_execution_parallel_start__getraw__timeout(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<double>(simcall->args[7]);
+}
static inline void simcall_execution_parallel_start__set__timeout(smx_simcall_t simcall, double arg) {
simgrid::simix::marshal<double>(simcall->args[7], arg);
}
-static inline smx_activity_t simcall_execution_parallel_start__get__result(smx_simcall_t simcall){
- return simgrid::simix::unmarshal<smx_activity_t>(simcall->result);
+static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
+simcall_execution_parallel_start__get__result(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->result);
}
-static inline void simcall_execution_parallel_start__set__result(smx_simcall_t simcall, smx_activity_t result){
- simgrid::simix::marshal<smx_activity_t>(simcall->result, result);
+static inline simgrid::kernel::activity::ActivityImpl*
+simcall_execution_parallel_start__getraw__result(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->result);
}
-
-static inline smx_activity_t simcall_execution_cancel__get__execution(smx_simcall_t simcall) {
- return simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]);
-}
-static inline void simcall_execution_cancel__set__execution(smx_simcall_t simcall, smx_activity_t arg) {
- simgrid::simix::marshal<smx_activity_t>(simcall->args[0], arg);
+static inline void
+simcall_execution_parallel_start__set__result(smx_simcall_t simcall,
+ boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> result)
+{
+ simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->result, result);
}
-static inline smx_activity_t simcall_execution_set_priority__get__execution(smx_simcall_t simcall) {
- return simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]);
+static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
+simcall_execution_cancel__get__execution(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]);
+}
+static inline simgrid::kernel::activity::ActivityImpl*
+simcall_execution_cancel__getraw__execution(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->args[0]);
+}
+static inline void
+simcall_execution_cancel__set__execution(smx_simcall_t simcall,
+ boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> arg)
+{
+ simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0], arg);
}
-static inline void simcall_execution_set_priority__set__execution(smx_simcall_t simcall, smx_activity_t arg) {
- simgrid::simix::marshal<smx_activity_t>(simcall->args[0], arg);
+
+static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
+simcall_execution_set_priority__get__execution(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]);
+}
+static inline simgrid::kernel::activity::ActivityImpl*
+simcall_execution_set_priority__getraw__execution(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->args[0]);
+}
+static inline void
+simcall_execution_set_priority__set__execution(smx_simcall_t simcall,
+ boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> arg)
+{
+ simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0], arg);
}
static inline double simcall_execution_set_priority__get__priority(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<double>(simcall->args[1]);
}
+static inline double simcall_execution_set_priority__getraw__priority(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<double>(simcall->args[1]);
+}
static inline void simcall_execution_set_priority__set__priority(smx_simcall_t simcall, double arg) {
simgrid::simix::marshal<double>(simcall->args[1], arg);
}
-static inline smx_activity_t simcall_execution_set_bound__get__execution(smx_simcall_t simcall) {
- return simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]);
-}
-static inline void simcall_execution_set_bound__set__execution(smx_simcall_t simcall, smx_activity_t arg) {
- simgrid::simix::marshal<smx_activity_t>(simcall->args[0], arg);
+static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
+simcall_execution_set_bound__get__execution(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]);
+}
+static inline simgrid::kernel::activity::ActivityImpl*
+simcall_execution_set_bound__getraw__execution(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->args[0]);
+}
+static inline void
+simcall_execution_set_bound__set__execution(smx_simcall_t simcall,
+ boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> arg)
+{
+ simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0], arg);
}
static inline double simcall_execution_set_bound__get__bound(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<double>(simcall->args[1]);
}
+static inline double simcall_execution_set_bound__getraw__bound(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<double>(simcall->args[1]);
+}
static inline void simcall_execution_set_bound__set__bound(smx_simcall_t simcall, double arg) {
simgrid::simix::marshal<double>(simcall->args[1], arg);
}
-static inline smx_activity_t simcall_execution_wait__get__execution(smx_simcall_t simcall) {
- return simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]);
+static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
+simcall_execution_wait__get__execution(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]);
}
-static inline void simcall_execution_wait__set__execution(smx_simcall_t simcall, smx_activity_t arg) {
- simgrid::simix::marshal<smx_activity_t>(simcall->args[0], arg);
+static inline simgrid::kernel::activity::ActivityImpl* simcall_execution_wait__getraw__execution(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->args[0]);
+}
+static inline void
+simcall_execution_wait__set__execution(smx_simcall_t simcall,
+ boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> arg)
+{
+ simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0], arg);
}
static inline int simcall_execution_wait__get__result(smx_simcall_t simcall){
return simgrid::simix::unmarshal<int>(simcall->result);
}
+static inline int simcall_execution_wait__getraw__result(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<int>(simcall->result);
+}
static inline void simcall_execution_wait__set__result(smx_simcall_t simcall, int result){
simgrid::simix::marshal<int>(simcall->result, result);
}
static inline smx_actor_t simcall_process_on_exit__get__process(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
}
+static inline smx_actor_t simcall_process_on_exit__getraw__process(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
+}
static inline void simcall_process_on_exit__set__process(smx_simcall_t simcall, smx_actor_t arg) {
simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
}
static inline int_f_pvoid_pvoid_t simcall_process_on_exit__get__fun(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<int_f_pvoid_pvoid_t>(simcall->args[1]);
}
+static inline int_f_pvoid_pvoid_t simcall_process_on_exit__getraw__fun(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<int_f_pvoid_pvoid_t>(simcall->args[1]);
+}
static inline void simcall_process_on_exit__set__fun(smx_simcall_t simcall, int_f_pvoid_pvoid_t arg) {
simgrid::simix::marshal<int_f_pvoid_pvoid_t>(simcall->args[1], arg);
}
static inline void* simcall_process_on_exit__get__data(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<void*>(simcall->args[2]);
}
+static inline void* simcall_process_on_exit__getraw__data(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<void*>(simcall->args[2]);
+}
static inline void simcall_process_on_exit__set__data(smx_simcall_t simcall, void* arg) {
simgrid::simix::marshal<void*>(simcall->args[2], arg);
}
static inline smx_actor_t simcall_process_auto_restart_set__get__process(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
}
+static inline smx_actor_t simcall_process_auto_restart_set__getraw__process(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
+}
static inline void simcall_process_auto_restart_set__set__process(smx_simcall_t simcall, smx_actor_t arg) {
simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
}
static inline int simcall_process_auto_restart_set__get__auto_restart(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<int>(simcall->args[1]);
}
+static inline int simcall_process_auto_restart_set__getraw__auto_restart(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<int>(simcall->args[1]);
+}
static inline void simcall_process_auto_restart_set__set__auto_restart(smx_simcall_t simcall, int arg) {
simgrid::simix::marshal<int>(simcall->args[1], arg);
}
static inline smx_actor_t simcall_process_restart__get__process(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
}
+static inline smx_actor_t simcall_process_restart__getraw__process(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
+}
static inline void simcall_process_restart__set__process(smx_simcall_t simcall, smx_actor_t arg) {
simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
}
static inline smx_actor_t simcall_process_restart__get__result(smx_simcall_t simcall){
return simgrid::simix::unmarshal<smx_actor_t>(simcall->result);
}
+static inline smx_actor_t simcall_process_restart__getraw__result(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->result);
+}
static inline void simcall_process_restart__set__result(smx_simcall_t simcall, smx_actor_t result){
simgrid::simix::marshal<smx_actor_t>(simcall->result, result);
}
static inline smx_mailbox_t simcall_comm_iprobe__get__mbox(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[0]);
}
+static inline smx_mailbox_t simcall_comm_iprobe__getraw__mbox(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_mailbox_t>(simcall->args[0]);
+}
static inline void simcall_comm_iprobe__set__mbox(smx_simcall_t simcall, smx_mailbox_t arg) {
simgrid::simix::marshal<smx_mailbox_t>(simcall->args[0], arg);
}
static inline int simcall_comm_iprobe__get__type(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<int>(simcall->args[1]);
}
+static inline int simcall_comm_iprobe__getraw__type(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<int>(simcall->args[1]);
+}
static inline void simcall_comm_iprobe__set__type(smx_simcall_t simcall, int arg) {
simgrid::simix::marshal<int>(simcall->args[1], arg);
}
static inline int simcall_comm_iprobe__get__src(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<int>(simcall->args[2]);
}
+static inline int simcall_comm_iprobe__getraw__src(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<int>(simcall->args[2]);
+}
static inline void simcall_comm_iprobe__set__src(smx_simcall_t simcall, int arg) {
simgrid::simix::marshal<int>(simcall->args[2], arg);
}
static inline int simcall_comm_iprobe__get__tag(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<int>(simcall->args[3]);
}
+static inline int simcall_comm_iprobe__getraw__tag(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<int>(simcall->args[3]);
+}
static inline void simcall_comm_iprobe__set__tag(smx_simcall_t simcall, int arg) {
simgrid::simix::marshal<int>(simcall->args[3], arg);
}
static inline simix_match_func_t simcall_comm_iprobe__get__match_fun(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[4]);
}
+static inline simix_match_func_t simcall_comm_iprobe__getraw__match_fun(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<simix_match_func_t>(simcall->args[4]);
+}
static inline void simcall_comm_iprobe__set__match_fun(smx_simcall_t simcall, simix_match_func_t arg) {
simgrid::simix::marshal<simix_match_func_t>(simcall->args[4], arg);
}
static inline void* simcall_comm_iprobe__get__data(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<void*>(simcall->args[5]);
}
+static inline void* simcall_comm_iprobe__getraw__data(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<void*>(simcall->args[5]);
+}
static inline void simcall_comm_iprobe__set__data(smx_simcall_t simcall, void* arg) {
simgrid::simix::marshal<void*>(simcall->args[5], arg);
}
-static inline smx_activity_t simcall_comm_iprobe__get__result(smx_simcall_t simcall){
- return simgrid::simix::unmarshal<smx_activity_t>(simcall->result);
+static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
+simcall_comm_iprobe__get__result(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->result);
}
-static inline void simcall_comm_iprobe__set__result(smx_simcall_t simcall, smx_activity_t result){
- simgrid::simix::marshal<smx_activity_t>(simcall->result, result);
+static inline simgrid::kernel::activity::ActivityImpl* simcall_comm_iprobe__getraw__result(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->result);
+}
+static inline void
+simcall_comm_iprobe__set__result(smx_simcall_t simcall,
+ boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> result)
+{
+ simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->result, result);
}
static inline smx_actor_t simcall_comm_send__get__sender(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
}
+static inline smx_actor_t simcall_comm_send__getraw__sender(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
+}
static inline void simcall_comm_send__set__sender(smx_simcall_t simcall, smx_actor_t arg) {
simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
}
static inline smx_mailbox_t simcall_comm_send__get__mbox(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]);
}
+static inline smx_mailbox_t simcall_comm_send__getraw__mbox(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_mailbox_t>(simcall->args[1]);
+}
static inline void simcall_comm_send__set__mbox(smx_simcall_t simcall, smx_mailbox_t arg) {
simgrid::simix::marshal<smx_mailbox_t>(simcall->args[1], arg);
}
static inline double simcall_comm_send__get__task_size(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<double>(simcall->args[2]);
}
+static inline double simcall_comm_send__getraw__task_size(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<double>(simcall->args[2]);
+}
static inline void simcall_comm_send__set__task_size(smx_simcall_t simcall, double arg) {
simgrid::simix::marshal<double>(simcall->args[2], arg);
}
static inline double simcall_comm_send__get__rate(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<double>(simcall->args[3]);
}
+static inline double simcall_comm_send__getraw__rate(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<double>(simcall->args[3]);
+}
static inline void simcall_comm_send__set__rate(smx_simcall_t simcall, double arg) {
simgrid::simix::marshal<double>(simcall->args[3], arg);
}
static inline void* simcall_comm_send__get__src_buff(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<void*>(simcall->args[4]);
}
+static inline void* simcall_comm_send__getraw__src_buff(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<void*>(simcall->args[4]);
+}
static inline void simcall_comm_send__set__src_buff(smx_simcall_t simcall, void* arg) {
simgrid::simix::marshal<void*>(simcall->args[4], arg);
}
static inline size_t simcall_comm_send__get__src_buff_size(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<size_t>(simcall->args[5]);
}
+static inline size_t simcall_comm_send__getraw__src_buff_size(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<size_t>(simcall->args[5]);
+}
static inline void simcall_comm_send__set__src_buff_size(smx_simcall_t simcall, size_t arg) {
simgrid::simix::marshal<size_t>(simcall->args[5], arg);
}
static inline simix_match_func_t simcall_comm_send__get__match_fun(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[6]);
}
+static inline simix_match_func_t simcall_comm_send__getraw__match_fun(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<simix_match_func_t>(simcall->args[6]);
+}
static inline void simcall_comm_send__set__match_fun(smx_simcall_t simcall, simix_match_func_t arg) {
simgrid::simix::marshal<simix_match_func_t>(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<simix_copy_data_func_t>(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<simix_copy_data_func_t>(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<simix_copy_data_func_t>(simcall->args[7], arg);
}
static inline void* simcall_comm_send__get__data(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<void*>(simcall->args[8]);
}
+static inline void* simcall_comm_send__getraw__data(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<void*>(simcall->args[8]);
+}
static inline void simcall_comm_send__set__data(smx_simcall_t simcall, void* arg) {
simgrid::simix::marshal<void*>(simcall->args[8], arg);
}
static inline double simcall_comm_send__get__timeout(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<double>(simcall->args[9]);
}
+static inline double simcall_comm_send__getraw__timeout(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<double>(simcall->args[9]);
+}
static inline void simcall_comm_send__set__timeout(smx_simcall_t simcall, double arg) {
simgrid::simix::marshal<double>(simcall->args[9], arg);
}
static inline smx_actor_t simcall_comm_isend__get__sender(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
}
+static inline smx_actor_t simcall_comm_isend__getraw__sender(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
+}
static inline void simcall_comm_isend__set__sender(smx_simcall_t simcall, smx_actor_t arg) {
simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
}
static inline smx_mailbox_t simcall_comm_isend__get__mbox(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]);
}
+static inline smx_mailbox_t simcall_comm_isend__getraw__mbox(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_mailbox_t>(simcall->args[1]);
+}
static inline void simcall_comm_isend__set__mbox(smx_simcall_t simcall, smx_mailbox_t arg) {
simgrid::simix::marshal<smx_mailbox_t>(simcall->args[1], arg);
}
static inline double simcall_comm_isend__get__task_size(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<double>(simcall->args[2]);
}
+static inline double simcall_comm_isend__getraw__task_size(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<double>(simcall->args[2]);
+}
static inline void simcall_comm_isend__set__task_size(smx_simcall_t simcall, double arg) {
simgrid::simix::marshal<double>(simcall->args[2], arg);
}
static inline double simcall_comm_isend__get__rate(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<double>(simcall->args[3]);
}
+static inline double simcall_comm_isend__getraw__rate(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<double>(simcall->args[3]);
+}
static inline void simcall_comm_isend__set__rate(smx_simcall_t simcall, double arg) {
simgrid::simix::marshal<double>(simcall->args[3], arg);
}
static inline void* simcall_comm_isend__get__src_buff(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<void*>(simcall->args[4]);
}
+static inline void* simcall_comm_isend__getraw__src_buff(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<void*>(simcall->args[4]);
+}
static inline void simcall_comm_isend__set__src_buff(smx_simcall_t simcall, void* arg) {
simgrid::simix::marshal<void*>(simcall->args[4], arg);
}
static inline size_t simcall_comm_isend__get__src_buff_size(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<size_t>(simcall->args[5]);
}
+static inline size_t simcall_comm_isend__getraw__src_buff_size(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<size_t>(simcall->args[5]);
+}
static inline void simcall_comm_isend__set__src_buff_size(smx_simcall_t simcall, size_t arg) {
simgrid::simix::marshal<size_t>(simcall->args[5], arg);
}
static inline simix_match_func_t simcall_comm_isend__get__match_fun(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[6]);
}
+static inline simix_match_func_t simcall_comm_isend__getraw__match_fun(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<simix_match_func_t>(simcall->args[6]);
+}
static inline void simcall_comm_isend__set__match_fun(smx_simcall_t simcall, simix_match_func_t arg) {
simgrid::simix::marshal<simix_match_func_t>(simcall->args[6], arg);
}
static inline simix_clean_func_t simcall_comm_isend__get__clean_fun(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<simix_clean_func_t>(simcall->args[7]);
}
+static inline simix_clean_func_t simcall_comm_isend__getraw__clean_fun(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<simix_clean_func_t>(simcall->args[7]);
+}
static inline void simcall_comm_isend__set__clean_fun(smx_simcall_t simcall, simix_clean_func_t arg) {
simgrid::simix::marshal<simix_clean_func_t>(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<simix_copy_data_func_t>(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<simix_copy_data_func_t>(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<simix_copy_data_func_t>(simcall->args[8], arg);
}
static inline void* simcall_comm_isend__get__data(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<void*>(simcall->args[9]);
}
+static inline void* simcall_comm_isend__getraw__data(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<void*>(simcall->args[9]);
+}
static inline void simcall_comm_isend__set__data(smx_simcall_t simcall, void* arg) {
simgrid::simix::marshal<void*>(simcall->args[9], arg);
}
static inline int simcall_comm_isend__get__detached(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<int>(simcall->args[10]);
}
+static inline int simcall_comm_isend__getraw__detached(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<int>(simcall->args[10]);
+}
static inline void simcall_comm_isend__set__detached(smx_simcall_t simcall, int arg) {
simgrid::simix::marshal<int>(simcall->args[10], arg);
}
-static inline smx_activity_t simcall_comm_isend__get__result(smx_simcall_t simcall){
- return simgrid::simix::unmarshal<smx_activity_t>(simcall->result);
+static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
+simcall_comm_isend__get__result(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->result);
}
-static inline void simcall_comm_isend__set__result(smx_simcall_t simcall, smx_activity_t result){
- simgrid::simix::marshal<smx_activity_t>(simcall->result, result);
+static inline simgrid::kernel::activity::ActivityImpl* simcall_comm_isend__getraw__result(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->result);
+}
+static inline void simcall_comm_isend__set__result(smx_simcall_t simcall,
+ boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> result)
+{
+ simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->result, result);
}
static inline smx_actor_t simcall_comm_recv__get__receiver(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
}
+static inline smx_actor_t simcall_comm_recv__getraw__receiver(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
+}
static inline void simcall_comm_recv__set__receiver(smx_simcall_t simcall, smx_actor_t arg) {
simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
}
static inline smx_mailbox_t simcall_comm_recv__get__mbox(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]);
}
+static inline smx_mailbox_t simcall_comm_recv__getraw__mbox(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_mailbox_t>(simcall->args[1]);
+}
static inline void simcall_comm_recv__set__mbox(smx_simcall_t simcall, smx_mailbox_t arg) {
simgrid::simix::marshal<smx_mailbox_t>(simcall->args[1], arg);
}
static inline void* simcall_comm_recv__get__dst_buff(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<void*>(simcall->args[2]);
}
+static inline void* simcall_comm_recv__getraw__dst_buff(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<void*>(simcall->args[2]);
+}
static inline void simcall_comm_recv__set__dst_buff(smx_simcall_t simcall, void* arg) {
simgrid::simix::marshal<void*>(simcall->args[2], arg);
}
static inline size_t* simcall_comm_recv__get__dst_buff_size(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<size_t*>(simcall->args[3]);
}
+static inline size_t* simcall_comm_recv__getraw__dst_buff_size(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<size_t*>(simcall->args[3]);
+}
static inline void simcall_comm_recv__set__dst_buff_size(smx_simcall_t simcall, size_t* arg) {
simgrid::simix::marshal<size_t*>(simcall->args[3], arg);
}
static inline simix_match_func_t simcall_comm_recv__get__match_fun(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[4]);
}
+static inline simix_match_func_t simcall_comm_recv__getraw__match_fun(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<simix_match_func_t>(simcall->args[4]);
+}
static inline void simcall_comm_recv__set__match_fun(smx_simcall_t simcall, simix_match_func_t arg) {
simgrid::simix::marshal<simix_match_func_t>(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<simix_copy_data_func_t>(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<simix_copy_data_func_t>(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<simix_copy_data_func_t>(simcall->args[5], arg);
}
static inline void* simcall_comm_recv__get__data(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<void*>(simcall->args[6]);
}
+static inline void* simcall_comm_recv__getraw__data(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<void*>(simcall->args[6]);
+}
static inline void simcall_comm_recv__set__data(smx_simcall_t simcall, void* arg) {
simgrid::simix::marshal<void*>(simcall->args[6], arg);
}
static inline double simcall_comm_recv__get__timeout(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<double>(simcall->args[7]);
}
+static inline double simcall_comm_recv__getraw__timeout(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<double>(simcall->args[7]);
+}
static inline void simcall_comm_recv__set__timeout(smx_simcall_t simcall, double arg) {
simgrid::simix::marshal<double>(simcall->args[7], arg);
}
static inline double simcall_comm_recv__get__rate(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<double>(simcall->args[8]);
}
+static inline double simcall_comm_recv__getraw__rate(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<double>(simcall->args[8]);
+}
static inline void simcall_comm_recv__set__rate(smx_simcall_t simcall, double arg) {
simgrid::simix::marshal<double>(simcall->args[8], arg);
}
static inline smx_actor_t simcall_comm_irecv__get__receiver(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
}
+static inline smx_actor_t simcall_comm_irecv__getraw__receiver(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
+}
static inline void simcall_comm_irecv__set__receiver(smx_simcall_t simcall, smx_actor_t arg) {
simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
}
static inline smx_mailbox_t simcall_comm_irecv__get__mbox(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]);
}
+static inline smx_mailbox_t simcall_comm_irecv__getraw__mbox(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_mailbox_t>(simcall->args[1]);
+}
static inline void simcall_comm_irecv__set__mbox(smx_simcall_t simcall, smx_mailbox_t arg) {
simgrid::simix::marshal<smx_mailbox_t>(simcall->args[1], arg);
}
static inline void* simcall_comm_irecv__get__dst_buff(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<void*>(simcall->args[2]);
}
+static inline void* simcall_comm_irecv__getraw__dst_buff(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<void*>(simcall->args[2]);
+}
static inline void simcall_comm_irecv__set__dst_buff(smx_simcall_t simcall, void* arg) {
simgrid::simix::marshal<void*>(simcall->args[2], arg);
}
static inline size_t* simcall_comm_irecv__get__dst_buff_size(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<size_t*>(simcall->args[3]);
}
+static inline size_t* simcall_comm_irecv__getraw__dst_buff_size(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<size_t*>(simcall->args[3]);
+}
static inline void simcall_comm_irecv__set__dst_buff_size(smx_simcall_t simcall, size_t* arg) {
simgrid::simix::marshal<size_t*>(simcall->args[3], arg);
}
static inline simix_match_func_t simcall_comm_irecv__get__match_fun(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[4]);
}
+static inline simix_match_func_t simcall_comm_irecv__getraw__match_fun(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<simix_match_func_t>(simcall->args[4]);
+}
static inline void simcall_comm_irecv__set__match_fun(smx_simcall_t simcall, simix_match_func_t arg) {
simgrid::simix::marshal<simix_match_func_t>(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<simix_copy_data_func_t>(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<simix_copy_data_func_t>(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<simix_copy_data_func_t>(simcall->args[5], arg);
}
static inline void* simcall_comm_irecv__get__data(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<void*>(simcall->args[6]);
}
+static inline void* simcall_comm_irecv__getraw__data(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<void*>(simcall->args[6]);
+}
static inline void simcall_comm_irecv__set__data(smx_simcall_t simcall, void* arg) {
simgrid::simix::marshal<void*>(simcall->args[6], arg);
}
static inline double simcall_comm_irecv__get__rate(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<double>(simcall->args[7]);
}
+static inline double simcall_comm_irecv__getraw__rate(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<double>(simcall->args[7]);
+}
static inline void simcall_comm_irecv__set__rate(smx_simcall_t simcall, double arg) {
simgrid::simix::marshal<double>(simcall->args[7], arg);
}
-static inline smx_activity_t simcall_comm_irecv__get__result(smx_simcall_t simcall){
- return simgrid::simix::unmarshal<smx_activity_t>(simcall->result);
+static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
+simcall_comm_irecv__get__result(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->result);
}
-static inline void simcall_comm_irecv__set__result(smx_simcall_t simcall, smx_activity_t result){
- simgrid::simix::marshal<smx_activity_t>(simcall->result, result);
+static inline simgrid::kernel::activity::ActivityImpl* simcall_comm_irecv__getraw__result(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->result);
+}
+static inline void simcall_comm_irecv__set__result(smx_simcall_t simcall,
+ boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> result)
+{
+ simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->result, result);
}
static inline xbt_dynar_t simcall_comm_waitany__get__comms(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<xbt_dynar_t>(simcall->args[0]);
}
+static inline xbt_dynar_t simcall_comm_waitany__getraw__comms(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<xbt_dynar_t>(simcall->args[0]);
+}
static inline void simcall_comm_waitany__set__comms(smx_simcall_t simcall, xbt_dynar_t arg) {
simgrid::simix::marshal<xbt_dynar_t>(simcall->args[0], arg);
}
static inline double simcall_comm_waitany__get__timeout(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<double>(simcall->args[1]);
}
+static inline double simcall_comm_waitany__getraw__timeout(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<double>(simcall->args[1]);
+}
static inline void simcall_comm_waitany__set__timeout(smx_simcall_t simcall, double arg) {
simgrid::simix::marshal<double>(simcall->args[1], arg);
}
static inline int simcall_comm_waitany__get__result(smx_simcall_t simcall){
return simgrid::simix::unmarshal<int>(simcall->result);
}
+static inline int simcall_comm_waitany__getraw__result(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<int>(simcall->result);
+}
static inline void simcall_comm_waitany__set__result(smx_simcall_t simcall, int result){
simgrid::simix::marshal<int>(simcall->result, result);
}
-static inline smx_activity_t simcall_comm_wait__get__comm(smx_simcall_t simcall) {
- return simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]);
+static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
+simcall_comm_wait__get__comm(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]);
+}
+static inline simgrid::kernel::activity::ActivityImpl* simcall_comm_wait__getraw__comm(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->args[0]);
}
-static inline void simcall_comm_wait__set__comm(smx_simcall_t simcall, smx_activity_t arg) {
- simgrid::simix::marshal<smx_activity_t>(simcall->args[0], arg);
+static inline void simcall_comm_wait__set__comm(smx_simcall_t simcall,
+ boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> arg)
+{
+ simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0], arg);
}
static inline double simcall_comm_wait__get__timeout(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<double>(simcall->args[1]);
}
+static inline double simcall_comm_wait__getraw__timeout(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<double>(simcall->args[1]);
+}
static inline void simcall_comm_wait__set__timeout(smx_simcall_t simcall, double arg) {
simgrid::simix::marshal<double>(simcall->args[1], arg);
}
-static inline smx_activity_t simcall_comm_test__get__comm(smx_simcall_t simcall) {
- return simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]);
+static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
+simcall_comm_test__get__comm(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]);
+}
+static inline simgrid::kernel::activity::ActivityImpl* simcall_comm_test__getraw__comm(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->args[0]);
}
-static inline void simcall_comm_test__set__comm(smx_simcall_t simcall, smx_activity_t arg) {
- simgrid::simix::marshal<smx_activity_t>(simcall->args[0], arg);
+static inline void simcall_comm_test__set__comm(smx_simcall_t simcall,
+ boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> arg)
+{
+ simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0], arg);
}
static inline int simcall_comm_test__get__result(smx_simcall_t simcall){
return simgrid::simix::unmarshal<int>(simcall->result);
}
+static inline int simcall_comm_test__getraw__result(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<int>(simcall->result);
+}
static inline void simcall_comm_test__set__result(smx_simcall_t simcall, int result){
simgrid::simix::marshal<int>(simcall->result, result);
}
-static inline smx_activity_t* simcall_comm_testany__get__comms(smx_simcall_t simcall) {
- return simgrid::simix::unmarshal<smx_activity_t*>(simcall->args[0]);
+static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>*
+simcall_comm_testany__get__comms(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>*>(simcall->args[0]);
+}
+static inline simgrid::kernel::activity::ActivityImpl** simcall_comm_testany__getraw__comms(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl**>(simcall->args[0]);
}
-static inline void simcall_comm_testany__set__comms(smx_simcall_t simcall, smx_activity_t* arg) {
- simgrid::simix::marshal<smx_activity_t*>(simcall->args[0], arg);
+static inline void simcall_comm_testany__set__comms(smx_simcall_t simcall,
+ boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>* arg)
+{
+ simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>*>(simcall->args[0], arg);
}
static inline size_t simcall_comm_testany__get__count(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<size_t>(simcall->args[1]);
}
+static inline size_t simcall_comm_testany__getraw__count(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<size_t>(simcall->args[1]);
+}
static inline void simcall_comm_testany__set__count(smx_simcall_t simcall, size_t arg) {
simgrid::simix::marshal<size_t>(simcall->args[1], arg);
}
static inline int simcall_comm_testany__get__result(smx_simcall_t simcall){
return simgrid::simix::unmarshal<int>(simcall->result);
}
+static inline int simcall_comm_testany__getraw__result(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<int>(simcall->result);
+}
static inline void simcall_comm_testany__set__result(smx_simcall_t simcall, int result){
simgrid::simix::marshal<int>(simcall->result, result);
}
static inline smx_mutex_t simcall_mutex_init__get__result(smx_simcall_t simcall){
return simgrid::simix::unmarshal<smx_mutex_t>(simcall->result);
}
+static inline smx_mutex_t simcall_mutex_init__getraw__result(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_mutex_t>(simcall->result);
+}
static inline void simcall_mutex_init__set__result(smx_simcall_t simcall, smx_mutex_t result){
simgrid::simix::marshal<smx_mutex_t>(simcall->result, result);
}
static inline smx_mutex_t simcall_mutex_lock__get__mutex(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[0]);
}
+static inline smx_mutex_t simcall_mutex_lock__getraw__mutex(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_mutex_t>(simcall->args[0]);
+}
static inline void simcall_mutex_lock__set__mutex(smx_simcall_t simcall, smx_mutex_t arg) {
simgrid::simix::marshal<smx_mutex_t>(simcall->args[0], arg);
}
static inline smx_mutex_t simcall_mutex_trylock__get__mutex(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[0]);
}
+static inline smx_mutex_t simcall_mutex_trylock__getraw__mutex(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_mutex_t>(simcall->args[0]);
+}
static inline void simcall_mutex_trylock__set__mutex(smx_simcall_t simcall, smx_mutex_t arg) {
simgrid::simix::marshal<smx_mutex_t>(simcall->args[0], arg);
}
static inline int simcall_mutex_trylock__get__result(smx_simcall_t simcall){
return simgrid::simix::unmarshal<int>(simcall->result);
}
+static inline int simcall_mutex_trylock__getraw__result(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<int>(simcall->result);
+}
static inline void simcall_mutex_trylock__set__result(smx_simcall_t simcall, int result){
simgrid::simix::marshal<int>(simcall->result, result);
}
static inline smx_mutex_t simcall_mutex_unlock__get__mutex(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[0]);
}
+static inline smx_mutex_t simcall_mutex_unlock__getraw__mutex(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_mutex_t>(simcall->args[0]);
+}
static inline void simcall_mutex_unlock__set__mutex(smx_simcall_t simcall, smx_mutex_t arg) {
simgrid::simix::marshal<smx_mutex_t>(simcall->args[0], arg);
}
static inline smx_cond_t simcall_cond_init__get__result(smx_simcall_t simcall){
return simgrid::simix::unmarshal<smx_cond_t>(simcall->result);
}
+static inline smx_cond_t simcall_cond_init__getraw__result(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_cond_t>(simcall->result);
+}
static inline void simcall_cond_init__set__result(smx_simcall_t simcall, smx_cond_t result){
simgrid::simix::marshal<smx_cond_t>(simcall->result, result);
}
static inline smx_cond_t simcall_cond_signal__get__cond(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_cond_t>(simcall->args[0]);
}
+static inline smx_cond_t simcall_cond_signal__getraw__cond(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_cond_t>(simcall->args[0]);
+}
static inline void simcall_cond_signal__set__cond(smx_simcall_t simcall, smx_cond_t arg) {
simgrid::simix::marshal<smx_cond_t>(simcall->args[0], arg);
}
static inline smx_cond_t simcall_cond_wait__get__cond(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_cond_t>(simcall->args[0]);
}
+static inline smx_cond_t simcall_cond_wait__getraw__cond(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_cond_t>(simcall->args[0]);
+}
static inline void simcall_cond_wait__set__cond(smx_simcall_t simcall, smx_cond_t arg) {
simgrid::simix::marshal<smx_cond_t>(simcall->args[0], arg);
}
static inline smx_mutex_t simcall_cond_wait__get__mutex(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[1]);
}
+static inline smx_mutex_t simcall_cond_wait__getraw__mutex(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_mutex_t>(simcall->args[1]);
+}
static inline void simcall_cond_wait__set__mutex(smx_simcall_t simcall, smx_mutex_t arg) {
simgrid::simix::marshal<smx_mutex_t>(simcall->args[1], arg);
}
static inline smx_cond_t simcall_cond_wait_timeout__get__cond(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_cond_t>(simcall->args[0]);
}
+static inline smx_cond_t simcall_cond_wait_timeout__getraw__cond(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_cond_t>(simcall->args[0]);
+}
static inline void simcall_cond_wait_timeout__set__cond(smx_simcall_t simcall, smx_cond_t arg) {
simgrid::simix::marshal<smx_cond_t>(simcall->args[0], arg);
}
static inline smx_mutex_t simcall_cond_wait_timeout__get__mutex(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[1]);
}
+static inline smx_mutex_t simcall_cond_wait_timeout__getraw__mutex(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_mutex_t>(simcall->args[1]);
+}
static inline void simcall_cond_wait_timeout__set__mutex(smx_simcall_t simcall, smx_mutex_t arg) {
simgrid::simix::marshal<smx_mutex_t>(simcall->args[1], arg);
}
static inline double simcall_cond_wait_timeout__get__timeout(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<double>(simcall->args[2]);
}
+static inline double simcall_cond_wait_timeout__getraw__timeout(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<double>(simcall->args[2]);
+}
static inline void simcall_cond_wait_timeout__set__timeout(smx_simcall_t simcall, double arg) {
simgrid::simix::marshal<double>(simcall->args[2], arg);
}
static inline smx_cond_t simcall_cond_broadcast__get__cond(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_cond_t>(simcall->args[0]);
}
+static inline smx_cond_t simcall_cond_broadcast__getraw__cond(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_cond_t>(simcall->args[0]);
+}
static inline void simcall_cond_broadcast__set__cond(smx_simcall_t simcall, smx_cond_t arg) {
simgrid::simix::marshal<smx_cond_t>(simcall->args[0], arg);
}
static inline unsigned int simcall_sem_init__get__capacity(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<unsigned int>(simcall->args[0]);
}
+static inline unsigned int simcall_sem_init__getraw__capacity(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<unsigned int>(simcall->args[0]);
+}
static inline void simcall_sem_init__set__capacity(smx_simcall_t simcall, unsigned int arg) {
simgrid::simix::marshal<unsigned int>(simcall->args[0], arg);
}
static inline smx_sem_t simcall_sem_init__get__result(smx_simcall_t simcall){
return simgrid::simix::unmarshal<smx_sem_t>(simcall->result);
}
+static inline smx_sem_t simcall_sem_init__getraw__result(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_sem_t>(simcall->result);
+}
static inline void simcall_sem_init__set__result(smx_simcall_t simcall, smx_sem_t result){
simgrid::simix::marshal<smx_sem_t>(simcall->result, result);
}
static inline smx_sem_t simcall_sem_release__get__sem(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_sem_t>(simcall->args[0]);
}
+static inline smx_sem_t simcall_sem_release__getraw__sem(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_sem_t>(simcall->args[0]);
+}
static inline void simcall_sem_release__set__sem(smx_simcall_t simcall, smx_sem_t arg) {
simgrid::simix::marshal<smx_sem_t>(simcall->args[0], arg);
}
static inline smx_sem_t simcall_sem_would_block__get__sem(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_sem_t>(simcall->args[0]);
}
+static inline smx_sem_t simcall_sem_would_block__getraw__sem(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_sem_t>(simcall->args[0]);
+}
static inline void simcall_sem_would_block__set__sem(smx_simcall_t simcall, smx_sem_t arg) {
simgrid::simix::marshal<smx_sem_t>(simcall->args[0], arg);
}
static inline int simcall_sem_would_block__get__result(smx_simcall_t simcall){
return simgrid::simix::unmarshal<int>(simcall->result);
}
+static inline int simcall_sem_would_block__getraw__result(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<int>(simcall->result);
+}
static inline void simcall_sem_would_block__set__result(smx_simcall_t simcall, int result){
simgrid::simix::marshal<int>(simcall->result, result);
}
static inline smx_sem_t simcall_sem_acquire__get__sem(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_sem_t>(simcall->args[0]);
}
+static inline smx_sem_t simcall_sem_acquire__getraw__sem(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_sem_t>(simcall->args[0]);
+}
static inline void simcall_sem_acquire__set__sem(smx_simcall_t simcall, smx_sem_t arg) {
simgrid::simix::marshal<smx_sem_t>(simcall->args[0], arg);
}
static inline smx_sem_t simcall_sem_acquire_timeout__get__sem(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_sem_t>(simcall->args[0]);
}
+static inline smx_sem_t simcall_sem_acquire_timeout__getraw__sem(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_sem_t>(simcall->args[0]);
+}
static inline void simcall_sem_acquire_timeout__set__sem(smx_simcall_t simcall, smx_sem_t arg) {
simgrid::simix::marshal<smx_sem_t>(simcall->args[0], arg);
}
static inline double simcall_sem_acquire_timeout__get__timeout(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<double>(simcall->args[1]);
}
+static inline double simcall_sem_acquire_timeout__getraw__timeout(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<double>(simcall->args[1]);
+}
static inline void simcall_sem_acquire_timeout__set__timeout(smx_simcall_t simcall, double arg) {
simgrid::simix::marshal<double>(simcall->args[1], arg);
}
static inline smx_sem_t simcall_sem_get_capacity__get__sem(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_sem_t>(simcall->args[0]);
}
+static inline smx_sem_t simcall_sem_get_capacity__getraw__sem(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_sem_t>(simcall->args[0]);
+}
static inline void simcall_sem_get_capacity__set__sem(smx_simcall_t simcall, smx_sem_t arg) {
simgrid::simix::marshal<smx_sem_t>(simcall->args[0], arg);
}
static inline int simcall_sem_get_capacity__get__result(smx_simcall_t simcall){
return simgrid::simix::unmarshal<int>(simcall->result);
}
+static inline int simcall_sem_get_capacity__getraw__result(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<int>(simcall->result);
+}
static inline void simcall_sem_get_capacity__set__result(smx_simcall_t simcall, int result){
simgrid::simix::marshal<int>(simcall->result, result);
}
static inline smx_file_t simcall_file_read__get__fd(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_file_t>(simcall->args[0]);
}
+static inline smx_file_t simcall_file_read__getraw__fd(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_file_t>(simcall->args[0]);
+}
static inline void simcall_file_read__set__fd(smx_simcall_t simcall, smx_file_t arg) {
simgrid::simix::marshal<smx_file_t>(simcall->args[0], arg);
}
static inline sg_size_t simcall_file_read__get__size(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<sg_size_t>(simcall->args[1]);
}
+static inline sg_size_t simcall_file_read__getraw__size(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<sg_size_t>(simcall->args[1]);
+}
static inline void simcall_file_read__set__size(smx_simcall_t simcall, sg_size_t arg) {
simgrid::simix::marshal<sg_size_t>(simcall->args[1], arg);
}
static inline sg_host_t simcall_file_read__get__host(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<sg_host_t>(simcall->args[2]);
}
+static inline sg_host_t simcall_file_read__getraw__host(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<sg_host_t>(simcall->args[2]);
+}
static inline void simcall_file_read__set__host(smx_simcall_t simcall, sg_host_t arg) {
simgrid::simix::marshal<sg_host_t>(simcall->args[2], arg);
}
static inline sg_size_t simcall_file_read__get__result(smx_simcall_t simcall){
return simgrid::simix::unmarshal<sg_size_t>(simcall->result);
}
+static inline sg_size_t simcall_file_read__getraw__result(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<sg_size_t>(simcall->result);
+}
static inline void simcall_file_read__set__result(smx_simcall_t simcall, sg_size_t result){
simgrid::simix::marshal<sg_size_t>(simcall->result, result);
}
static inline smx_file_t simcall_file_write__get__fd(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_file_t>(simcall->args[0]);
}
+static inline smx_file_t simcall_file_write__getraw__fd(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_file_t>(simcall->args[0]);
+}
static inline void simcall_file_write__set__fd(smx_simcall_t simcall, smx_file_t arg) {
simgrid::simix::marshal<smx_file_t>(simcall->args[0], arg);
}
static inline sg_size_t simcall_file_write__get__size(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<sg_size_t>(simcall->args[1]);
}
+static inline sg_size_t simcall_file_write__getraw__size(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<sg_size_t>(simcall->args[1]);
+}
static inline void simcall_file_write__set__size(smx_simcall_t simcall, sg_size_t arg) {
simgrid::simix::marshal<sg_size_t>(simcall->args[1], arg);
}
static inline sg_host_t simcall_file_write__get__host(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<sg_host_t>(simcall->args[2]);
}
+static inline sg_host_t simcall_file_write__getraw__host(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<sg_host_t>(simcall->args[2]);
+}
static inline void simcall_file_write__set__host(smx_simcall_t simcall, sg_host_t arg) {
simgrid::simix::marshal<sg_host_t>(simcall->args[2], arg);
}
static inline sg_size_t simcall_file_write__get__result(smx_simcall_t simcall){
return simgrid::simix::unmarshal<sg_size_t>(simcall->result);
}
+static inline sg_size_t simcall_file_write__getraw__result(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<sg_size_t>(simcall->result);
+}
static inline void simcall_file_write__set__result(smx_simcall_t simcall, sg_size_t result){
simgrid::simix::marshal<sg_size_t>(simcall->result, result);
}
static inline const char* simcall_file_open__get__fullpath(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<const char*>(simcall->args[0]);
}
+static inline const char* simcall_file_open__getraw__fullpath(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<const char*>(simcall->args[0]);
+}
static inline void simcall_file_open__set__fullpath(smx_simcall_t simcall, const char* arg) {
simgrid::simix::marshal<const char*>(simcall->args[0], arg);
}
static inline sg_host_t simcall_file_open__get__host(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<sg_host_t>(simcall->args[1]);
}
+static inline sg_host_t simcall_file_open__getraw__host(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<sg_host_t>(simcall->args[1]);
+}
static inline void simcall_file_open__set__host(smx_simcall_t simcall, sg_host_t arg) {
simgrid::simix::marshal<sg_host_t>(simcall->args[1], arg);
}
static inline smx_file_t simcall_file_open__get__result(smx_simcall_t simcall){
return simgrid::simix::unmarshal<smx_file_t>(simcall->result);
}
+static inline smx_file_t simcall_file_open__getraw__result(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_file_t>(simcall->result);
+}
static inline void simcall_file_open__set__result(smx_simcall_t simcall, smx_file_t result){
simgrid::simix::marshal<smx_file_t>(simcall->result, result);
}
static inline smx_file_t simcall_file_close__get__fd(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_file_t>(simcall->args[0]);
}
+static inline smx_file_t simcall_file_close__getraw__fd(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_file_t>(simcall->args[0]);
+}
static inline void simcall_file_close__set__fd(smx_simcall_t simcall, smx_file_t arg) {
simgrid::simix::marshal<smx_file_t>(simcall->args[0], arg);
}
static inline sg_host_t simcall_file_close__get__host(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<sg_host_t>(simcall->args[1]);
}
+static inline sg_host_t simcall_file_close__getraw__host(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<sg_host_t>(simcall->args[1]);
+}
static inline void simcall_file_close__set__host(smx_simcall_t simcall, sg_host_t arg) {
simgrid::simix::marshal<sg_host_t>(simcall->args[1], arg);
}
static inline int simcall_file_close__get__result(smx_simcall_t simcall){
return simgrid::simix::unmarshal<int>(simcall->result);
}
+static inline int simcall_file_close__getraw__result(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<int>(simcall->result);
+}
static inline void simcall_file_close__set__result(smx_simcall_t simcall, int result){
simgrid::simix::marshal<int>(simcall->result, result);
}
static inline smx_file_t simcall_file_unlink__get__fd(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_file_t>(simcall->args[0]);
}
+static inline smx_file_t simcall_file_unlink__getraw__fd(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_file_t>(simcall->args[0]);
+}
static inline void simcall_file_unlink__set__fd(smx_simcall_t simcall, smx_file_t arg) {
simgrid::simix::marshal<smx_file_t>(simcall->args[0], arg);
}
static inline sg_host_t simcall_file_unlink__get__host(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<sg_host_t>(simcall->args[1]);
}
+static inline sg_host_t simcall_file_unlink__getraw__host(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<sg_host_t>(simcall->args[1]);
+}
static inline void simcall_file_unlink__set__host(smx_simcall_t simcall, sg_host_t arg) {
simgrid::simix::marshal<sg_host_t>(simcall->args[1], arg);
}
static inline int simcall_file_unlink__get__result(smx_simcall_t simcall){
return simgrid::simix::unmarshal<int>(simcall->result);
}
+static inline int simcall_file_unlink__getraw__result(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<int>(simcall->result);
+}
static inline void simcall_file_unlink__set__result(smx_simcall_t simcall, int result){
simgrid::simix::marshal<int>(simcall->result, result);
}
static inline smx_file_t simcall_file_get_size__get__fd(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_file_t>(simcall->args[0]);
}
+static inline smx_file_t simcall_file_get_size__getraw__fd(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_file_t>(simcall->args[0]);
+}
static inline void simcall_file_get_size__set__fd(smx_simcall_t simcall, smx_file_t arg) {
simgrid::simix::marshal<smx_file_t>(simcall->args[0], arg);
}
static inline sg_size_t simcall_file_get_size__get__result(smx_simcall_t simcall){
return simgrid::simix::unmarshal<sg_size_t>(simcall->result);
}
+static inline sg_size_t simcall_file_get_size__getraw__result(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<sg_size_t>(simcall->result);
+}
static inline void simcall_file_get_size__set__result(smx_simcall_t simcall, sg_size_t result){
simgrid::simix::marshal<sg_size_t>(simcall->result, result);
}
static inline smx_file_t simcall_file_tell__get__fd(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_file_t>(simcall->args[0]);
}
+static inline smx_file_t simcall_file_tell__getraw__fd(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_file_t>(simcall->args[0]);
+}
static inline void simcall_file_tell__set__fd(smx_simcall_t simcall, smx_file_t arg) {
simgrid::simix::marshal<smx_file_t>(simcall->args[0], arg);
}
static inline sg_size_t simcall_file_tell__get__result(smx_simcall_t simcall){
return simgrid::simix::unmarshal<sg_size_t>(simcall->result);
}
+static inline sg_size_t simcall_file_tell__getraw__result(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<sg_size_t>(simcall->result);
+}
static inline void simcall_file_tell__set__result(smx_simcall_t simcall, sg_size_t result){
simgrid::simix::marshal<sg_size_t>(simcall->result, result);
}
static inline smx_file_t simcall_file_seek__get__fd(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_file_t>(simcall->args[0]);
}
+static inline smx_file_t simcall_file_seek__getraw__fd(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_file_t>(simcall->args[0]);
+}
static inline void simcall_file_seek__set__fd(smx_simcall_t simcall, smx_file_t arg) {
simgrid::simix::marshal<smx_file_t>(simcall->args[0], arg);
}
static inline sg_offset_t simcall_file_seek__get__offset(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<sg_offset_t>(simcall->args[1]);
}
+static inline sg_offset_t simcall_file_seek__getraw__offset(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<sg_offset_t>(simcall->args[1]);
+}
static inline void simcall_file_seek__set__offset(smx_simcall_t simcall, sg_offset_t arg) {
simgrid::simix::marshal<sg_offset_t>(simcall->args[1], arg);
}
static inline int simcall_file_seek__get__origin(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<int>(simcall->args[2]);
}
+static inline int simcall_file_seek__getraw__origin(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<int>(simcall->args[2]);
+}
static inline void simcall_file_seek__set__origin(smx_simcall_t simcall, int arg) {
simgrid::simix::marshal<int>(simcall->args[2], arg);
}
static inline int simcall_file_seek__get__result(smx_simcall_t simcall){
return simgrid::simix::unmarshal<int>(simcall->result);
}
+static inline int simcall_file_seek__getraw__result(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<int>(simcall->result);
+}
static inline void simcall_file_seek__set__result(smx_simcall_t simcall, int result){
simgrid::simix::marshal<int>(simcall->result, result);
}
static inline smx_file_t simcall_file_get_info__get__fd(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_file_t>(simcall->args[0]);
}
+static inline smx_file_t simcall_file_get_info__getraw__fd(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_file_t>(simcall->args[0]);
+}
static inline void simcall_file_get_info__set__fd(smx_simcall_t simcall, smx_file_t arg) {
simgrid::simix::marshal<smx_file_t>(simcall->args[0], arg);
}
static inline xbt_dynar_t simcall_file_get_info__get__result(smx_simcall_t simcall){
return simgrid::simix::unmarshal<xbt_dynar_t>(simcall->result);
}
+static inline xbt_dynar_t simcall_file_get_info__getraw__result(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<xbt_dynar_t>(simcall->result);
+}
static inline void simcall_file_get_info__set__result(smx_simcall_t simcall, xbt_dynar_t result){
simgrid::simix::marshal<xbt_dynar_t>(simcall->result, result);
}
static inline smx_file_t simcall_file_move__get__fd(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_file_t>(simcall->args[0]);
}
+static inline smx_file_t simcall_file_move__getraw__fd(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<smx_file_t>(simcall->args[0]);
+}
static inline void simcall_file_move__set__fd(smx_simcall_t simcall, smx_file_t arg) {
simgrid::simix::marshal<smx_file_t>(simcall->args[0], arg);
}
static inline const char* simcall_file_move__get__fullpath(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<const char*>(simcall->args[1]);
}
+static inline const char* simcall_file_move__getraw__fullpath(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<const char*>(simcall->args[1]);
+}
static inline void simcall_file_move__set__fullpath(smx_simcall_t simcall, const char* arg) {
simgrid::simix::marshal<const char*>(simcall->args[1], arg);
}
static inline int simcall_file_move__get__result(smx_simcall_t simcall){
return simgrid::simix::unmarshal<int>(simcall->result);
}
+static inline int simcall_file_move__getraw__result(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<int>(simcall->result);
+}
static inline void simcall_file_move__set__result(smx_simcall_t simcall, int result){
simgrid::simix::marshal<int>(simcall->result, result);
}
static inline int simcall_mc_random__get__min(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<int>(simcall->args[0]);
}
+static inline int simcall_mc_random__getraw__min(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<int>(simcall->args[0]);
+}
static inline void simcall_mc_random__set__min(smx_simcall_t simcall, int arg) {
simgrid::simix::marshal<int>(simcall->args[0], arg);
}
static inline int simcall_mc_random__get__max(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<int>(simcall->args[1]);
}
+static inline int simcall_mc_random__getraw__max(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<int>(simcall->args[1]);
+}
static inline void simcall_mc_random__set__max(smx_simcall_t simcall, int arg) {
simgrid::simix::marshal<int>(simcall->args[1], arg);
}
static inline int simcall_mc_random__get__result(smx_simcall_t simcall){
return simgrid::simix::unmarshal<int>(simcall->result);
}
+static inline int simcall_mc_random__getraw__result(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<int>(simcall->result);
+}
static inline void simcall_mc_random__set__result(smx_simcall_t simcall, int result){
simgrid::simix::marshal<int>(simcall->result, result);
}
-static inline smx_activity_t simcall_set_category__get__synchro(smx_simcall_t simcall) {
- return simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]);
+static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
+simcall_set_category__get__synchro(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]);
}
-static inline void simcall_set_category__set__synchro(smx_simcall_t simcall, smx_activity_t arg) {
- simgrid::simix::marshal<smx_activity_t>(simcall->args[0], arg);
+static inline simgrid::kernel::activity::ActivityImpl* simcall_set_category__getraw__synchro(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->args[0]);
+}
+static inline void simcall_set_category__set__synchro(smx_simcall_t simcall,
+ boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> arg)
+{
+ simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0], arg);
}
static inline const char* simcall_set_category__get__category(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<const char*>(simcall->args[1]);
}
+static inline const char* simcall_set_category__getraw__category(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<const char*>(simcall->args[1]);
+}
static inline void simcall_set_category__set__category(smx_simcall_t simcall, const char* arg) {
simgrid::simix::marshal<const char*>(simcall->args[1], arg);
}
static inline std::function<void()> const* simcall_run_kernel__get__code(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<std::function<void()> const*>(simcall->args[0]);
}
+static inline std::function<void()> const* simcall_run_kernel__getraw__code(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<std::function<void()> const*>(simcall->args[0]);
+}
static inline void simcall_run_kernel__set__code(smx_simcall_t simcall, std::function<void()> const* arg) {
simgrid::simix::marshal<std::function<void()> const*>(simcall->args[0], arg);
}
static inline std::function<void()> const* simcall_run_blocking__get__code(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<std::function<void()> const*>(simcall->args[0]);
}
+static inline std::function<void()> const* simcall_run_blocking__getraw__code(smx_simcall_t simcall)
+{
+ return simgrid::simix::unmarshal_raw<std::function<void()> const*>(simcall->args[0]);
+}
static inline void simcall_run_blocking__set__code(smx_simcall_t simcall, std::function<void()> const* arg) {
simgrid::simix::marshal<std::function<void()> const*>(simcall->args[0], arg);
}
XBT_PRIVATE void simcall_HANDLER_process_set_host(smx_simcall_t simcall, smx_actor_t process, sg_host_t dest);
XBT_PRIVATE void simcall_HANDLER_process_join(smx_simcall_t simcall, smx_actor_t process, double timeout);
XBT_PRIVATE void simcall_HANDLER_process_sleep(smx_simcall_t simcall, double duration);
-XBT_PRIVATE smx_activity_t simcall_HANDLER_execution_start(smx_simcall_t simcall, const char* name, double flops_amount, double priority, double bound);
-XBT_PRIVATE void simcall_HANDLER_execution_wait(smx_simcall_t simcall, smx_activity_t execution);
+XBT_PRIVATE boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
+simcall_HANDLER_execution_start(smx_simcall_t simcall, const char* name, double flops_amount, double priority,
+ double bound);
+XBT_PRIVATE void
+simcall_HANDLER_execution_wait(smx_simcall_t simcall,
+ boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution);
XBT_PRIVATE smx_actor_t simcall_HANDLER_process_restart(smx_simcall_t simcall, smx_actor_t process);
-XBT_PRIVATE smx_activity_t simcall_HANDLER_comm_iprobe(smx_simcall_t simcall, smx_mailbox_t mbox, int type, int src, int tag, simix_match_func_t match_fun, void* data);
+XBT_PRIVATE boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
+simcall_HANDLER_comm_iprobe(smx_simcall_t simcall, smx_mailbox_t mbox, int type, int src, int tag,
+ simix_match_func_t match_fun, void* data);
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 smx_activity_t 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, int detached);
+XBT_PRIVATE boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
+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,
+ int 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 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, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double rate);
+XBT_PRIVATE boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
+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_waitany(smx_simcall_t simcall, xbt_dynar_t comms, double timeout);
-XBT_PRIVATE void simcall_HANDLER_comm_wait(smx_simcall_t simcall, smx_activity_t comm, double timeout);
-XBT_PRIVATE void simcall_HANDLER_comm_test(smx_simcall_t simcall, smx_activity_t comm);
-XBT_PRIVATE void simcall_HANDLER_comm_testany(smx_simcall_t simcall, smx_activity_t* comms, size_t count);
+XBT_PRIVATE void simcall_HANDLER_comm_wait(smx_simcall_t simcall,
+ boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> comm,
+ double timeout);
+XBT_PRIVATE void simcall_HANDLER_comm_test(smx_simcall_t simcall,
+ boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> comm);
+XBT_PRIVATE void simcall_HANDLER_comm_testany(smx_simcall_t simcall,
+ boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>* comms,
+ size_t count);
XBT_PRIVATE smx_mutex_t simcall_HANDLER_mutex_init(smx_simcall_t simcall);
XBT_PRIVATE void simcall_HANDLER_mutex_lock(smx_simcall_t simcall, smx_mutex_t mutex);
XBT_PRIVATE int simcall_HANDLER_mutex_trylock(smx_simcall_t simcall, smx_mutex_t mutex);
return simcall<int, double>(SIMCALL_PROCESS_SLEEP, duration);
}
-inline static smx_activity_t simcall_BODY_execution_start(const char* name, double flops_amount, double priority, double bound) {
+ inline static boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
+ simcall_BODY_execution_start(const char* name, double flops_amount, double priority, double bound)
+ {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) simcall_HANDLER_execution_start(&SIMIX_process_self()->simcall, name, flops_amount, priority, bound);
- return simcall<smx_activity_t, const char*, double, double, double>(SIMCALL_EXECUTION_START, name, flops_amount, priority, bound);
+ return simcall<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>, const char*, double, double, double>(
+ SIMCALL_EXECUTION_START, name, flops_amount, priority, bound);
}
-inline static smx_activity_t simcall_BODY_execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list, double* flops_amount, double* bytes_amount, double amount, double rate, double timeout) {
+ inline static boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
+ simcall_BODY_execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list, double* flops_amount,
+ double* bytes_amount, double amount, double rate, double timeout)
+ {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) SIMIX_execution_parallel_start(name, host_nb, host_list, flops_amount, bytes_amount, amount, rate, timeout);
- return simcall<smx_activity_t, const char*, int, sg_host_t*, double*, double*, double, double, double>(SIMCALL_EXECUTION_PARALLEL_START, name, host_nb, host_list, flops_amount, bytes_amount, amount, rate, timeout);
+ return simcall<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>, const char*, int, sg_host_t*, double*,
+ double*, double, double, double>(SIMCALL_EXECUTION_PARALLEL_START, name, host_nb, host_list,
+ flops_amount, bytes_amount, amount, rate, timeout);
}
-inline static void simcall_BODY_execution_cancel(smx_activity_t execution) {
+ inline static void
+ simcall_BODY_execution_cancel(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution)
+ {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) SIMIX_execution_cancel(execution);
- return simcall<void, smx_activity_t>(SIMCALL_EXECUTION_CANCEL, execution);
+ return simcall<void, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(SIMCALL_EXECUTION_CANCEL,
+ execution);
}
-inline static void simcall_BODY_execution_set_priority(smx_activity_t execution, double priority) {
+ inline static void
+ simcall_BODY_execution_set_priority(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution,
+ double priority)
+ {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) SIMIX_execution_set_priority(execution, priority);
- return simcall<void, smx_activity_t, double>(SIMCALL_EXECUTION_SET_PRIORITY, execution, priority);
+ return simcall<void, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>, double>(
+ SIMCALL_EXECUTION_SET_PRIORITY, execution, priority);
}
-inline static void simcall_BODY_execution_set_bound(smx_activity_t execution, double bound) {
+ inline static void
+ simcall_BODY_execution_set_bound(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution,
+ double bound)
+ {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) SIMIX_execution_set_bound(execution, bound);
- return simcall<void, smx_activity_t, double>(SIMCALL_EXECUTION_SET_BOUND, execution, bound);
+ return simcall<void, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>, double>(
+ SIMCALL_EXECUTION_SET_BOUND, execution, bound);
}
-inline static int simcall_BODY_execution_wait(smx_activity_t execution) {
+ inline static int simcall_BODY_execution_wait(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution)
+ {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) simcall_HANDLER_execution_wait(&SIMIX_process_self()->simcall, execution);
- return simcall<int, smx_activity_t>(SIMCALL_EXECUTION_WAIT, execution);
+ return simcall<int, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(SIMCALL_EXECUTION_WAIT,
+ execution);
}
inline static void simcall_BODY_process_on_exit(smx_actor_t process, int_f_pvoid_pvoid_t fun, void* data) {
return simcall<smx_actor_t, smx_actor_t>(SIMCALL_PROCESS_RESTART, process);
}
-inline static smx_activity_t simcall_BODY_comm_iprobe(smx_mailbox_t mbox, int type, int src, int tag, simix_match_func_t match_fun, void* data) {
+ inline static boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
+ simcall_BODY_comm_iprobe(smx_mailbox_t mbox, int type, int src, int tag, simix_match_func_t match_fun, void* data)
+ {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) simcall_HANDLER_comm_iprobe(&SIMIX_process_self()->simcall, mbox, type, src, tag, match_fun, data);
- return simcall<smx_activity_t, smx_mailbox_t, int, int, int, simix_match_func_t, void*>(SIMCALL_COMM_IPROBE, mbox, type, src, tag, match_fun, data);
+ return simcall<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>, smx_mailbox_t, int, int, int,
+ simix_match_func_t, void*>(SIMCALL_COMM_IPROBE, mbox, type, src, tag, match_fun, data);
}
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) {
return simcall<void, smx_actor_t, smx_mailbox_t, double, double, void*, size_t, simix_match_func_t, simix_copy_data_func_t, void*, double>(SIMCALL_COMM_SEND, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, copy_data_fun, data, timeout);
}
-inline static smx_activity_t 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, int detached) {
+ inline static boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
+ 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, int detached)
+ {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) 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_activity_t, 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*, int>(SIMCALL_COMM_ISEND, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, clean_fun, copy_data_fun, data, detached);
+ return simcall<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>, 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*, int>(
+ 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) {
return simcall<void, smx_actor_t, smx_mailbox_t, void*, size_t*, simix_match_func_t, simix_copy_data_func_t, void*, double, double>(SIMCALL_COMM_RECV, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, timeout, rate);
}
-inline static smx_activity_t 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<simgrid::kernel::activity::ActivityImpl>
+ 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)
+ {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) 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_activity_t, 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<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>, 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);
}
inline static int simcall_BODY_comm_waitany(xbt_dynar_t comms, double timeout) {
return simcall<int, xbt_dynar_t, double>(SIMCALL_COMM_WAITANY, comms, timeout);
}
-inline static void simcall_BODY_comm_wait(smx_activity_t comm, double timeout) {
+ inline static void simcall_BODY_comm_wait(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> comm,
+ double timeout)
+ {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) simcall_HANDLER_comm_wait(&SIMIX_process_self()->simcall, comm, timeout);
- return simcall<void, smx_activity_t, double>(SIMCALL_COMM_WAIT, comm, timeout);
+ return simcall<void, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>, double>(SIMCALL_COMM_WAIT, comm,
+ timeout);
}
-inline static int simcall_BODY_comm_test(smx_activity_t comm) {
+ inline static int simcall_BODY_comm_test(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> comm)
+ {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) simcall_HANDLER_comm_test(&SIMIX_process_self()->simcall, comm);
- return simcall<int, smx_activity_t>(SIMCALL_COMM_TEST, comm);
+ return simcall<int, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(SIMCALL_COMM_TEST, comm);
}
-inline static int simcall_BODY_comm_testany(smx_activity_t* comms, size_t count) {
+ inline static int simcall_BODY_comm_testany(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>* comms,
+ size_t count)
+ {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) simcall_HANDLER_comm_testany(&SIMIX_process_self()->simcall, comms, count);
- return simcall<int, smx_activity_t*, size_t>(SIMCALL_COMM_TESTANY, comms, count);
+ return simcall<int, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>*, size_t>(SIMCALL_COMM_TESTANY,
+ comms, count);
}
inline static smx_mutex_t simcall_BODY_mutex_init() {
return simcall<int, int, int>(SIMCALL_MC_RANDOM, min, max);
}
-inline static void simcall_BODY_set_category(smx_activity_t synchro, const char* category) {
+ inline static void simcall_BODY_set_category(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> synchro,
+ const char* category)
+ {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) SIMIX_set_category(synchro, category);
- return simcall<void, smx_activity_t, const char*>(SIMCALL_SET_CATEGORY, synchro, category);
+ return simcall<void, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>, const char*>(
+ SIMCALL_SET_CATEGORY, synchro, category);
}
inline static void simcall_BODY_run_kernel(std::function<void()> const* code) {
break;
case SIMCALL_EXECUTION_START:
- simgrid::simix::marshal<smx_activity_t>(simcall->result, simcall_HANDLER_execution_start(simcall, simgrid::simix::unmarshal<const char*>(simcall->args[0]), simgrid::simix::unmarshal<double>(simcall->args[1]), simgrid::simix::unmarshal<double>(simcall->args[2]), simgrid::simix::unmarshal<double>(simcall->args[3])));
- SIMIX_simcall_answer(simcall);
- break;
+ simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(
+ simcall->result,
+ simcall_HANDLER_execution_start(simcall, simgrid::simix::unmarshal<const char*>(simcall->args[0]),
+ simgrid::simix::unmarshal<double>(simcall->args[1]),
+ simgrid::simix::unmarshal<double>(simcall->args[2]),
+ simgrid::simix::unmarshal<double>(simcall->args[3])));
+ SIMIX_simcall_answer(simcall);
+ break;
case SIMCALL_EXECUTION_PARALLEL_START:
- simgrid::simix::marshal<smx_activity_t>(simcall->result, SIMIX_execution_parallel_start(simgrid::simix::unmarshal<const char*>(simcall->args[0]), simgrid::simix::unmarshal<int>(simcall->args[1]), simgrid::simix::unmarshal<sg_host_t*>(simcall->args[2]), simgrid::simix::unmarshal<double*>(simcall->args[3]), simgrid::simix::unmarshal<double*>(simcall->args[4]), simgrid::simix::unmarshal<double>(simcall->args[5]), simgrid::simix::unmarshal<double>(simcall->args[6]), simgrid::simix::unmarshal<double>(simcall->args[7])));
- SIMIX_simcall_answer(simcall);
- break;
+ simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(
+ simcall->result,
+ SIMIX_execution_parallel_start(
+ simgrid::simix::unmarshal<const char*>(simcall->args[0]), simgrid::simix::unmarshal<int>(simcall->args[1]),
+ simgrid::simix::unmarshal<sg_host_t*>(simcall->args[2]), simgrid::simix::unmarshal<double*>(simcall->args[3]),
+ simgrid::simix::unmarshal<double*>(simcall->args[4]), simgrid::simix::unmarshal<double>(simcall->args[5]),
+ simgrid::simix::unmarshal<double>(simcall->args[6]), simgrid::simix::unmarshal<double>(simcall->args[7])));
+ SIMIX_simcall_answer(simcall);
+ break;
case SIMCALL_EXECUTION_CANCEL:
- SIMIX_execution_cancel(simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]));
- SIMIX_simcall_answer(simcall);
- break;
+ SIMIX_execution_cancel(
+ simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]));
+ SIMIX_simcall_answer(simcall);
+ break;
case SIMCALL_EXECUTION_SET_PRIORITY:
- SIMIX_execution_set_priority(simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]), simgrid::simix::unmarshal<double>(simcall->args[1]));
- SIMIX_simcall_answer(simcall);
- break;
+ SIMIX_execution_set_priority(
+ simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]),
+ simgrid::simix::unmarshal<double>(simcall->args[1]));
+ SIMIX_simcall_answer(simcall);
+ break;
case SIMCALL_EXECUTION_SET_BOUND:
- SIMIX_execution_set_bound(simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]), simgrid::simix::unmarshal<double>(simcall->args[1]));
- SIMIX_simcall_answer(simcall);
- break;
+ SIMIX_execution_set_bound(
+ simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]),
+ simgrid::simix::unmarshal<double>(simcall->args[1]));
+ SIMIX_simcall_answer(simcall);
+ break;
case SIMCALL_EXECUTION_WAIT:
- simcall_HANDLER_execution_wait(simcall, simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]));
- break;
+ simcall_HANDLER_execution_wait(
+ simcall,
+ simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]));
+ break;
case SIMCALL_PROCESS_ON_EXIT:
SIMIX_process_on_exit(simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<int_f_pvoid_pvoid_t>(simcall->args[1]), simgrid::simix::unmarshal<void*>(simcall->args[2]));
break;
case SIMCALL_COMM_IPROBE:
- simgrid::simix::marshal<smx_activity_t>(simcall->result, simcall_HANDLER_comm_iprobe(simcall, simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[0]), simgrid::simix::unmarshal<int>(simcall->args[1]), simgrid::simix::unmarshal<int>(simcall->args[2]), simgrid::simix::unmarshal<int>(simcall->args[3]), simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[4]), simgrid::simix::unmarshal<void*>(simcall->args[5])));
- SIMIX_simcall_answer(simcall);
- break;
+ simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(
+ simcall->result, simcall_HANDLER_comm_iprobe(simcall, simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[0]),
+ simgrid::simix::unmarshal<int>(simcall->args[1]),
+ simgrid::simix::unmarshal<int>(simcall->args[2]),
+ simgrid::simix::unmarshal<int>(simcall->args[3]),
+ simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[4]),
+ simgrid::simix::unmarshal<void*>(simcall->args[5])));
+ SIMIX_simcall_answer(simcall);
+ break;
case SIMCALL_COMM_SEND:
simcall_HANDLER_comm_send(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]), simgrid::simix::unmarshal<double>(simcall->args[2]), simgrid::simix::unmarshal<double>(simcall->args[3]), simgrid::simix::unmarshal<void*>(simcall->args[4]), simgrid::simix::unmarshal<size_t>(simcall->args[5]), simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[6]), simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[7]), simgrid::simix::unmarshal<void*>(simcall->args[8]), simgrid::simix::unmarshal<double>(simcall->args[9]));
break;
case SIMCALL_COMM_ISEND:
- simgrid::simix::marshal<smx_activity_t>(simcall->result, simcall_HANDLER_comm_isend(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]), simgrid::simix::unmarshal<double>(simcall->args[2]), simgrid::simix::unmarshal<double>(simcall->args[3]), simgrid::simix::unmarshal<void*>(simcall->args[4]), simgrid::simix::unmarshal<size_t>(simcall->args[5]), simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[6]), simgrid::simix::unmarshal<simix_clean_func_t>(simcall->args[7]), simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[8]), simgrid::simix::unmarshal<void*>(simcall->args[9]), simgrid::simix::unmarshal<int>(simcall->args[10])));
- SIMIX_simcall_answer(simcall);
- break;
+ simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(
+ simcall->result,
+ simcall_HANDLER_comm_isend(
+ simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]),
+ simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]),
+ simgrid::simix::unmarshal<double>(simcall->args[2]), simgrid::simix::unmarshal<double>(simcall->args[3]),
+ simgrid::simix::unmarshal<void*>(simcall->args[4]), simgrid::simix::unmarshal<size_t>(simcall->args[5]),
+ simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[6]),
+ simgrid::simix::unmarshal<simix_clean_func_t>(simcall->args[7]),
+ simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[8]),
+ simgrid::simix::unmarshal<void*>(simcall->args[9]), simgrid::simix::unmarshal<int>(simcall->args[10])));
+ SIMIX_simcall_answer(simcall);
+ break;
case SIMCALL_COMM_RECV:
simcall_HANDLER_comm_recv(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]), simgrid::simix::unmarshal<void*>(simcall->args[2]), simgrid::simix::unmarshal<size_t*>(simcall->args[3]), simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[4]), simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[5]), simgrid::simix::unmarshal<void*>(simcall->args[6]), simgrid::simix::unmarshal<double>(simcall->args[7]), simgrid::simix::unmarshal<double>(simcall->args[8]));
break;
case SIMCALL_COMM_IRECV:
- simgrid::simix::marshal<smx_activity_t>(simcall->result, simcall_HANDLER_comm_irecv(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]), simgrid::simix::unmarshal<void*>(simcall->args[2]), simgrid::simix::unmarshal<size_t*>(simcall->args[3]), simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[4]), simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[5]), simgrid::simix::unmarshal<void*>(simcall->args[6]), simgrid::simix::unmarshal<double>(simcall->args[7])));
- SIMIX_simcall_answer(simcall);
- break;
+ simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(
+ simcall->result, simcall_HANDLER_comm_irecv(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]),
+ simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]),
+ simgrid::simix::unmarshal<void*>(simcall->args[2]),
+ simgrid::simix::unmarshal<size_t*>(simcall->args[3]),
+ simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[4]),
+ simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[5]),
+ simgrid::simix::unmarshal<void*>(simcall->args[6]),
+ simgrid::simix::unmarshal<double>(simcall->args[7])));
+ SIMIX_simcall_answer(simcall);
+ break;
case SIMCALL_COMM_WAITANY:
simcall_HANDLER_comm_waitany(simcall, simgrid::simix::unmarshal<xbt_dynar_t>(simcall->args[0]), simgrid::simix::unmarshal<double>(simcall->args[1]));
break;
case SIMCALL_COMM_WAIT:
- simcall_HANDLER_comm_wait(simcall, simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]), simgrid::simix::unmarshal<double>(simcall->args[1]));
- break;
+ simcall_HANDLER_comm_wait(
+ simcall,
+ simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]),
+ simgrid::simix::unmarshal<double>(simcall->args[1]));
+ break;
case SIMCALL_COMM_TEST:
- simcall_HANDLER_comm_test(simcall, simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]));
- break;
+ simcall_HANDLER_comm_test(
+ simcall,
+ simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]));
+ break;
case SIMCALL_COMM_TESTANY:
- simcall_HANDLER_comm_testany(simcall, simgrid::simix::unmarshal<smx_activity_t*>(simcall->args[0]), simgrid::simix::unmarshal<size_t>(simcall->args[1]));
- break;
+ simcall_HANDLER_comm_testany(
+ simcall,
+ simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>*>(simcall->args[0]),
+ simgrid::simix::unmarshal<size_t>(simcall->args[1]));
+ break;
case SIMCALL_MUTEX_INIT:
simgrid::simix::marshal<smx_mutex_t>(simcall->result, simcall_HANDLER_mutex_init(simcall));
break;
case SIMCALL_SET_CATEGORY:
- SIMIX_set_category(simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]), simgrid::simix::unmarshal<const char*>(simcall->args[1]));
- SIMIX_simcall_answer(simcall);
- break;
+ SIMIX_set_category(
+ simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]),
+ simgrid::simix::unmarshal<const char*>(simcall->args[1]));
+ SIMIX_simcall_answer(simcall);
+ break;
case SIMCALL_RUN_KERNEL:
SIMIX_run_kernel(simgrid::simix::unmarshal<std::function<void()> const*>(simcall->args[0]));
#ifdef __cplusplus
+/* Defines the marshal/unmarshal functions for each type of parameters.
+ *
+ * They will be used in popping_accessors.h to define the functions allowing
+ * to retrieve/set each parameter of each simcall.
+ *
+ * There is a unmarshal_raw() function, which is exactly similar to unmarshal()
+ * for all types but boost::intrusive_ptr(T). For that type, the unmarshal()
+ * function builds a new intrusive_ptr wrapping the pointer (that is stored raw
+ * within the simcall) while the unmarshal_raw retrieves the raw pointer.
+ *
+ * This is used in <simcall>_getraw_<param> functions, that allow the
+ * model-checker, to read the data in the remote memory of the MCed.
+ */
+
namespace simgrid {
namespace simix {
};
template<typename T> struct marshal_t {};
-#define SIMIX_MARSHAL(T, field) \
- inline void marshal(type<T>, u_smx_scalar& simcall, T value) \
- { \
- simcall.field = value; \
- } \
- inline T unmarshal(type<T>, u_smx_scalar const& simcall) \
- { \
- return simcall.field; \
- }
+#define SIMIX_MARSHAL(T, field) \
+ inline void marshal(type<T>, u_smx_scalar& simcall, T value) { simcall.field = value; } \
+ inline T unmarshal(type<T>, u_smx_scalar const& simcall) { return simcall.field; } \
+ inline T unmarshal_raw(type<T>, u_smx_scalar const& simcall) \
+ { /* Exactly same as unmarshal. It differs only for intrusive_ptr */ return simcall.field; }
SIMIX_MARSHAL(char, c);
SIMIX_MARSHAL(short, s);
SIMIX_MARSHAL(double, d);
SIMIX_MARSHAL(FPtr, fp);
-inline
-void unmarshal(type<void>, u_smx_scalar const& simcall) {}
+inline void unmarshal(type<void>, u_smx_scalar const& simcall)
+{
+}
+inline void unmarshal_raw(type<void>, u_smx_scalar const& simcall)
+{
+}
template<class T> inline
void marshal(type<T*>, u_smx_scalar& simcall, T* value)
{
return static_cast<T*>(simcall.dp);
}
+template <class T> inline T* unmarshal_raw(type<T*>, u_smx_scalar const& simcall)
+{
+ return static_cast<T*>(simcall.dp);
+}
template <class T>
inline void marshal(type<boost::intrusive_ptr<T>>, u_smx_scalar& simcall, boost::intrusive_ptr<T> value)
{
- intrusive_ptr_add_ref(&*value);
- simcall.dp = static_cast<void*>(&*value);
+ if (value.get() == nullptr) { // Sometimes we return nullptr in an intrusive_ptr...
+ simcall.dp = nullptr;
+ } else {
+ intrusive_ptr_add_ref(&*value);
+ simcall.dp = static_cast<void*>(&*value);
+ }
}
template <class T> inline boost::intrusive_ptr<T> unmarshal(type<boost::intrusive_ptr<T>>, u_smx_scalar const& simcall)
{
+ // refcount was already increased during the marshaling, thus the "false" as last argument
boost::intrusive_ptr<T> res = boost::intrusive_ptr<T>(static_cast<T*>(simcall.dp), false);
- intrusive_ptr_release(&*res);
return res;
}
+template <class T> inline T* unmarshal_raw(type<boost::intrusive_ptr<T>>, u_smx_scalar const& simcall)
+{
+ return static_cast<T*>(simcall.dp);
+}
template<class R, class... T> inline
void marshal(type<R(*)(T...)>, u_smx_scalar& simcall, R(*value)(T...))
{
return (R(*)(T...)) simcall.fp;
}
+template <class R, class... T> inline auto unmarshal_raw(type<R (*)(T...)>, u_smx_scalar simcall) -> R (*)(T...)
+{
+ return (R(*)(T...))simcall.fp;
+}
template<class T> inline
void marshal(u_smx_scalar& simcall, T const& value)
{
return unmarshal(type<T>(), simcall);
}
+template <class T> inline typename std::remove_reference<T>::type unmarshal_raw(u_smx_scalar& simcall)
+{
+ return unmarshal(type<T>(), simcall);
+}
template<std::size_t I>
inline void marshalArgs(smx_simcall_t simcall) {}
int process_join(smx_actor_t process, double timeout) [[block]];
int process_sleep(double duration) [[block]];
-smx_activity_t execution_start(const char* name, double flops_amount, double priority, double bound);
-smx_activity_t execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list, double* flops_amount, double* bytes_amount, double amount, double rate, double timeout) [[nohandler]];
-void execution_cancel(smx_activity_t execution) [[nohandler]];
-void execution_set_priority(smx_activity_t execution, double priority) [[nohandler]];
-void execution_set_bound(smx_activity_t execution, double bound) [[nohandler]];
-int execution_wait(smx_activity_t execution) [[block]];
+boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution_start(const char* name, double flops_amount, double priority, double bound);
+boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list, double* flops_amount, double* bytes_amount, double amount, double rate, double timeout) [[nohandler]];
+void execution_cancel(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution) [[nohandler]];
+void execution_set_priority(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution, double priority) [[nohandler]];
+void execution_set_bound(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution, double bound) [[nohandler]];
+int execution_wait(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution) [[block]];
void process_on_exit(smx_actor_t process, int_f_pvoid_pvoid_t fun, void* data) [[nohandler]];
void process_auto_restart_set(smx_actor_t process, int auto_restart) [[nohandler]];
smx_actor_t process_restart(smx_actor_t process);
-smx_activity_t comm_iprobe(smx_mailbox_t mbox, int type, int src, int tag, simix_match_func_t match_fun, void* data);
+boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> comm_iprobe(smx_mailbox_t mbox, int type, int src, int tag, simix_match_func_t match_fun, void* data);
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]];
-smx_activity_t 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, int detached);
+boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> 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, int 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]];
-smx_activity_t 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);
+boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> 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);
int comm_waitany(xbt_dynar_t comms, double timeout) [[block]];
-void comm_wait(smx_activity_t comm, double timeout) [[block]];
-int comm_test(smx_activity_t comm) [[block]];
-int comm_testany(smx_activity_t* comms, size_t count) [[block]];
+void comm_wait(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> comm, double timeout) [[block]];
+int comm_test(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> comm) [[block]];
+int comm_testany(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>* comms, size_t count) [[block]];
smx_mutex_t mutex_init();
void mutex_lock(smx_mutex_t mutex) [[block]];
int file_move(smx_file_t fd, const char* fullpath);
int mc_random(int min, int max);
-void set_category(smx_activity_t synchro, const char* category) [[nohandler]];
+void set_category(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> synchro, const char* category) [[nohandler]];
void run_kernel(std::function<void()> const* code) [[nohandler]];
void run_blocking(std::function<void()> const* code) [[block,nohandler]];
def accessors(self):
res = []
res.append('')
+ regex = re.compile(r"^boost::intrusive_ptr<(.*?)>(.*)$") #Â to compute the raw type
# Arguments getter/setters
for i in range(len(self.args)):
arg = self.args[i]
+ rawtype = regex.sub(r'\1*\2', arg.rettype())
res.append('static inline %s simcall_%s__get__%s(smx_simcall_t simcall) {' % (
arg.rettype(), self.name, arg.name))
res.append(
' return simgrid::simix::unmarshal<%s>(simcall->args[%i]);' % (arg.rettype(), i))
res.append('}')
+ res.append('static inline %s simcall_%s__getraw__%s(smx_simcall_t simcall) {' % (
+ rawtype, self.name, arg.name))
+ res.append(
+ ' return simgrid::simix::unmarshal_raw<%s>(simcall->args[%i]);' % (rawtype, i))
+ res.append('}')
res.append('static inline void simcall_%s__set__%s(smx_simcall_t simcall, %s arg) {' % (
self.name, arg.name, arg.rettype()))
res.append(' simgrid::simix::marshal<%s>(simcall->args[%i], arg);' % (arg.rettype(), i))
# Return value getter/setters
if self.res.type != 'void':
+ rawtype = regex.sub(r'\1*\2', self.res.rettype())
res.append(
'static inline %s simcall_%s__get__result(smx_simcall_t simcall){' % (self.res.rettype(), self.name))
res.append(' return simgrid::simix::unmarshal<%s>(simcall->result);' % self.res.rettype())
res.append('}')
+ res.append(
+ 'static inline %s simcall_%s__getraw__result(smx_simcall_t simcall){' % (rawtype, self.name))
+ res.append(' return simgrid::simix::unmarshal_raw<%s>(simcall->result);' % rawtype)
+ res.append('}')
res.append(
'static inline void simcall_%s__set__result(smx_simcall_t simcall, %s result){' % (self.name, self.res.rettype()))
res.append(' simgrid::simix::marshal<%s>(simcall->result, result);' % (self.res.rettype()))
XBT_DEBUG("Handling the processes whose action failed (if any)");
while ((action = surf_model_extract_failed_action_set(model))) {
XBT_DEBUG(" Handling Action %p",action);
- SIMIX_simcall_exit((smx_activity_t) action->getData());
+ SIMIX_simcall_exit(static_cast<simgrid::kernel::activity::ActivityImpl*>(action->getData()));
}
XBT_DEBUG("Handling the processes whose action terminated normally (if any)");
while ((action = surf_model_extract_done_action_set(model))) {
if (action->getData() == nullptr)
XBT_DEBUG("probably vcpu's action %p, skip", action);
else
- SIMIX_simcall_exit((smx_activity_t) action->getData());
+ SIMIX_simcall_exit(static_cast<simgrid::kernel::activity::ActivityImpl*>(action->getData()));
}
}
}
const char* synchro_description = "unknown";
- if (dynamic_cast<simgrid::kernel::activity::ExecImpl*>(process->waiting_synchro) != nullptr)
+ if (boost::dynamic_pointer_cast<simgrid::kernel::activity::ExecImpl>(process->waiting_synchro) != nullptr)
synchro_description = "execution";
- if (dynamic_cast<simgrid::kernel::activity::CommImpl*>(process->waiting_synchro) != nullptr)
+ if (boost::dynamic_pointer_cast<simgrid::kernel::activity::CommImpl>(process->waiting_synchro) != nullptr)
synchro_description = "communication";
- if (dynamic_cast<simgrid::kernel::activity::SleepImpl*>(process->waiting_synchro) != nullptr)
+ if (boost::dynamic_pointer_cast<simgrid::kernel::activity::SleepImpl>(process->waiting_synchro) != nullptr)
synchro_description = "sleeping";
- if (dynamic_cast<simgrid::kernel::activity::Raw*>(process->waiting_synchro) != nullptr)
+ if (boost::dynamic_pointer_cast<simgrid::kernel::activity::RawImpl>(process->waiting_synchro) != nullptr)
synchro_description = "synchronization";
- if (dynamic_cast<simgrid::kernel::activity::Io*>(process->waiting_synchro) != nullptr)
+ if (boost::dynamic_pointer_cast<simgrid::kernel::activity::IoImpl>(process->waiting_synchro) != nullptr)
synchro_description = "I/O";
double bound){
/* alloc structures and initialize */
- simgrid::kernel::activity::ExecImpl* exec = new simgrid::kernel::activity::ExecImpl(name, issuer->host);
+ simgrid::kernel::activity::ExecImplPtr exec =
+ simgrid::kernel::activity::ExecImplPtr(new simgrid::kernel::activity::ExecImpl(name, issuer->host));
/* set surf's action */
if (not MC_is_active() && not MC_record_replay_is_active()) {
exec->surf_exec = issuer->host->pimpl_cpu->execution_start(flops_amount);
- exec->surf_exec->setData(exec);
+ exec->surf_exec->setData(exec.get());
exec->surf_exec->setPriority(priority);
if (bound > 0)
{
/* alloc structures and initialize */
- simgrid::kernel::activity::ExecImpl* exec = new simgrid::kernel::activity::ExecImpl(name, nullptr);
+ simgrid::kernel::activity::ExecImplPtr exec =
+ simgrid::kernel::activity::ExecImplPtr(new simgrid::kernel::activity::ExecImpl(name, nullptr));
/* set surf's synchro */
sg_host_t *host_list_cpy = xbt_new0(sg_host_t, host_nb);
/* set surf's synchro */
if (not MC_is_active() && not MC_record_replay_is_active()) {
exec->surf_exec = surf_host_model->executeParallelTask(host_nb, host_list_cpy, flops_amount, bytes_amount, rate);
- exec->surf_exec->setData(exec);
+ exec->surf_exec->setData(exec.get());
if (timeout > 0) {
exec->timeoutDetector = host_list[0]->pimpl_cpu->sleep(timeout);
- exec->timeoutDetector->setData(exec);
+ exec->timeoutDetector->setData(exec.get());
}
}
XBT_DEBUG("Create parallel execute synchro %p", exec);
void SIMIX_execution_cancel(smx_activity_t synchro)
{
XBT_DEBUG("Cancel synchro %p", synchro);
- simgrid::kernel::activity::ExecImpl* exec = static_cast<simgrid::kernel::activity::ExecImpl*>(synchro);
+ simgrid::kernel::activity::ExecImplPtr exec =
+ boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(synchro);
if (exec->surf_exec)
exec->surf_exec->cancel();
void SIMIX_execution_set_priority(smx_activity_t synchro, double priority)
{
- simgrid::kernel::activity::ExecImpl* exec = static_cast<simgrid::kernel::activity::ExecImpl*>(synchro);
+ simgrid::kernel::activity::ExecImplPtr exec =
+ boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(synchro);
if(exec->surf_exec)
exec->surf_exec->setPriority(priority);
}
void SIMIX_execution_set_bound(smx_activity_t synchro, double bound)
{
- simgrid::kernel::activity::ExecImpl* exec = static_cast<simgrid::kernel::activity::ExecImpl*>(synchro);
+ simgrid::kernel::activity::ExecImplPtr exec =
+ boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(synchro);
if(exec->surf_exec)
static_cast<simgrid::surf::CpuAction*>(exec->surf_exec)->setBound(bound);
}
void simcall_HANDLER_execution_wait(smx_simcall_t simcall, smx_activity_t synchro)
{
- simgrid::kernel::activity::ExecImpl* exec = static_cast<simgrid::kernel::activity::ExecImpl*>(synchro);
+ simgrid::kernel::activity::ExecImplPtr exec =
+ boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(synchro);
XBT_DEBUG("Wait for execution of synchro %p, state %d", synchro, (int)synchro->state);
/* Associate this simcall to the synchro */
SIMIX_execution_finish(exec);
}
-void SIMIX_execution_finish(simgrid::kernel::activity::ExecImpl* exec)
+void SIMIX_execution_finish(simgrid::kernel::activity::ExecImplPtr exec)
{
for (smx_simcall_t simcall : exec->simcalls) {
switch (exec->state) {
simcall_execution_wait__set__result(simcall, exec->state);
SIMIX_simcall_answer(simcall);
}
-
- /* We no longer need it */
- exec->unref();
}
void SIMIX_set_category(smx_activity_t synchro, const char *category)
if (synchro->state != SIMIX_RUNNING)
return;
- simgrid::kernel::activity::ExecImpl* exec = dynamic_cast<simgrid::kernel::activity::ExecImpl*>(synchro);
+ simgrid::kernel::activity::ExecImplPtr exec =
+ boost::dynamic_pointer_cast<simgrid::kernel::activity::ExecImpl>(synchro);
if (exec != nullptr) {
exec->surf_exec->setCategory(category);
return;
}
- simgrid::kernel::activity::CommImpl* comm = dynamic_cast<simgrid::kernel::activity::CommImpl*>(synchro);
+ simgrid::kernel::activity::CommImplPtr comm =
+ boost::dynamic_pointer_cast<simgrid::kernel::activity::CommImpl>(synchro);
if (comm != nullptr) {
comm->surf_comm->setCategory(category);
}
XBT_PRIVATE void SIMIX_execution_set_priority(smx_activity_t synchro, double priority);
XBT_PRIVATE void SIMIX_execution_set_bound(smx_activity_t synchro, double bound);
-XBT_PRIVATE void SIMIX_execution_finish(simgrid::kernel::activity::ExecImpl* exec);
+XBT_PRIVATE void SIMIX_execution_finish(simgrid::kernel::activity::ExecImplPtr exec);
XBT_PRIVATE void SIMIX_set_category(smx_activity_t synchro, const char *category);
if (host->isOff())
THROWF(host_error, 0, "Host %s failed, you cannot call this function", host->cname());
- simgrid::kernel::activity::Io *synchro = new simgrid::kernel::activity::Io();
+ simgrid::kernel::activity::IoImpl* synchro = new simgrid::kernel::activity::IoImpl();
synchro->host = host;
synchro->surf_io = surf_host_read(host, fd->surf_file, size);
if (host->isOff())
THROWF(host_error, 0, "Host %s failed, you cannot call this function", host->cname());
- simgrid::kernel::activity::Io *synchro = new simgrid::kernel::activity::Io();
+ simgrid::kernel::activity::IoImpl* synchro = new simgrid::kernel::activity::IoImpl();
synchro->host = host;
synchro->surf_io = surf_host_write(host, fd->surf_file, size);
synchro->surf_io->setData(synchro);
if (host->isOff())
THROWF(host_error, 0, "Host %s failed, you cannot call this function", host->cname());
- simgrid::kernel::activity::Io *synchro = new simgrid::kernel::activity::Io();
+ simgrid::kernel::activity::IoImpl* synchro = new simgrid::kernel::activity::IoImpl();
synchro->host = host;
synchro->surf_io = surf_host_open(host, fullpath);
synchro->surf_io->setData(synchro);
if (host->isOff())
THROWF(host_error, 0, "Host %s failed, you cannot call this function", host->cname());
- simgrid::kernel::activity::Io *synchro = new simgrid::kernel::activity::Io();
+ simgrid::kernel::activity::IoImpl* synchro = new simgrid::kernel::activity::IoImpl();
synchro->host = host;
synchro->surf_io = surf_host_close(host, fd->surf_file);
synchro->surf_io->setData(synchro);
void SIMIX_io_destroy(smx_activity_t synchro)
{
- simgrid::kernel::activity::Io *io = static_cast<simgrid::kernel::activity::Io*>(synchro);
+ simgrid::kernel::activity::IoImplPtr io = boost::static_pointer_cast<simgrid::kernel::activity::IoImpl>(synchro);
XBT_DEBUG("Destroy synchro %p", synchro);
if (io->surf_io)
io->surf_io->unref();
- delete io;
}
void SIMIX_io_finish(smx_activity_t synchro)
static void SIMIX_waitany_remove_simcall_from_actions(smx_simcall_t simcall);
static void SIMIX_comm_copy_data(smx_activity_t comm);
-static void SIMIX_comm_start(smx_activity_t synchro);
-static simgrid::kernel::activity::CommImpl*
-_find_matching_comm(boost::circular_buffer_space_optimized<smx_activity_t>* deque, e_smx_comm_type_t type,
- int (*match_fun)(void*, void*, smx_activity_t), void* user_data, smx_activity_t my_synchro,
- bool remove_matching);
+static void SIMIX_comm_start(simgrid::kernel::activity::CommImplPtr synchro);
/**
* \brief Checks if there is a communication activity queued in a deque matching our needs
* \param type The type of communication we are looking for (comm_send, comm_recv)
* \return The communication activity if found, nullptr otherwise
*/
-static simgrid::kernel::activity::CommImpl*
+static simgrid::kernel::activity::CommImplPtr
_find_matching_comm(boost::circular_buffer_space_optimized<smx_activity_t>* deque, e_smx_comm_type_t type,
int (*match_fun)(void*, void*, smx_activity_t), void* this_user_data, smx_activity_t my_synchro,
bool remove_matching)
for(auto it = deque->begin(); it != deque->end(); it++){
smx_activity_t synchro = *it;
- simgrid::kernel::activity::CommImpl* comm = static_cast<simgrid::kernel::activity::CommImpl*>(synchro);
+ simgrid::kernel::activity::CommImplPtr comm =
+ boost::dynamic_pointer_cast<simgrid::kernel::activity::CommImpl>(std::move(synchro));
if (comm->type == SIMIX_COMM_SEND) {
other_user_data = comm->src_data;
} else if (comm->type == SIMIX_COMM_RECEIVE) {
other_user_data = comm->dst_data;
}
- if (comm->type == type && (match_fun == nullptr || match_fun(this_user_data, other_user_data, synchro)) &&
+ if (comm->type == type && (match_fun == nullptr || match_fun(this_user_data, other_user_data, comm)) &&
(not comm->match_fun || comm->match_fun(other_user_data, this_user_data, my_synchro))) {
- XBT_DEBUG("Found a matching communication synchro %p", comm);
+ XBT_DEBUG("Found a matching communication synchro %p", comm.get());
if (remove_matching)
deque->erase(it);
- comm->ref();
#if SIMGRID_HAVE_MC
comm->mbox_cpy = comm->mbox;
#endif
void (*copy_data_fun)(smx_activity_t, void*, size_t),// used to copy data if not default one
void *data, int detached)
{
- XBT_DEBUG("send from %p", mbox);
+ XBT_DEBUG("send from mailbox %p", mbox);
/* Prepare a synchro describing us, so that it gets passed to the user-provided filter of other side */
- simgrid::kernel::activity::CommImpl* this_comm = new simgrid::kernel::activity::CommImpl(SIMIX_COMM_SEND);
+ simgrid::kernel::activity::CommImplPtr this_comm =
+ simgrid::kernel::activity::CommImplPtr(new simgrid::kernel::activity::CommImpl(SIMIX_COMM_SEND));
/* Look for communication synchro matching our needs. We also provide a description of
* ourself so that the other side also gets a chance of choosing if it wants to match with us.
*
* If it is not found then push our communication into the rendez-vous point */
- simgrid::kernel::activity::CommImpl* other_comm =
+ simgrid::kernel::activity::CommImplPtr other_comm =
_find_matching_comm(&mbox->comm_queue, SIMIX_COMM_RECEIVE, match_fun, data, this_comm, /*remove_matching*/ true);
if (not other_comm) {
- other_comm = this_comm;
+ other_comm = std::move(this_comm);
- if (mbox->permanent_receiver!=nullptr){
+ if (mbox->permanent_receiver != nullptr) {
//this mailbox is for small messages, which have to be sent right now
other_comm->state = SIMIX_READY;
other_comm->dst_proc=mbox->permanent_receiver.get();
- other_comm->ref();
mbox->done_comm_queue.push_back(other_comm);
XBT_DEBUG("pushing a message into the permanent receive list %p, comm %p", mbox, other_comm);
}else{
- mbox->push(this_comm);
+ mbox->push(other_comm);
}
} else {
XBT_DEBUG("Receive already pushed");
- this_comm->unref();
- this_comm->unref();
other_comm->state = SIMIX_READY;
other_comm->type = SIMIX_COMM_READY;
void (*copy_data_fun)(smx_activity_t, void*, size_t), // used to copy data if not default one
void *data, double rate)
{
- simgrid::kernel::activity::CommImpl* this_synchro = new simgrid::kernel::activity::CommImpl(SIMIX_COMM_RECEIVE);
- XBT_DEBUG("recv from %p %p. this_synchro=%p", mbox, &mbox->comm_queue, this_synchro);
+ simgrid::kernel::activity::CommImplPtr this_synchro =
+ simgrid::kernel::activity::CommImplPtr(new simgrid::kernel::activity::CommImpl(SIMIX_COMM_RECEIVE));
+ XBT_DEBUG("recv from mbox %p. this_synchro=%p", mbox, this_synchro.get());
- simgrid::kernel::activity::CommImpl* other_comm;
+ simgrid::kernel::activity::CommImplPtr other_comm;
//communication already done, get it inside the list of completed comms
if (mbox->permanent_receiver != nullptr && not mbox->done_comm_queue.empty()) {
- this_synchro->unref();
XBT_DEBUG("We have a comm that has probably already been received, trying to match it, to skip the communication");
//find a match in the list of already received comms
other_comm = _find_matching_comm(&mbox->done_comm_queue, SIMIX_COMM_SEND, match_fun, data, this_synchro,
other_comm->state = SIMIX_DONE;
other_comm->type = SIMIX_COMM_DONE;
other_comm->mbox = nullptr;
- other_comm->unref();
}
- other_comm->unref();
- this_synchro->unref();
}
} else {
/* Prepare a comm describing us, so that it gets passed to the user-provided filter of other side */
other_comm = _find_matching_comm(&mbox->comm_queue, SIMIX_COMM_SEND, match_fun, data, this_synchro,
/*remove_matching*/ true);
- if (not other_comm) {
- XBT_DEBUG("Receive pushed first %zu", mbox->comm_queue.size());
+ if (other_comm == nullptr) {
+ XBT_DEBUG("Receive pushed first (%zu comm enqueued so far)", mbox->comm_queue.size());
other_comm = this_synchro;
mbox->push(this_synchro);
} else {
- XBT_DEBUG("Match my %p with the existing %p", this_synchro, other_comm);
-
- other_comm = static_cast<simgrid::kernel::activity::CommImpl*>(other_comm);
+ XBT_DEBUG("Match my %p with the existing %p", this_synchro.get(), other_comm.get());
other_comm->state = SIMIX_READY;
other_comm->type = SIMIX_COMM_READY;
- this_synchro->unref();
- this_synchro->unref();
}
dst_proc->comms.push_back(other_comm);
}
int tag, int (*match_fun)(void *, void *, smx_activity_t), void *data)
{
XBT_DEBUG("iprobe from %p %p", mbox, &mbox->comm_queue);
- simgrid::kernel::activity::CommImpl* this_comm;
+ simgrid::kernel::activity::CommImplPtr this_comm;
int smx_type;
if(type == 1){
- this_comm = new simgrid::kernel::activity::CommImpl(SIMIX_COMM_SEND);
+ this_comm = simgrid::kernel::activity::CommImplPtr(new simgrid::kernel::activity::CommImpl(SIMIX_COMM_SEND));
smx_type = SIMIX_COMM_RECEIVE;
} else{
- this_comm = new simgrid::kernel::activity::CommImpl(SIMIX_COMM_RECEIVE);
+ this_comm = simgrid::kernel::activity::CommImplPtr(new simgrid::kernel::activity::CommImpl(SIMIX_COMM_RECEIVE));
smx_type = SIMIX_COMM_SEND;
}
smx_activity_t other_synchro=nullptr;
(e_smx_comm_type_t) smx_type, match_fun, data, this_comm,/*remove_matching*/false);
}
- if(other_synchro)
- other_synchro->unref();
-
- this_comm->unref();
return other_synchro;
}
void simcall_HANDLER_comm_wait(smx_simcall_t simcall, smx_activity_t synchro, double timeout)
{
/* Associate this simcall to the wait synchro */
- XBT_DEBUG("simcall_HANDLER_comm_wait, %p", synchro);
+ XBT_DEBUG("simcall_HANDLER_comm_wait, %p", synchro.get());
synchro->simcalls.push_back(simcall);
simcall->issuer->waiting_synchro = synchro;
if (timeout < 0.0)
THROW_IMPOSSIBLE;
- simgrid::kernel::activity::CommImpl* comm = static_cast<simgrid::kernel::activity::CommImpl*>(synchro);
+ simgrid::kernel::activity::CommImplPtr comm =
+ boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(synchro);
if (comm->src_proc == simcall->issuer)
comm->state = SIMIX_SRC_TIMEOUT;
else
SIMIX_comm_finish(synchro);
} else { /* if (timeout >= 0) { we need a surf sleep action even when there is no timeout, otherwise surf won't tell us when the host fails */
surf_action_t sleep = simcall->issuer->host->pimpl_cpu->sleep(timeout);
- sleep->setData(synchro);
+ sleep->setData(&*synchro);
- simgrid::kernel::activity::CommImpl* comm = static_cast<simgrid::kernel::activity::CommImpl*>(synchro);
+ simgrid::kernel::activity::CommImplPtr comm =
+ boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(synchro);
if (simcall->issuer == comm->src_proc)
comm->src_timeout = sleep;
else
void simcall_HANDLER_comm_test(smx_simcall_t simcall, smx_activity_t synchro)
{
- simgrid::kernel::activity::CommImpl* comm = static_cast<simgrid::kernel::activity::CommImpl*>(synchro);
+ simgrid::kernel::activity::CommImplPtr comm =
+ boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(synchro);
if (MC_is_active() || MC_record_replay_is_active()){
simcall_comm_test__set__result(simcall, comm->src_proc && comm->dst_proc);
}
}
-void simcall_HANDLER_comm_testany(
- smx_simcall_t simcall, simgrid::kernel::activity::ActivityImpl* comms[], size_t count)
+void simcall_HANDLER_comm_testany(smx_simcall_t simcall, simgrid::kernel::activity::ActivityImplPtr comms[],
+ size_t count)
{
// The default result is -1 -- this means, "nothing is ready".
// It can be changed below, but only if something matches.
if(idx == -1){
SIMIX_simcall_answer(simcall);
}else{
- simgrid::kernel::activity::ActivityImpl* synchro = comms[idx];
+ simgrid::kernel::activity::ActivityImplPtr synchro = comms[idx];
simcall_comm_testany__set__result(simcall, idx);
synchro->simcalls.push_back(simcall);
synchro->state = SIMIX_DONE;
}
for (std::size_t i = 0; i != count; ++i) {
- simgrid::kernel::activity::ActivityImpl* synchro = comms[i];
+ simgrid::kernel::activity::ActivityImplPtr synchro = comms[i];
if (synchro->state != SIMIX_WAITING && synchro->state != SIMIX_RUNNING) {
simcall_comm_testany__set__result(simcall, i);
synchro->simcalls.push_back(simcall);
void simcall_HANDLER_comm_waitany(smx_simcall_t simcall, xbt_dynar_t synchros, double timeout)
{
- smx_activity_t synchro;
- unsigned int cursor = 0;
-
if (MC_is_active() || MC_record_replay_is_active()){
if (timeout > 0.0)
xbt_die("Timeout not implemented for waitany in the model-checker");
int idx = SIMCALL_GET_MC_VALUE(simcall);
- synchro = xbt_dynar_get_as(synchros, idx, smx_activity_t);
+ smx_activity_t synchro = xbt_dynar_get_as(synchros, idx, smx_activity_t);
synchro->simcalls.push_back(simcall);
simcall_comm_waitany__set__result(simcall, idx);
synchro->state = SIMIX_DONE;
});
}
- xbt_dynar_foreach(synchros, cursor, synchro){
+ unsigned int cursor;
+ simgrid::kernel::activity::ActivityImpl* ptr;
+ xbt_dynar_foreach(synchros, cursor, ptr){
+ smx_activity_t synchro = simgrid::kernel::activity::ActivityImplPtr(ptr);
/* associate this simcall to the the synchro */
synchro->simcalls.push_back(simcall);
void SIMIX_waitany_remove_simcall_from_actions(smx_simcall_t simcall)
{
- smx_activity_t synchro;
unsigned int cursor = 0;
xbt_dynar_t synchros = simcall_comm_waitany__get__comms(simcall);
- xbt_dynar_foreach(synchros, cursor, synchro) {
+ simgrid::kernel::activity::ActivityImpl* ptr;
+ xbt_dynar_foreach(synchros, cursor, ptr){
+ smx_activity_t synchro = simgrid::kernel::activity::ActivityImplPtr(ptr);
+
// Remove the first occurence of simcall:
auto i = boost::range::find(synchro->simcalls, simcall);
if (i != synchro->simcalls.end())
* \brief Starts the simulation of a communication synchro.
* \param synchro the communication synchro
*/
-static inline void SIMIX_comm_start(smx_activity_t synchro)
+static inline void SIMIX_comm_start(simgrid::kernel::activity::CommImplPtr comm)
{
- simgrid::kernel::activity::CommImpl* comm = static_cast<simgrid::kernel::activity::CommImpl*>(synchro);
-
/* If both the sender and the receiver are already there, start the communication */
- if (synchro->state == SIMIX_READY) {
+ if (comm->state == SIMIX_READY) {
simgrid::s4u::Host* sender = comm->src_proc->host;
simgrid::s4u::Host* receiver = comm->dst_proc->host;
comm->surf_comm = surf_network_model->communicate(sender, receiver, comm->task_size, comm->rate);
- comm->surf_comm->setData(synchro);
+ comm->surf_comm->setData(comm.get());
comm->state = SIMIX_RUNNING;
- XBT_DEBUG("Starting communication %p from '%s' to '%s' (surf_action: %p)", synchro, sender->cname(),
+ XBT_DEBUG("Starting communication %p from '%s' to '%s' (surf_action: %p)", comm.get(), sender->cname(),
receiver->cname(), comm->surf_comm);
/* If a link is failed, detect it immediately */
*/
void SIMIX_comm_finish(smx_activity_t synchro)
{
- simgrid::kernel::activity::CommImpl* comm = static_cast<simgrid::kernel::activity::CommImpl*>(synchro);
+ simgrid::kernel::activity::CommImplPtr comm =
+ boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(synchro);
while (not synchro->simcalls.empty()) {
smx_simcall_t simcall = synchro->simcalls.front();
switch (comm->state) {
case SIMIX_DONE:
- XBT_DEBUG("Communication %p complete!", synchro);
+ XBT_DEBUG("Communication %p complete!", synchro.get());
SIMIX_comm_copy_data(synchro);
break;
void SIMIX_comm_copy_pointer_callback(smx_activity_t synchro, void* buff, size_t buff_size)
{
- simgrid::kernel::activity::CommImpl* comm = static_cast<simgrid::kernel::activity::CommImpl*>(synchro);
+ simgrid::kernel::activity::CommImplPtr comm =
+ boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(synchro);
xbt_assert((buff_size == sizeof(void *)), "Cannot copy %zu bytes: must be sizeof(void*)", buff_size);
*(void **) (comm->dst_buff) = buff;
void SIMIX_comm_copy_buffer_callback(smx_activity_t synchro, void* buff, size_t buff_size)
{
- simgrid::kernel::activity::CommImpl* comm = static_cast<simgrid::kernel::activity::CommImpl*>(synchro);
+ simgrid::kernel::activity::CommImplPtr comm =
+ boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(synchro);
XBT_DEBUG("Copy the data over");
memcpy(comm->dst_buff, buff, buff_size);
*/
void SIMIX_comm_copy_data(smx_activity_t synchro)
{
- simgrid::kernel::activity::CommImpl* comm = static_cast<simgrid::kernel::activity::CommImpl*>(synchro);
+ simgrid::kernel::activity::CommImplPtr comm =
+ boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(synchro);
size_t buff_size = comm->src_buff_size;
/* If there is no data to copy then return */
if (not comm->src_buff || not comm->dst_buff || comm->copied)
return;
- XBT_DEBUG("Copying comm %p data from %s (%p) -> %s (%p) (%zu bytes)", comm,
+ XBT_DEBUG("Copying comm %p data from %s (%p) -> %s (%p) (%zu bytes)", comm.get(),
comm->src_proc ? comm->src_proc->host->cname() : "a finished process", comm->src_buff,
comm->dst_proc ? comm->dst_proc->host->cname() : "a finished process", comm->dst_buff, buff_size);
{
XBT_IN("(%p, %f)",smx_host,timeout);
- simgrid::kernel::activity::Raw *sync = new simgrid::kernel::activity::Raw();
+ simgrid::kernel::activity::RawImplPtr sync =
+ simgrid::kernel::activity::RawImplPtr(new simgrid::kernel::activity::RawImpl());
sync->sleep = smx_host->pimpl_cpu->sleep(timeout);
- sync->sleep->setData(sync);
+ sync->sleep->setData(&*sync);
XBT_OUT();
return sync;
}
SIMIX_synchro_stop_waiting(simcall->issuer, simcall);
simcall->issuer->waiting_synchro = nullptr;
- delete synchro;
SIMIX_simcall_answer(simcall);
XBT_OUT();
}
if (xbt_swag_size(this->sleeping) > 0) {
/*process to wake up */
smx_actor_t p = (smx_actor_t) xbt_swag_extract(this->sleeping);
- delete p->waiting_synchro;
p->waiting_synchro = nullptr;
this->owner = p;
SIMIX_simcall_answer(&p->simcall);
if ((proc = (smx_actor_t) xbt_swag_extract(cond->sleeping))) {
/* Destroy waiter's synchronization */
- delete proc->waiting_synchro;
proc->waiting_synchro = nullptr;
/* Now transform the cond wait simcall into a mutex lock one */
XBT_DEBUG("Sem release semaphore %p", sem);
if ((proc = (smx_actor_t) xbt_swag_extract(sem->sleeping))) {
- delete proc->waiting_synchro;
proc->waiting_synchro = nullptr;
SIMIX_simcall_answer(&proc->simcall);
} else {
void smpi_comm_copy_buffer_callback(smx_activity_t synchro, void *buff, size_t buff_size)
{
- simgrid::kernel::activity::CommImpl* comm = dynamic_cast<simgrid::kernel::activity::CommImpl*>(synchro);
+ simgrid::kernel::activity::CommImplPtr comm =
+ boost::dynamic_pointer_cast<simgrid::kernel::activity::CommImpl>(synchro);
int src_shared = 0;
int dst_shared = 0;
size_t src_offset = 0;
count++;
if (status != MPI_STATUSES_IGNORE)
status[i] = *pstat;
- if ((requests[i] != MPI_REQUEST_NULL) && requests[i]->flags_ & NON_PERSISTENT)
+ if ((requests[i] != MPI_REQUEST_NULL) && (requests[i]->flags_ & NON_PERSISTENT))
requests[i] = MPI_REQUEST_NULL;
}
} else {
int Request::testany(int count, MPI_Request requests[], int *index, MPI_Status * status)
{
- std::vector<simgrid::kernel::activity::ActivityImpl*> comms;
+ std::vector<simgrid::kernel::activity::ActivityImplPtr> comms;
comms.reserve(count);
int i;
}
if (request->action_ != nullptr){
- simgrid::kernel::activity::CommImpl* sync_comm =
- static_cast<simgrid::kernel::activity::CommImpl*>(request->action_);
+ simgrid::kernel::activity::CommImplPtr sync_comm =
+ boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(request->action_);
MPI_Request req = static_cast<MPI_Request>(sync_comm->src_data);
*flag = 1;
if(status != MPI_STATUS_IGNORE && (req->flags_ & PREPARED) == 0) {
int Request::waitany(int count, MPI_Request requests[], MPI_Status * status)
{
s_xbt_dynar_t comms; // Keep it on stack to save some extra mallocs
- int i;
int size = 0;
int index = MPI_UNDEFINED;
- int *map;
if(count > 0) {
// Wait for a request to complete
- xbt_dynar_init(&comms, sizeof(smx_activity_t), nullptr);
- map = xbt_new(int, count);
+ xbt_dynar_init(&comms, sizeof(smx_activity_t), [](void*ptr){
+ intrusive_ptr_release(*(simgrid::kernel::activity::ActivityImpl**)ptr);
+ });
+ int *map = xbt_new(int, count);
XBT_DEBUG("Wait for one of %d", count);
- for(i = 0; i < count; i++) {
+ for(int i = 0; i < count; i++) {
if (requests[i] != MPI_REQUEST_NULL && not(requests[i]->flags_ & PREPARED) &&
not(requests[i]->flags_ & FINISHED)) {
if (requests[i]->action_ != nullptr) {
XBT_DEBUG("Waiting any %p ", requests[i]);
- xbt_dynar_push(&comms, &requests[i]->action_);
+ intrusive_ptr_add_ref(requests[i]->action_.get());
+ xbt_dynar_push_as(&comms, simgrid::kernel::activity::ActivityImpl*, requests[i]->action_.get());
map[size] = i;
size++;
} else {
}
}
}
- if(size > 0) {
- i = simcall_comm_waitany(&comms, -1);
+ if (size > 0) {
+ XBT_DEBUG("Enter waitany for %lu comms", xbt_dynar_length(&comms));
+ int i = simcall_comm_waitany(&comms, -1);
// not MPI_UNDEFINED, as this is a simix return code
if (i != -1) {
std::vector<MPI_Request> accumulates;
int index;
MPI_Status stat;
- MPI_Status *pstat = status == MPI_STATUSES_IGNORE ? MPI_STATUS_IGNORE : &stat;
+ MPI_Status *pstat = (status == MPI_STATUSES_IGNORE ? MPI_STATUS_IGNORE : &stat);
int retvalue = MPI_SUCCESS;
//tag invalid requests in the set
if (status != MPI_STATUSES_IGNORE) {
wait(&requests[c],pstat);
index = c;
} else {
- index = waitany(count, requests, pstat);
+ index = waitany(count, (MPI_Request*)requests, pstat);
if (index == MPI_UNDEFINED)
break;
-/* Copyright (c) 2005-2016. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2005-2017. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
#include <cstddef>
#include <cstdlib>
+#include <cstring>
#include <vector>
}
+static bool startWith(std::string str, const char* prefix)
+{
+ return strncmp(str.c_str(), prefix, strlen(prefix)) == 0;
+}
+
void xbt_backtrace_display(xbt_backtrace_location_t* loc, std::size_t count)
{
#ifdef HAVE_BACKTRACE
return;
}
fprintf(stderr, "Backtrace (displayed in process %s):\n", SIMIX_process_self_get_name());
- for (std::string const& s : backtrace)
- fprintf(stderr, "---> %s\n", s.c_str());
+ for (std::string const& s : backtrace) {
+ if (startWith(s, "xbt_backtrace_display_current"))
+ continue;
+
+ std::fprintf(stderr, "---> '%s'\n", s.c_str());
+ if (startWith(s, "SIMIX_simcall_handle") ||
+ startWith(s, "simgrid::xbt::MainFunction") /* main used with thread factory */)
+ break;
+ }
#else
XBT_ERROR("Cannot display backtrace when compiled without libunwind.");
#endif
-foreach(x actor concurrent_rw host_on_off_wait listen_async pid storage_client_server)
+foreach(x actor comm-pt2pt comm-waitany concurrent_rw host_on_off_wait listen_async pid storage_client_server)
add_executable (${x} ${x}/${x}.cpp)
target_link_libraries(${x} simgrid)
set_target_properties(${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
- set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.tesh)
set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.cpp)
endforeach()
+## Add the tests.
+## Some need to be run with all factories, some need not tesh to run
+foreach(x actor concurrent_rw)
+ set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.tesh)
+ ADD_TESH_FACTORIES(tesh-s4u-${x} "thread;boost;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/s4u/${x} --cd ${CMAKE_BINARY_DIR}/teshsuite/s4u/${x} ${CMAKE_HOME_DIRECTORY}/teshsuite/s4u/${x}/${x}.tesh)
+endforeach()
+
+foreach(x host_on_off_wait listen_async pid storage_client_server)
+ set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.tesh)
+ ADD_TESH(tesh-s4u-${x} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/s4u/${x} --cd ${CMAKE_BINARY_DIR}/teshsuite/s4u/${x} ${CMAKE_HOME_DIRECTORY}/teshsuite/s4u/${x}/${x}.tesh)
+endforeach()
+
+# The output is not relevant
+ADD_TEST(tesh-s4u-comm-pt2pt ${CMAKE_BINARY_DIR}/teshsuite/s4u/comm-pt2pt/comm-pt2pt ${CMAKE_HOME_DIRECTORY}/examples/platforms/cluster.xml)
+ADD_TEST(tesh-s4u-comm-waitany ${CMAKE_BINARY_DIR}/teshsuite/s4u/comm-waitany/comm-waitany ${CMAKE_HOME_DIRECTORY}/examples/platforms/two_hosts.xml)
+
+
+
set(teshsuite_src ${teshsuite_src} PARENT_SCOPE)
set(tesh_files ${tesh_files} PARENT_SCOPE)
set(xml_files ${xml_files} PARENT_SCOPE)
-
-foreach(x actor concurrent_rw host_on_off_wait listen_async pid storage_client_server)
- ADD_TESH_FACTORIES(tesh-s4u-${x} "thread;boost;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/s4u/${x} --cd ${CMAKE_BINARY_DIR}/teshsuite/s4u/${x} ${CMAKE_HOME_DIRECTORY}/teshsuite/s4u/${x}/${x}.tesh)
-endforeach()
--- /dev/null
+/* Copyright (c) 2010-2017. The SimGrid Team. All rights reserved. */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+/* We want this test to be exhaustive in term of:
+ * - communication involved (regular, asynchronous, detached, with a permanent receiver declared)
+ * - whether the send or the receive was posted first
+ *
+ * FIXME: Missing elements: timeouts, host/actor failures, link failures
+ */
+
+#include "simgrid/s4u.hpp"
+
+#include <cstring>
+
+XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "Messages specific for this s4u example");
+
+using namespace simgrid::s4u;
+
+static void usage(const char* binaryName, const char* defaultSend, const char* defaultRecv)
+{
+ std::fprintf(stderr, "Usage: %s examples/platforms/cluster.xml <send_spec> <recv_spec>\n"
+ "where spec is a list of letters giving the kind of tests you want to see.\n"
+ "Existing sender spec:\n"
+ " r regular send\n"
+ " R regular send (after a little delay)\n"
+ " i asynchronous isend\n"
+ " I asynchronous isend (after a little delay)\n"
+ " d detached send\n"
+ " D detached send (after a little delay)\n"
+ "Existing receiver spec:\n"
+ " r regular receive\n"
+ " R regular receive (after a little delay)\n"
+ " i asynchronous irecv\n"
+ " I asynchronous irecv (after a little delay)\n"
+ " p regular receive on permanent mailbox (after a little delay)\n"
+ " P regular receive on permanent mailbox (after a little delay)\n"
+ " j irecv on permanent mailbox (after a little delay)\n"
+ " J irecv on permanent mailbox (after a little delay)\n"
+ "\n"
+ "Example 1: %s examples/platforms/cluster.xml rRiIdD rrrrrr # testing all send functions\n"
+ "Default specs: %s %s (all possible pairs)\n",
+ binaryName, binaryName, defaultSend, defaultRecv);
+ exit(1);
+}
+
+static void sender(std::vector<std::string> args)
+{
+ XBT_INFO("Sender spec: %s", args[0].c_str());
+ for (unsigned int test = 1; test <= args[0].size(); test++) {
+ this_actor::sleep_until(test * 5 - 5);
+ char* mboxName = bprintf("Test #%u", test);
+ simgrid::s4u::MailboxPtr mbox = simgrid::s4u::Mailbox::byName(mboxName);
+
+ switch (args[0][test - 1]) {
+ case 'r':
+ XBT_INFO("Test %d: r (regular send)", test);
+ simgrid::s4u::this_actor::send(mbox, (void*)mboxName, 42.0);
+ break;
+ case 'R':
+ XBT_INFO("Test %d: R (sleep + regular send)", test);
+ simgrid::s4u::this_actor::sleep_for(0.5);
+ simgrid::s4u::this_actor::send(mbox, (void*)mboxName, 42.0);
+ break;
+
+ case 'i':
+ XBT_INFO("Test %d: i (asynchronous isend)", test);
+ simgrid::s4u::this_actor::isend(mbox, (void*)mboxName, 42.0)->wait();
+ break;
+ case 'I':
+ XBT_INFO("Test %d: I (sleep + isend)", test);
+ simgrid::s4u::this_actor::sleep_for(0.5);
+ simgrid::s4u::this_actor::isend(mbox, (void*)mboxName, 42.0)->wait();
+ break;
+
+ case 'd':
+ XBT_INFO("Test %d: d (detached send)", test);
+ simgrid::s4u::this_actor::dsend(mbox, (void*)mboxName, 42.0);
+ break;
+ case 'D':
+ XBT_INFO("Test %d: D (sleep + detached send)", test);
+ simgrid::s4u::this_actor::sleep_for(0.5);
+ simgrid::s4u::this_actor::dsend(mbox, (void*)mboxName, 42.0);
+ break;
+ default:
+ xbt_die("Unknown sender spec for test %d: '%c'", test, args[0][test - 1]);
+ }
+ XBT_INFO("Test %d OK", test);
+ }
+ simgrid::s4u::this_actor::sleep_for(0.5);
+ // FIXME: we should test what happens when the process ends before the end of remote comm instead of hiding it
+}
+
+static void receiver(std::vector<std::string> args)
+{
+ XBT_INFO("Receiver spec: %s", args[0].c_str());
+ for (unsigned int test = 1; test <= args[0].size(); test++) {
+ this_actor::sleep_until(test * 5 - 5);
+ char* mboxName = bprintf("Test #%u", test);
+ simgrid::s4u::MailboxPtr mbox = simgrid::s4u::Mailbox::byName(mboxName);
+ void* received = nullptr;
+
+ switch (args[0][test - 1]) {
+ case 'r':
+ XBT_INFO("Test %d: r (regular receive)", test);
+ received = simgrid::s4u::this_actor::recv(mbox);
+ break;
+ case 'R':
+ XBT_INFO("Test %d: R (sleep + regular receive)", test);
+ simgrid::s4u::this_actor::sleep_for(0.5);
+ received = simgrid::s4u::this_actor::recv(mbox);
+ break;
+
+ case 'i':
+ XBT_INFO("Test %d: i (asynchronous irecv)", test);
+ simgrid::s4u::this_actor::irecv(mbox, &received)->wait();
+ break;
+ case 'I':
+ XBT_INFO("Test %d: I (sleep + asynchronous irecv)", test);
+ simgrid::s4u::this_actor::sleep_for(0.5);
+ simgrid::s4u::this_actor::irecv(mbox, &received)->wait();
+ break;
+ case 'p':
+ XBT_INFO("Test %d: p (regular receive on permanent mailbox)", test);
+ mbox->setReceiver(Actor::self());
+ received = simgrid::s4u::this_actor::recv(mbox);
+ break;
+ case 'P':
+ XBT_INFO("Test %d: P (sleep + regular receive on permanent mailbox)", test);
+ simgrid::s4u::this_actor::sleep_for(0.5);
+ mbox->setReceiver(Actor::self());
+ received = simgrid::s4u::this_actor::recv(mbox);
+ break;
+ case 'j':
+ XBT_INFO("Test %d: j (irecv on permanent mailbox)", test);
+ mbox->setReceiver(Actor::self());
+ simgrid::s4u::this_actor::irecv(mbox, &received)->wait();
+ break;
+ case 'J':
+ XBT_INFO("Test %d: J (sleep + irecv on permanent mailbox)", test);
+ simgrid::s4u::this_actor::sleep_for(0.5);
+ mbox->setReceiver(Actor::self());
+ simgrid::s4u::this_actor::irecv(mbox, &received)->wait();
+ break;
+ default:
+ xbt_die("Unknown receiver spec for test %d: '%c'", test, args[0][test - 1]);
+ }
+
+ xbt_assert(strcmp(static_cast<char*>(received), mboxName) == 0);
+ xbt_free(received);
+ xbt_free(mboxName);
+ XBT_INFO("Test %d OK", test);
+ }
+ simgrid::s4u::this_actor::sleep_for(0.5);
+}
+
+int main(int argc, char* argv[])
+{
+ std::string specSend;
+ std::string specRecv;
+ for (char s : {'r', 'R', 'i', 'I', 'd', 'D'})
+ for (char r : {'r', 'R', 'i', 'I', 'p', 'P', 'j', 'J'}) {
+ specSend += s;
+ specRecv += r;
+ }
+ std::vector<std::string> argSend{specSend.c_str()};
+ std::vector<std::string> argRecv{specRecv.c_str()};
+
+ simgrid::s4u::Engine* e = new simgrid::s4u::Engine(&argc, argv);
+ if (argc < 2)
+ usage(argv[0], specSend.c_str(), specRecv.c_str());
+
+ e->loadPlatform(argv[1]);
+
+ if (argc >= 3) {
+ argSend.clear();
+ argSend.push_back(argv[2]);
+ }
+ if (argc >= 4) {
+ argRecv.clear();
+ argRecv.push_back(argv[3]);
+ }
+ xbt_assert(argSend.front().size() == argRecv.front().size(), "Sender and receiver spec must be of the same size");
+
+ simgrid::s4u::Host** hosts = sg_host_list();
+ simgrid::s4u::Actor::createActor("sender", hosts[0], sender, argSend);
+ simgrid::s4u::Actor::createActor("recver", hosts[1], receiver, argRecv);
+ xbt_free(hosts);
+
+ e->run();
+ XBT_INFO("Simulation time %g", e->getClock());
+
+ return 0;
+}
--- /dev/null
+#include <iostream>
+#include <simgrid/s4u.hpp>
+#include <stdlib.h>
+#include <vector>
+
+#define NUM_COMMS 1
+
+XBT_LOG_NEW_DEFAULT_CATEGORY(mwe, "Minimum Working Example");
+
+static void receiver()
+{
+ simgrid::s4u::MailboxPtr mymailbox = simgrid::s4u::Mailbox::byName("receiver_mailbox");
+ simgrid::s4u::MailboxPtr theirmailbox = simgrid::s4u::Mailbox::byName("sender_mailbox");
+
+ std::vector<simgrid::s4u::CommPtr> pending_comms;
+
+ XBT_INFO("Placing %d asynchronous recv requests", NUM_COMMS);
+ void* data;
+ for (int i = 0; i < NUM_COMMS; i++) {
+ simgrid::s4u::CommPtr comm = simgrid::s4u::Comm::recv_async(mymailbox, &data);
+ pending_comms.push_back(comm);
+ }
+
+ for (int i = 0; i < NUM_COMMS; i++) {
+ XBT_INFO("Sleeping for 3 seconds (for the %dth time)...", i + 1);
+ simgrid::s4u::this_actor::sleep_for(3.0);
+ XBT_INFO("Calling wait_any() for %ld pending comms", pending_comms.size());
+ std::vector<simgrid::s4u::CommPtr>::iterator ret_it =
+ simgrid::s4u::Comm::wait_any(pending_comms.begin(), pending_comms.end());
+ XBT_INFO("Counting the number of completed comms...");
+
+ int count = 0;
+ for (; ret_it != pending_comms.end(); count++, ret_it++)
+ ;
+
+ XBT_INFO("wait_any() replied that %d comms have completed", count);
+ // xbt_assert(count == 1, "wait_any() replied that %d comms have completed, which is broken!", count);
+ }
+}
+
+static void sender()
+{
+ simgrid::s4u::MailboxPtr mymailbox = simgrid::s4u::Mailbox::byName("sender_mailbox");
+ simgrid::s4u::MailboxPtr theirmailbox = simgrid::s4u::Mailbox::byName("receiver_mailbox");
+
+ void* data = (void*)"data";
+
+ for (int i = 0; i < NUM_COMMS; i++) {
+ XBT_INFO("Sending a message to the receiver");
+ simgrid::s4u::this_actor::send(theirmailbox, &data, 4);
+ XBT_INFO("Sleeping for 1000 seconds");
+ simgrid::s4u::this_actor::sleep_for(1000.0);
+ }
+}
+
+int main(int argc, char** argv)
+{
+
+ simgrid::s4u::Engine* engine = new simgrid::s4u::Engine(&argc, argv);
+
+ if (argc < 2) {
+ std::cerr << "Usage: " << argv[0] << " <xml platform file>" << std::endl;
+ exit(1);
+ }
+
+ engine->loadPlatform(argv[1]);
+ simgrid::s4u::Host* host = simgrid::s4u::Host::by_name("Tremblay");
+
+ simgrid::s4u::Actor::createActor("Receiver", host, receiver);
+ simgrid::s4u::Actor::createActor("Sender", host, sender);
+
+ simgrid::s4u::Engine::instance()->run();
+
+ return 0;
+}