class Host;
class Mailbox;
}
- namespace simix {
- class Synchro;
+ namespace kernel {
+ namespace activity {
+ class Synchro;
+ }
}
namespace surf {
class Resource;
typedef simgrid::s4u::As simgrid_As;
typedef simgrid::s4u::Host simgrid_Host;
typedef simgrid::s4u::Mailbox simgrid_Mailbox;
-typedef simgrid::simix::Synchro simix_Synchro;
+typedef simgrid::kernel::activity::Synchro simgrid_Synchro;
typedef simgrid::surf::Cpu surf_Cpu;
typedef simgrid::routing::NetCard routing_NetCard;
typedef simgrid::surf::Link Link;
typedef struct simgrid_As simgrid_As;
typedef struct simgrid_Host simgrid_Host;
typedef struct simgrid_Mailbox simgrid_Mailbox;
-typedef struct simix_Synchro simix_Synchro;
+typedef struct simgrid_Synchro simgrid_Synchro;
typedef struct surf_Cpu surf_Cpu;
typedef struct routing_NetCard routing_NetCard;
typedef struct surf_Resource surf_Resource;
typedef simgrid_Host* sg_host_t;
typedef simgrid_Mailbox* sg_mbox_t;
-typedef simix_Synchro *smx_synchro_t;
+typedef simgrid_Synchro *smx_synchro_t;
typedef surf_Cpu *surf_cpu_t;
typedef routing_NetCard *sg_netcard_t;
void *getUserData() { return userData_; }
private:
- simgrid::simix::Synchro *pimpl_ = nullptr;
+ simgrid::kernel::activity::Synchro *pimpl_ = nullptr;
e_s4u_activity_state_t state_ = inited;
double remains_ = 0;
void *userData_ = nullptr;
I wait_any(I first, I last)
{
// Map to dynar<Synchro*>:
- xbt_dynar_t comms = xbt_dynar_new(sizeof(simgrid::simix::Synchro*), NULL);
+ xbt_dynar_t comms = xbt_dynar_new(sizeof(simgrid::kernel::activity::Synchro*), NULL);
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::simix::Synchro*, comm.pimpl_);
+ xbt_dynar_push_as(comms, simgrid::kernel::activity::Synchro*, comm.pimpl_);
}
// Call the underlying simcall:
int idx = simcall_comm_waitany(comms, -1);
I wait_any_for(I first, I last, double timeout)
{
// Map to dynar<Synchro*>:
- xbt_dynar_t comms = xbt_dynar_new(sizeof(simgrid::simix::Synchro*), NULL);
+ xbt_dynar_t comms = xbt_dynar_new(sizeof(simgrid::kernel::activity::Synchro*), NULL);
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::simix::Synchro*, comm.pimpl_);
+ xbt_dynar_push_as(comms, simgrid::kernel::activity::Synchro*, comm.pimpl_);
}
// Call the underlying simcall:
int idx = simcall_comm_waitany(comms, timeout);
#include "src/kernel/activity/Synchro.h"
-simgrid::simix::Synchro::Synchro()
+simgrid::kernel::activity::Synchro::Synchro()
{
}
-simgrid::simix::Synchro::~Synchro()
+simgrid::kernel::activity::Synchro::~Synchro()
{
}
-void simgrid::simix::Synchro::ref()
+void simgrid::kernel::activity::Synchro::ref()
{
refcount++;
}
-void simgrid::simix::Synchro::unref()
+void simgrid::kernel::activity::Synchro::unref()
{
xbt_assert(refcount > 0,
"This synchro has a negative refcount! You can only call test() or wait() once per synchronization.");
#include <simgrid/simix.hpp>
namespace simgrid {
-namespace simix {
+namespace kernel {
+namespace activity {
XBT_PUBLIC_CLASS Synchro {
public:
private:
int refcount = 1;
};
-}} // namespace simgrid::simix
+}}} // namespace simgrid::kernel::activity
#else /* not C++ */
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_network);
-simgrid::simix::Comm::Comm(e_smx_comm_type_t _type) {
+simgrid::kernel::activity::Comm::Comm(e_smx_comm_type_t _type) {
state = SIMIX_WAITING;
this->type = _type;
src_data=nullptr;
XBT_DEBUG("Create communicate synchro %p", this);
}
-simgrid::simix::Comm::~Comm()
+simgrid::kernel::activity::Comm::~Comm()
{
XBT_DEBUG("Really free communication %p", this);
SIMIX_mbox_remove(mbox, this);
}
-void simgrid::simix::Comm::suspend()
+void simgrid::kernel::activity::Comm::suspend()
{
/* FIXME: shall we suspend also the timeout synchro? */
if (surf_comm)
}
-void simgrid::simix::Comm::resume()
+void simgrid::kernel::activity::Comm::resume()
{
/*FIXME: check what happen with the timeouts */
if (surf_comm)
/* in the other case, the synchro were not really suspended yet, see SIMIX_comm_suspend() and SIMIX_comm_start() */
}
-void simgrid::simix::Comm::cancel()
+void simgrid::kernel::activity::Comm::cancel()
{
/* if the synchro is a waiting state means that it is still in a mbox */
/* so remove from it and delete it */
}
/** @brief get the amount remaining from the communication */
-double simgrid::simix::Comm::remains()
+double simgrid::kernel::activity::Comm::remains()
{
switch (state) {
}
/** @brief This is part of the cleanup process, probably an internal command */
-void simgrid::simix::Comm::cleanupSurf()
+void simgrid::kernel::activity::Comm::cleanupSurf()
{
if (surf_comm){
surf_comm->unref();
}
}
-void simgrid::simix::Comm::post()
+void simgrid::kernel::activity::Comm::post()
{
/* Update synchro state */
if (src_timeout && src_timeout->getState() == simgrid::surf::Action::State::done)
} e_smx_comm_type_t;
namespace simgrid {
-namespace simix {
+namespace kernel {
+namespace activity {
XBT_PUBLIC_CLASS Comm : public Synchro {
~Comm() override;
void* dst_data = nullptr;
};
-}} // namespace simgrid::simix
+}}} // namespace simgrid::kernel::activity
#endif
#include "src/surf/surf_interface.hpp"
#include "src/simix/smx_host_private.h"
-simgrid::simix::Exec::Exec(const char*name, sg_host_t hostarg)
+simgrid::kernel::activity::Exec::Exec(const char*name, sg_host_t hostarg)
{
if (name)
this->name = name;
this->host = hostarg;
}
-simgrid::simix::Exec::~Exec()
+simgrid::kernel::activity::Exec::~Exec()
{
if (surf_exec)
surf_exec->unref();
}
-void simgrid::simix::Exec::suspend()
+void simgrid::kernel::activity::Exec::suspend()
{
if (surf_exec)
surf_exec->suspend();
}
-void simgrid::simix::Exec::resume()
+void simgrid::kernel::activity::Exec::resume()
{
if (surf_exec)
surf_exec->resume();
}
-double simgrid::simix::Exec::remains()
+double simgrid::kernel::activity::Exec::remains()
{
if (state == SIMIX_RUNNING)
return surf_exec->getRemains();
return 0;
}
-void simgrid::simix::Exec::post()
+void simgrid::kernel::activity::Exec::post()
{
if (host && host->isOff()) {/* FIMXE: handle resource failure for parallel tasks too */
/* If the host running the synchro failed, notice it. This way, the asking
#include "src/kernel/activity/Synchro.h"
namespace simgrid {
-namespace simix {
+namespace kernel {
+namespace activity {
XBT_PUBLIC_CLASS Exec : public Synchro {
~Exec() override;
surf_action_t surf_exec = nullptr; /* The Surf execution action encapsulated */
};
-}} // namespace simgrid::simix
+}}} // namespace simgrid::kernel::activity
#endif
#include "src/simix/popping_private.h"
#include "src/simix/smx_private.h"
-void simgrid::simix::Io::suspend()
+void simgrid::kernel::activity::Io::suspend()
{
if (surf_io)
surf_io->suspend();
}
-void simgrid::simix::Io::resume()
+void simgrid::kernel::activity::Io::resume()
{
if (surf_io)
surf_io->resume();
}
-void simgrid::simix::Io::post()
+void simgrid::kernel::activity::Io::post()
{
for (smx_simcall_t simcall : simcalls) {
switch (simcall->call) {
#include "src/kernel/activity/Synchro.h"
namespace simgrid {
-namespace simix {
+namespace kernel {
+namespace activity {
XBT_PUBLIC_CLASS Io : public Synchro {
public:
surf_action_t surf_io = nullptr;
};
-}} // namespace simgrid::simix
+}}} // namespace simgrid::kernel::activity
#endif
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_synchro);
-simgrid::simix::Raw::~Raw()
+simgrid::kernel::activity::Raw::~Raw()
{
sleep->unref();
}
-void simgrid::simix::Raw::suspend()
+void simgrid::kernel::activity::Raw::suspend()
{
/* The suspension of raw synchros is delayed to when the process is rescheduled. */
}
-void simgrid::simix::Raw::resume()
+void simgrid::kernel::activity::Raw::resume()
{
/* I cannot resume raw synchros directly. This is delayed to when the process is rescheduled at
* the end of the synchro. */
}
-void simgrid::simix::Raw::post()
+void simgrid::kernel::activity::Raw::post()
{
XBT_IN("(%p)",this);
if (sleep->getState() == simgrid::surf::Action::State::failed)
#include "src/kernel/activity/Synchro.h"
namespace simgrid {
-namespace simix {
+namespace kernel {
+namespace activity {
/** Used to implement mutexes, semaphores and conditions */
XBT_PUBLIC_CLASS Raw : public Synchro {
surf_action_t sleep = nullptr;
};
-}} // namespace simgrid::simix
+}}} // namespace simgrid::kernel::activity
#endif
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_process);
-void simgrid::simix::Sleep::suspend()
+void simgrid::kernel::activity::Sleep::suspend()
{
surf_sleep->suspend();
}
-void simgrid::simix::Sleep::resume()
+void simgrid::kernel::activity::Sleep::resume()
{
surf_sleep->resume();
}
-void simgrid::simix::Sleep::post()
+void simgrid::kernel::activity::Sleep::post()
{
while (!simcalls.empty()) {
smx_simcall_t simcall = simcalls.front();
#include "src/kernel/activity/Synchro.h"
namespace simgrid {
-namespace simix {
+namespace kernel {
+namespace activity {
XBT_PUBLIC_CLASS Sleep : public Synchro {
public:
surf_action_t surf_sleep = nullptr; /* The Surf sleeping action encapsulated */
};
-}} // namespace simgrid::simix
+}}} // namespace simgrid::kernel::activity
#endif
static void update_comm_pattern(
simgrid::mc::PatternCommunication* comm_pattern,
- simgrid::mc::RemotePtr<simgrid::simix::Comm> comm_addr)
+ simgrid::mc::RemotePtr<simgrid::kernel::activity::Comm> comm_addr)
{
// HACK, type punning
- simgrid::mc::Remote<simgrid::simix::Comm> temp_comm;
+ simgrid::mc::Remote<simgrid::kernel::activity::Comm> temp_comm;
mc_model_checker->process().read(temp_comm, comm_addr);
- simgrid::simix::Comm* comm =
- static_cast<simgrid::simix::Comm*>(temp_comm.getBuffer());
+ simgrid::kernel::activity::Comm* comm =
+ static_cast<simgrid::kernel::activity::Comm*>(temp_comm.getBuffer());
smx_process_t src_proc = mc_model_checker->process().resolveProcess(
simgrid::mc::remote(comm->src_proc));
pattern->type = simgrid::mc::PatternCommunicationType::send;
pattern->comm_addr = simcall_comm_isend__get__result(request);
- simgrid::mc::Remote<simgrid::simix::Comm> temp_synchro;
+ simgrid::mc::Remote<simgrid::kernel::activity::Comm> temp_synchro;
mc_model_checker->process().read(temp_synchro, remote(
- static_cast<simgrid::simix::Comm*>(pattern->comm_addr)));
- simgrid::simix::Comm* synchro =
- static_cast<simgrid::simix::Comm*>(temp_synchro.getBuffer());
+ static_cast<simgrid::kernel::activity::Comm*>(pattern->comm_addr)));
+ simgrid::kernel::activity::Comm* synchro =
+ static_cast<simgrid::kernel::activity::Comm*>(temp_synchro.getBuffer());
char* remote_name = mc_model_checker->process().read<char*>(
(std::uint64_t)(synchro->mbox ? &synchro->mbox->name : &synchro->mbox_cpy->name));
&mpi_request, remote((struct s_smpi_mpi_request*)simcall_comm_irecv__get__data(request)));
pattern->tag = mpi_request.tag;
- simgrid::mc::Remote<simgrid::simix::Comm> temp_comm;
+ simgrid::mc::Remote<simgrid::kernel::activity::Comm> temp_comm;
mc_model_checker->process().read(temp_comm, remote(
- static_cast<simgrid::simix::Comm*>(pattern->comm_addr)));
- simgrid::simix::Comm* comm = temp_comm.getBuffer();
+ static_cast<simgrid::kernel::activity::Comm*>(pattern->comm_addr)));
+ simgrid::kernel::activity::Comm* comm = temp_comm.getBuffer();
char* remote_name;
mc_model_checker->process().read(&remote_name,
void CommunicationDeterminismChecker::complete_comm_pattern(
- xbt_dynar_t list, simgrid::mc::RemotePtr<simgrid::simix::Comm> comm_addr,
+ xbt_dynar_t list, simgrid::mc::RemotePtr<simgrid::kernel::activity::Comm> comm_addr,
unsigned int issuer, int backtracking)
{
simgrid::mc::PatternCommunication* current_comm_pattern;
// These are used by functions which should be moved in CommunicationDeterminismChecker:
void get_comm_pattern(xbt_dynar_t list, smx_simcall_t request, e_mc_call_type_t call_type, int backtracking);
void complete_comm_pattern(
- xbt_dynar_t list, simgrid::mc::RemotePtr<simgrid::simix::Comm> comm_addr,
+ xbt_dynar_t list, simgrid::mc::RemotePtr<simgrid::kernel::activity::Comm> comm_addr,
unsigned int issuer, int backtracking);
private:
/** Stack representing the position in the exploration graph */
case SIMCALL_COMM_WAIT:
{
/* FIXME: check also that src and dst processes are not suspended */
- simgrid::simix::Comm *act = static_cast<simgrid::simix::Comm*>(simcall_comm_wait__get__comm(req));
+ simgrid::kernel::activity::Comm *act =
+ static_cast<simgrid::kernel::activity::Comm*>(simcall_comm_wait__get__comm(req));
#if HAVE_MC
// Fetch from MCed memory:
// HACK, type puning
- simgrid::mc::Remote<simgrid::simix::Comm> temp_comm;
+ simgrid::mc::Remote<simgrid::kernel::activity::Comm> temp_comm;
if (mc_model_checker != nullptr) {
mc_model_checker->process().read(temp_comm, remote(act));
- act = static_cast<simgrid::simix::Comm*>(temp_comm.getBuffer());
+ act = static_cast<simgrid::kernel::activity::Comm*>(temp_comm.getBuffer());
}
#endif
case SIMCALL_COMM_WAITANY: {
xbt_dynar_t comms;
- simgrid::simix::Comm *act = static_cast<simgrid::simix::Comm*>(simcall_comm_wait__get__comm(req));
+ simgrid::kernel::activity::Comm *act =
+ static_cast<simgrid::kernel::activity::Comm*>(simcall_comm_wait__get__comm(req));
#if HAVE_MC
s_xbt_dynar_t comms_buffer;
#if HAVE_MC
// Fetch act from MCed memory:
// HACK, type puning
- simgrid::mc::Remote<simgrid::simix::Comm> temp_comm;
+ simgrid::mc::Remote<simgrid::kernel::activity::Comm> temp_comm;
if (mc_model_checker != nullptr) {
memcpy(&act, buffer + comms->elmsize * index, sizeof(act));
mc_model_checker->process().read(temp_comm, remote(act));
- act = static_cast<simgrid::simix::Comm*>(temp_comm.getBuffer());
+ act = static_cast<simgrid::kernel::activity::Comm*>(temp_comm.getBuffer());
}
else
#endif
- act = xbt_dynar_get_as(comms, index, simgrid::simix::Comm*);
+ act = xbt_dynar_get_as(comms, index, simgrid::kernel::activity::Comm*);
if (act->src_proc && act->dst_proc)
return true;
}
case MC_CALL_TYPE_WAIT:
case MC_CALL_TYPE_WAITANY:
{
- simgrid::mc::RemotePtr<simgrid::simix::Comm> comm_addr = nullptr;
+ simgrid::mc::RemotePtr<simgrid::kernel::activity::Comm> comm_addr = nullptr;
if (call_type == MC_CALL_TYPE_WAIT)
- comm_addr = remote(static_cast<simgrid::simix::Comm*>(
+ comm_addr = remote(static_cast<simgrid::kernel::activity::Comm*>(
simcall_comm_wait__get__comm(req)));
else {
- simgrid::simix::Comm* addr;
+ simgrid::kernel::activity::Comm* addr;
// comm_addr = REMOTE(xbt_dynar_get_as(simcall_comm_waitany__get__comms(req), value, smx_synchro_t)):
simgrid::mc::read_element(mc_model_checker->process(), &addr,
remote(simcall_comm_waitany__get__comms(req)), value, sizeof(comm_addr));
static char *buff_size_to_string(size_t size);
static inline
-simgrid::simix::Comm* MC_get_comm(smx_simcall_t r)
+simgrid::kernel::activity::Comm* MC_get_comm(smx_simcall_t r)
{
switch (r->call ) {
case SIMCALL_COMM_WAIT:
- return static_cast<simgrid::simix::Comm*>(simcall_comm_wait__get__comm(r));
+ return static_cast<simgrid::kernel::activity::Comm*>(simcall_comm_wait__get__comm(r));
case SIMCALL_COMM_TEST:
- return static_cast<simgrid::simix::Comm*>(simcall_comm_test__get__comm(r));
+ return static_cast<simgrid::kernel::activity::Comm*>(simcall_comm_test__get__comm(r));
default:
return nullptr;
}
// Those are internal requests, we do not need indirection
// because those objects are copies:
- simgrid::simix::Comm* synchro1 = MC_get_comm(r1);
- simgrid::simix::Comm* synchro2 = MC_get_comm(r2);
+ simgrid::kernel::activity::Comm* synchro1 = MC_get_comm(r1);
+ simgrid::kernel::activity::Comm* synchro2 = MC_get_comm(r2);
if ((r1->call == SIMCALL_COMM_ISEND || r1->call == SIMCALL_COMM_IRECV)
&& r2->call == SIMCALL_COMM_WAIT) {
// Those are internal requests, we do not need indirection
// because those objects are copies:
- simgrid::simix::Comm* synchro1 = MC_get_comm(r1);
- simgrid::simix::Comm* synchro2 = MC_get_comm(r2);
+ simgrid::kernel::activity::Comm* synchro1 = MC_get_comm(r1);
+ simgrid::kernel::activity::Comm* synchro2 = MC_get_comm(r2);
switch(r1->call) {
case SIMCALL_COMM_ISEND:
}
case SIMCALL_COMM_WAIT: {
- simgrid::simix::Comm* remote_act =
- static_cast<simgrid::simix::Comm*>(simcall_comm_wait__get__comm(req));
+ simgrid::kernel::activity::Comm* remote_act =
+ static_cast<simgrid::kernel::activity::Comm*>(simcall_comm_wait__get__comm(req));
char* p;
if (value == -1) {
type = "WaitTimeout";
type = "Wait";
p = pointer_to_string(remote_act);
- simgrid::mc::Remote<simgrid::simix::Comm> temp_synchro;
- simgrid::simix::Comm* act;
+ simgrid::mc::Remote<simgrid::kernel::activity::Comm> temp_synchro;
+ simgrid::kernel::activity::Comm* act;
if (use_remote_comm) {
mc_model_checker->process().read(temp_synchro, remote(
- static_cast<simgrid::simix::Comm*>(remote_act)));
+ static_cast<simgrid::kernel::activity::Comm*>(remote_act)));
act = temp_synchro.getBuffer();
} else
act = remote_act;
}
case SIMCALL_COMM_TEST: {
- simgrid::simix::Comm* remote_act = static_cast<simgrid::simix::Comm*>(
+ simgrid::kernel::activity::Comm* remote_act = static_cast<simgrid::kernel::activity::Comm*>(
simcall_comm_test__get__comm(req));
- simgrid::mc::Remote<simgrid::simix::Comm> temp_synchro;
- simgrid::simix::Comm* act;
+ simgrid::mc::Remote<simgrid::kernel::activity::Comm> temp_synchro;
+ simgrid::kernel::activity::Comm* act;
if (use_remote_comm) {
mc_model_checker->process().read(temp_synchro, remote(
- static_cast<simgrid::simix::Comm*>(remote_act)));
+ static_cast<simgrid::kernel::activity::Comm*>(remote_act)));
act = temp_synchro.getBuffer();
} else
act = remote_act;
return true;
}
- simgrid::mc::Remote<simgrid::simix::Comm> temp_comm;
+ simgrid::mc::Remote<simgrid::kernel::activity::Comm> temp_comm;
mc_model_checker->process().read(temp_comm, remote(
- static_cast<simgrid::simix::Comm*>(remote_act)));
- simgrid::simix::Comm* comm = temp_comm.getBuffer();
+ static_cast<simgrid::kernel::activity::Comm*>(remote_act)));
+ simgrid::kernel::activity::Comm* comm = temp_comm.getBuffer();
return comm->src_proc && comm->dst_proc;
}
label = simgrid::xbt::string_printf("[(%lu)] WaitTimeout", issuer->pid);
} else {
smx_synchro_t remote_act = simcall_comm_wait__get__comm(req);
- simgrid::mc::Remote<simgrid::simix::Comm> temp_comm;
+ simgrid::mc::Remote<simgrid::kernel::activity::Comm> temp_comm;
mc_model_checker->process().read(temp_comm, remote(
- static_cast<simgrid::simix::Comm*>(remote_act)));
- simgrid::simix::Comm* comm = temp_comm.getBuffer();
+ static_cast<simgrid::kernel::activity::Comm*>(remote_act)));
+ simgrid::kernel::activity::Comm* comm = temp_comm.getBuffer();
smx_process_t src_proc = mc_model_checker->process().resolveProcess(
simgrid::mc::remote(comm->src_proc));
case SIMCALL_COMM_TEST: {
smx_synchro_t remote_act = simcall_comm_test__get__comm(req);
- simgrid::mc::Remote<simgrid::simix::Comm> temp_comm;
+ simgrid::mc::Remote<simgrid::kernel::activity::Comm> temp_comm;
mc_model_checker->process().read(temp_comm, remote(
- static_cast<simgrid::simix::Comm*>(remote_act)));
- simgrid::simix::Comm* comm = temp_comm.getBuffer();
+ static_cast<simgrid::kernel::activity::Comm*>(remote_act)));
+ simgrid::kernel::activity::Comm* comm = temp_comm.getBuffer();
if (comm->src_proc == nullptr || comm->dst_proc == nullptr) {
if (issuer->host)
label = simgrid::xbt::string_printf("[(%lu)%s] Test FALSE",
}
case SIMCALL_COMM_WAIT: {
- simgrid::mc::RemotePtr<simgrid::simix::Comm> remote_act = remote(
- static_cast<simgrid::simix::Comm*>(simcall_comm_wait__get__comm(&process->simcall)));
- simgrid::mc::Remote<simgrid::simix::Comm> temp_act;
+ simgrid::mc::RemotePtr<simgrid::kernel::activity::Comm> remote_act = remote(
+ static_cast<simgrid::kernel::activity::Comm*>(simcall_comm_wait__get__comm(&process->simcall)));
+ simgrid::mc::Remote<simgrid::kernel::activity::Comm> temp_act;
mc_model_checker->process().read(temp_act, remote_act);
- simgrid::simix::Comm* act = temp_act.getBuffer();
+ simgrid::kernel::activity::Comm* act = temp_act.getBuffer();
if (act->src_proc && act->dst_proc)
state->transition.argument = 0;
else if (act->src_proc == nullptr && act->type == SIMIX_COMM_READY
&remote_comm, remote(simcall_comm_waitany__get__comms(req)),
state->transition.argument, sizeof(remote_comm));
mc_model_checker->process().read(state->internal_comm, remote(
- static_cast<simgrid::simix::Comm*>(remote_comm)));
+ static_cast<simgrid::kernel::activity::Comm*>(remote_comm)));
simcall_comm_wait__set__comm(&state->internal_req, state->internal_comm.getBuffer());
simcall_comm_wait__set__timeout(&state->internal_req, 0);
break;
smx_synchro_t remote_comm = mc_model_checker->process().read(
remote(simcall_comm_testany__get__comms(req) + state->transition.argument));
mc_model_checker->process().read(state->internal_comm, remote(
- static_cast<simgrid::simix::Comm*>(remote_comm)));
+ static_cast<simgrid::kernel::activity::Comm*>(remote_comm)));
}
simcall_comm_test__set__comm(&state->internal_req, state->internal_comm.getBuffer());
s_smx_simcall_t internal_req;
/* Can be used as a copy of the remote synchro object */
- simgrid::mc::Remote<simgrid::simix::Comm> internal_comm;
+ simgrid::mc::Remote<simgrid::kernel::activity::Comm> internal_comm;
/** Snapshot of system state (if needed) */
std::shared_ptr<simgrid::mc::Snapshot> system_state;
simdata->setUsed();
if (simdata->host_nb > 0) {
- simdata->compute = static_cast<simgrid::simix::Exec*>(
+ simdata->compute = static_cast<simgrid::kernel::activity::Exec*>(
simcall_execution_parallel_start(task->name, simdata->host_nb,simdata->host_list,
simdata->flops_parallel_amount, simdata->bytes_parallel_amount,
1.0, -1.0));
XBT_DEBUG("execute %s@%s with affinity(0x%04lx)",
MSG_task_get_name(task), MSG_host_get_name(p_simdata->m_host), affinity_mask);
- simdata->compute = static_cast<simgrid::simix::Exec*>(
+ simdata->compute = static_cast<simgrid::kernel::activity::Exec*>(
simcall_execution_start(task->name, simdata->flops_amount, simdata->priority,
simdata->bound, affinity_mask));
}
/* Send it by calling SIMIX network layer */
smx_synchro_t act = simcall_comm_isend(myself, mailbox, t_simdata->bytes_amount, t_simdata->rate,
task, sizeof(void *), match_fun, cleanup, nullptr, match_data,detached);
- t_simdata->comm = static_cast<simgrid::simix::Comm*>(act);
+ t_simdata->comm = static_cast<simgrid::kernel::activity::Comm*>(act);
msg_comm_t comm = nullptr;
if (! detached) {
int finished_index = -1;
/* Create the equivalent array with SIMIX objects: */
- std::vector<simgrid::simix::Synchro*> s_comms;
+ std::vector<simgrid::kernel::activity::Synchro*> s_comms;
s_comms.reserve(xbt_dynar_length(comms));
msg_comm_t comm;
unsigned int cursor;
*/
void MSG_comm_copy_data_from_SIMIX(smx_synchro_t synchro, void* buff, size_t buff_size)
{
- simgrid::simix::Comm *comm = static_cast<simgrid::simix::Comm*>(synchro);
+ simgrid::kernel::activity::Comm *comm = static_cast<simgrid::kernel::activity::Comm*>(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::simix::Comm*>(comm);
+ t_simdata->comm = static_cast<simgrid::kernel::activity::Comm*>(comm);
simcall_comm_wait(comm, timeout);
}
catch (xbt_ex& e) {
int MSG_task_listen_from(const char *alias)
{
msg_mailbox_t mbox = MSG_mailbox_get_by_alias(alias);
- simgrid::simix::Comm* comm = static_cast<simgrid::simix::Comm*>(simcall_mbox_front(mbox));
+ simgrid::kernel::activity::Comm* comm = static_cast<simgrid::kernel::activity::Comm*>(simcall_mbox_front(mbox));
if (!comm)
return -1;
msg_task_t MSG_mailbox_front(msg_mailbox_t mailbox)
{
- simgrid::simix::Comm* comm = static_cast<simgrid::simix::Comm*>(simcall_mbox_front(mailbox));
+ simgrid::kernel::activity::Comm* comm = static_cast<simgrid::kernel::activity::Comm*>(simcall_mbox_front(mailbox));
if (!comm)
return nullptr;
this->isused = false;
}
- simgrid::simix::Exec *compute = nullptr; /* SIMIX modeling of computation */
- simgrid::simix::Comm *comm = nullptr; /* SIMIX modeling of communication */
+ simgrid::kernel::activity::Exec *compute = nullptr; /* SIMIX modeling of computation */
+ simgrid::kernel::activity::Comm *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;
return;
}
- simgrid::simix::Exec *compute = task->simdata->compute;
+ simgrid::kernel::activity::Exec *compute = task->simdata->compute;
msg_host_t host_now = compute->host; // simix_private.h is necessary
if (host_now != host) {
/* task is not yet executed on this host */
void simcall_comm_cancel(smx_synchro_t synchro)
{
simgrid::simix::kernelImmediate([synchro]{
- simgrid::simix::Comm *comm = static_cast<simgrid::simix::Comm*>(synchro);
+ simgrid::kernel::activity::Comm *comm = static_cast<simgrid::kernel::activity::Comm*>(synchro);
comm->cancel();
});
}
const char* synchro_description = "unknown";
- if (dynamic_cast<simgrid::simix::Exec*>(process->waiting_synchro) != nullptr)
+ if (dynamic_cast<simgrid::kernel::activity::Exec*>(process->waiting_synchro) != nullptr)
synchro_description = "execution";
- if (dynamic_cast<simgrid::simix::Comm*>(process->waiting_synchro) != nullptr)
+ if (dynamic_cast<simgrid::kernel::activity::Comm*>(process->waiting_synchro) != nullptr)
synchro_description = "communication";
- if (dynamic_cast<simgrid::simix::Sleep*>(process->waiting_synchro) != nullptr)
+ if (dynamic_cast<simgrid::kernel::activity::Sleep*>(process->waiting_synchro) != nullptr)
synchro_description = "sleeping";
- if (dynamic_cast<simgrid::simix::Raw*>(process->waiting_synchro) != nullptr)
+ if (dynamic_cast<simgrid::kernel::activity::Raw*>(process->waiting_synchro) != nullptr)
synchro_description = "synchronization";
- if (dynamic_cast<simgrid::simix::Io*>(process->waiting_synchro) != nullptr)
+ if (dynamic_cast<simgrid::kernel::activity::Io*>(process->waiting_synchro) != nullptr)
synchro_description = "I/O";
double bound, unsigned long affinity_mask){
/* alloc structures and initialize */
- simgrid::simix::Exec *exec = new simgrid::simix::Exec(name, issuer->host);
+ simgrid::kernel::activity::Exec *exec = new simgrid::kernel::activity::Exec(name, issuer->host);
/* set surf's action */
if (!MC_is_active() && !MC_record_replay_is_active()) {
double *bytes_amount, double amount, double rate){
/* alloc structures and initialize */
- simgrid::simix::Exec *exec = new simgrid::simix::Exec(name, nullptr);
+ simgrid::kernel::activity::Exec *exec = new simgrid::kernel::activity::Exec(name, nullptr);
/* set surf's synchro */
sg_host_t *host_list_cpy = xbt_new0(sg_host_t, host_nb);
void SIMIX_execution_cancel(smx_synchro_t synchro)
{
XBT_DEBUG("Cancel synchro %p", synchro);
- simgrid::simix::Exec *exec = static_cast<simgrid::simix::Exec *>(synchro);
+ simgrid::kernel::activity::Exec *exec = static_cast<simgrid::kernel::activity::Exec *>(synchro);
if (exec->surf_exec)
exec->surf_exec->cancel();
void SIMIX_execution_set_priority(smx_synchro_t synchro, double priority)
{
- simgrid::simix::Exec *exec = static_cast<simgrid::simix::Exec *>(synchro);
+ simgrid::kernel::activity::Exec *exec = static_cast<simgrid::kernel::activity::Exec *>(synchro);
if(exec->surf_exec)
exec->surf_exec->setPriority(priority);
}
void SIMIX_execution_set_bound(smx_synchro_t synchro, double bound)
{
- simgrid::simix::Exec *exec = static_cast<simgrid::simix::Exec *>(synchro);
+ simgrid::kernel::activity::Exec *exec = static_cast<simgrid::kernel::activity::Exec *>(synchro);
if(exec->surf_exec)
static_cast<simgrid::surf::CpuAction*>(exec->surf_exec)->setBound(bound);
}
void SIMIX_execution_set_affinity(smx_synchro_t synchro, sg_host_t host, unsigned long mask)
{
- simgrid::simix::Exec *exec = static_cast<simgrid::simix::Exec *>(synchro);
+ simgrid::kernel::activity::Exec *exec = static_cast<simgrid::kernel::activity::Exec *>(synchro);
if(exec->surf_exec) {
/* just a double check to confirm that this host is the host where this task is running. */
xbt_assert(exec->host == host);
void simcall_HANDLER_execution_wait(smx_simcall_t simcall, smx_synchro_t synchro)
{
- simgrid::simix::Exec *exec = static_cast<simgrid::simix::Exec *>(synchro);
+ simgrid::kernel::activity::Exec *exec = static_cast<simgrid::kernel::activity::Exec *>(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::simix::Exec *exec)
+void SIMIX_execution_finish(simgrid::kernel::activity::Exec *exec)
{
for (smx_simcall_t simcall : exec->simcalls) {
switch (exec->state) {
if (synchro->state != SIMIX_RUNNING)
return;
- simgrid::simix::Exec *exec = dynamic_cast<simgrid::simix::Exec *>(synchro);
+ simgrid::kernel::activity::Exec *exec = dynamic_cast<simgrid::kernel::activity::Exec *>(synchro);
if (exec != nullptr) {
exec->surf_exec->setCategory(category);
return;
}
- simgrid::simix::Comm *comm = dynamic_cast<simgrid::simix::Comm *>(synchro);
+ simgrid::kernel::activity::Comm *comm = dynamic_cast<simgrid::kernel::activity::Comm *>(synchro);
if (comm != nullptr) {
comm->surf_comm->setCategory(category);
return;
XBT_PRIVATE void SIMIX_execution_set_bound(smx_synchro_t synchro, double bound);
XBT_PRIVATE void SIMIX_execution_set_affinity(smx_synchro_t synchro, sg_host_t host, unsigned long mask);
-XBT_PRIVATE void SIMIX_execution_finish(simgrid::simix::Exec *exec);
+XBT_PRIVATE void SIMIX_execution_finish(simgrid::kernel::activity::Exec *exec);
XBT_PRIVATE void SIMIX_set_category(smx_synchro_t synchro, const char *category);
THROWF(host_error, 0, "Host %s failed, you cannot call this function", sg_host_get_name(host));
- simgrid::simix::Io *synchro = new simgrid::simix::Io();
+ simgrid::kernel::activity::Io *synchro = new simgrid::kernel::activity::Io();
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", sg_host_get_name(host));
- simgrid::simix::Io *synchro = new simgrid::simix::Io();
+ simgrid::kernel::activity::Io *synchro = new simgrid::kernel::activity::Io();
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", sg_host_get_name(host));
- simgrid::simix::Io *synchro = new simgrid::simix::Io();
+ simgrid::kernel::activity::Io *synchro = new simgrid::kernel::activity::Io();
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", sg_host_get_name(host));
- simgrid::simix::Io *synchro = new simgrid::simix::Io();
+ simgrid::kernel::activity::Io *synchro = new simgrid::kernel::activity::Io();
synchro->host = host;
synchro->surf_io = surf_host_close(host, fd->surf_file);
synchro->surf_io->setData(synchro);
void SIMIX_io_destroy(smx_synchro_t synchro)
{
- simgrid::simix::Io *io = static_cast<simgrid::simix::Io*>(synchro);
+ simgrid::kernel::activity::Io *io = static_cast<simgrid::kernel::activity::Io*>(synchro);
XBT_DEBUG("Destroy synchro %p", synchro);
if (io->surf_io)
io->surf_io->unref();
*/
static inline void SIMIX_mbox_push(smx_mailbox_t mbox, smx_synchro_t synchro)
{
- simgrid::simix::Comm *comm = static_cast<simgrid::simix::Comm*>(synchro);
+ simgrid::kernel::activity::Comm *comm = static_cast<simgrid::kernel::activity::Comm*>(synchro);
mbox->comm_queue.push_back(comm);
comm->mbox = mbox;
}
*/
void SIMIX_mbox_remove(smx_mailbox_t mbox, smx_synchro_t synchro)
{
- simgrid::simix::Comm *comm = static_cast<simgrid::simix::Comm*>(synchro);
+ simgrid::kernel::activity::Comm *comm = static_cast<simgrid::kernel::activity::Comm*>(synchro);
comm->mbox = nullptr;
for (auto it = mbox->comm_queue.begin(); it != mbox->comm_queue.end(); it++)
for(auto it = deque->begin(); it != deque->end(); it++){
smx_synchro_t synchro = *it;
- simgrid::simix::Comm *comm = static_cast<simgrid::simix::Comm*>(synchro);
+ simgrid::kernel::activity::Comm *comm = static_cast<simgrid::kernel::activity::Comm*>(synchro);
if (comm->type == SIMIX_COMM_SEND) {
other_user_data = comm->src_data;
XBT_DEBUG("send from %p", mbox);
/* Prepare a synchro describing us, so that it gets passed to the user-provided filter of other side */
- simgrid::simix::Comm* this_synchro = new simgrid::simix::Comm(SIMIX_COMM_SEND);
+ simgrid::kernel::activity::Comm* this_synchro = new simgrid::kernel::activity::Comm(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 */
smx_synchro_t other_synchro =
_find_matching_comm(&mbox->comm_queue, SIMIX_COMM_RECEIVE, match_fun, data, this_synchro, /*remove_matching*/true);
- simgrid::simix::Comm *other_comm = static_cast<simgrid::simix::Comm*>(other_synchro);
+ simgrid::kernel::activity::Comm *other_comm = static_cast<simgrid::kernel::activity::Comm*>(other_synchro);
if (!other_synchro) {
other_synchro = this_synchro;
- other_comm = static_cast<simgrid::simix::Comm*>(other_synchro);
+ other_comm = static_cast<simgrid::kernel::activity::Comm*>(other_synchro);
if (mbox->permanent_receiver!=nullptr){
//this mailbox is for small messages, which have to be sent right now
void *data, double rate)
{
XBT_DEBUG("recv from %p %p", mbox, &mbox->comm_queue);
- simgrid::simix::Comm* this_synchro = new simgrid::simix::Comm(SIMIX_COMM_RECEIVE);
+ simgrid::kernel::activity::Comm* this_synchro = new simgrid::kernel::activity::Comm(SIMIX_COMM_RECEIVE);
smx_synchro_t other_synchro;
//communication already done, get it inside the fifo of completed comms
other_synchro = this_synchro;
SIMIX_mbox_push(mbox, this_synchro);
} else {
- simgrid::simix::Comm *other_comm = static_cast<simgrid::simix::Comm*>(other_synchro);
+ simgrid::kernel::activity::Comm *other_comm = static_cast<simgrid::kernel::activity::Comm*>(other_synchro);
if(other_comm->surf_comm && other_comm->remains()==0.0) {
XBT_DEBUG("comm %p has been already sent, and is finished, destroy it",other_comm);
other_comm->mbox = nullptr;
}
other_comm->unref();
- static_cast<simgrid::simix::Comm*>(this_synchro)->unref();
+ static_cast<simgrid::kernel::activity::Comm*>(this_synchro)->unref();
}
} else {
/* Prepare a synchro describing us, so that it gets passed to the user-provided filter of other side */
SIMIX_mbox_push(mbox, this_synchro);
} else {
this_synchro->unref();
- simgrid::simix::Comm *other_comm = static_cast<simgrid::simix::Comm*>(other_synchro);
+ simgrid::kernel::activity::Comm *other_comm = static_cast<simgrid::kernel::activity::Comm*>(other_synchro);
other_comm->state = SIMIX_READY;
other_comm->type = SIMIX_COMM_READY;
}
/* Setup communication synchro */
- simgrid::simix::Comm *other_comm = static_cast<simgrid::simix::Comm*>(other_synchro);
+ simgrid::kernel::activity::Comm *other_comm = static_cast<simgrid::kernel::activity::Comm*>(other_synchro);
other_comm->dst_proc = dst_proc;
other_comm->dst_buff = dst_buff;
other_comm->dst_buff_size = dst_buff_size;
int tag, int (*match_fun)(void *, void *, smx_synchro_t), void *data)
{
XBT_DEBUG("iprobe from %p %p", mbox, &mbox->comm_queue);
- simgrid::simix::Comm* this_comm;
+ simgrid::kernel::activity::Comm* this_comm;
int smx_type;
if(type == 1){
- this_comm = new simgrid::simix::Comm(SIMIX_COMM_SEND);
+ this_comm = new simgrid::kernel::activity::Comm(SIMIX_COMM_SEND);
smx_type = SIMIX_COMM_RECEIVE;
} else{
- this_comm = new simgrid::simix::Comm(SIMIX_COMM_RECEIVE);
+ this_comm = new simgrid::kernel::activity::Comm(SIMIX_COMM_RECEIVE);
smx_type = SIMIX_COMM_SEND;
}
smx_synchro_t other_synchro=nullptr;
if (timeout == -1)
THROW_IMPOSSIBLE;
- simgrid::simix::Comm *comm = static_cast<simgrid::simix::Comm*>(synchro);
+ simgrid::kernel::activity::Comm *comm = static_cast<simgrid::kernel::activity::Comm*>(synchro);
if (comm->src_proc == simcall->issuer)
comm->state = SIMIX_SRC_TIMEOUT;
else
surf_action_t sleep = surf_host_sleep(simcall->issuer->host, timeout);
sleep->setData(synchro);
- simgrid::simix::Comm *comm = static_cast<simgrid::simix::Comm*>(synchro);
+ simgrid::kernel::activity::Comm *comm = static_cast<simgrid::kernel::activity::Comm*>(synchro);
if (simcall->issuer == comm->src_proc)
comm->src_timeout = sleep;
else
void simcall_HANDLER_comm_test(smx_simcall_t simcall, smx_synchro_t synchro)
{
- simgrid::simix::Comm *comm = static_cast<simgrid::simix::Comm*>(synchro);
+ simgrid::kernel::activity::Comm *comm = static_cast<simgrid::kernel::activity::Comm*>(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::simix::Synchro* comms[], size_t count)
+ smx_simcall_t simcall, simgrid::kernel::activity::Synchro* 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::simix::Synchro* synchro = comms[idx];
+ simgrid::kernel::activity::Synchro* 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::simix::Synchro* synchro = comms[i];
+ simgrid::kernel::activity::Synchro* synchro = comms[i];
if (synchro->state != SIMIX_WAITING && synchro->state != SIMIX_RUNNING) {
simcall_comm_testany__set__result(simcall, i);
synchro->simcalls.push_back(simcall);
*/
static inline void SIMIX_comm_start(smx_synchro_t synchro)
{
- simgrid::simix::Comm *comm = static_cast<simgrid::simix::Comm*>(synchro);
+ simgrid::kernel::activity::Comm *comm = static_cast<simgrid::kernel::activity::Comm*>(synchro);
/* If both the sender and the receiver are already there, start the communication */
if (synchro->state == SIMIX_READY) {
*/
void SIMIX_comm_finish(smx_synchro_t synchro)
{
- simgrid::simix::Comm *comm = static_cast<simgrid::simix::Comm*>(synchro);
+ simgrid::kernel::activity::Comm *comm = static_cast<simgrid::kernel::activity::Comm*>(synchro);
unsigned int destroy_count = 0;
while (!synchro->simcalls.empty()) {
}
while (destroy_count-- > 0)
- static_cast<simgrid::simix::Comm*>(synchro)->unref();
+ static_cast<simgrid::kernel::activity::Comm*>(synchro)->unref();
}
/******************************************************************************/
void SIMIX_comm_copy_pointer_callback(smx_synchro_t synchro, void* buff, size_t buff_size)
{
- simgrid::simix::Comm *comm = static_cast<simgrid::simix::Comm*>(synchro);
+ simgrid::kernel::activity::Comm *comm = static_cast<simgrid::kernel::activity::Comm*>(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_synchro_t synchro, void* buff, size_t buff_size)
{
- simgrid::simix::Comm *comm = static_cast<simgrid::simix::Comm*>(synchro);
+ simgrid::kernel::activity::Comm *comm = static_cast<simgrid::kernel::activity::Comm*>(synchro);
XBT_DEBUG("Copy the data over");
memcpy(comm->dst_buff, buff, buff_size);
*/
void SIMIX_comm_copy_data(smx_synchro_t synchro)
{
- simgrid::simix::Comm *comm = static_cast<simgrid::simix::Comm*>(synchro);
+ simgrid::kernel::activity::Comm *comm = static_cast<simgrid::kernel::activity::Comm*>(synchro);
size_t buff_size = comm->src_buff_size;
/* If there is no data to copy then return */
/* cancel non-blocking communications */
smx_synchro_t synchro = static_cast<smx_synchro_t>(xbt_fifo_pop(process->comms));
while (synchro != nullptr) {
- simgrid::simix::Comm *comm = static_cast<simgrid::simix::Comm*>(synchro);
+ simgrid::kernel::activity::Comm *comm = static_cast<simgrid::kernel::activity::Comm*>(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 */
/* destroy the blocking synchro if any */
if (process->waiting_synchro) {
- simgrid::simix::Exec *exec = dynamic_cast<simgrid::simix::Exec*>(process->waiting_synchro);
- simgrid::simix::Comm *comm = dynamic_cast<simgrid::simix::Comm*>(process->waiting_synchro);
- simgrid::simix::Sleep *sleep = dynamic_cast<simgrid::simix::Sleep*>(process->waiting_synchro);
- simgrid::simix::Raw *raw = dynamic_cast<simgrid::simix::Raw*>(process->waiting_synchro);
- simgrid::simix::Io *io = dynamic_cast<simgrid::simix::Io*>(process->waiting_synchro);
+ simgrid::kernel::activity::Exec *exec = dynamic_cast<simgrid::kernel::activity::Exec*>(process->waiting_synchro);
+ simgrid::kernel::activity::Comm *comm = dynamic_cast<simgrid::kernel::activity::Comm*>(process->waiting_synchro);
+ simgrid::kernel::activity::Sleep *sleep = dynamic_cast<simgrid::kernel::activity::Sleep*>(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 (exec != nullptr) {
exec->unref();
/* cancel the blocking synchro if any */
if (process->waiting_synchro) {
- simgrid::simix::Exec *exec = dynamic_cast<simgrid::simix::Exec*>(process->waiting_synchro);
+ simgrid::kernel::activity::Exec *exec = dynamic_cast<simgrid::kernel::activity::Exec*>(process->waiting_synchro);
if (exec != nullptr) {
SIMIX_execution_cancel(process->waiting_synchro);
}
- simgrid::simix::Comm *comm = dynamic_cast<simgrid::simix::Comm*>(process->waiting_synchro);
+ simgrid::kernel::activity::Comm *comm = dynamic_cast<simgrid::kernel::activity::Comm*>(process->waiting_synchro);
if (comm != nullptr) {
xbt_fifo_remove(process->comms, comm);
comm->cancel();
}
- simgrid::simix::Sleep *sleep = dynamic_cast<simgrid::simix::Sleep*>(process->waiting_synchro);
+ simgrid::kernel::activity::Sleep *sleep = dynamic_cast<simgrid::kernel::activity::Sleep*>(process->waiting_synchro);
if (sleep != nullptr) {
SIMIX_process_sleep_destroy(process->waiting_synchro);
if (!xbt_dynar_member(simix_global->process_to_run, &(process)) && process != SIMIX_process_self()) {
}
}
- simgrid::simix::Raw *raw = dynamic_cast<simgrid::simix::Raw*>(process->waiting_synchro);
+ simgrid::kernel::activity::Raw *raw = dynamic_cast<simgrid::kernel::activity::Raw*>(process->waiting_synchro);
if (raw != nullptr) {
SIMIX_synchro_stop_waiting(process, &process->simcall);
}
- simgrid::simix::Io *io = dynamic_cast<simgrid::simix::Io*>(process->waiting_synchro);
+ simgrid::kernel::activity::Io *io = dynamic_cast<simgrid::kernel::activity::Io*>(process->waiting_synchro);
if (io != nullptr) {
SIMIX_io_destroy(process->waiting_synchro);
}
}
static int SIMIX_process_join_finish(smx_process_exit_status_t status, smx_synchro_t synchro){
- simgrid::simix::Sleep *sleep = static_cast<simgrid::simix::Sleep*>(synchro);
+ simgrid::kernel::activity::Sleep *sleep = static_cast<simgrid::kernel::activity::Sleep*>(synchro);
if (sleep->surf_sleep) {
sleep->surf_sleep->cancel();
smx_synchro_t SIMIX_process_join(smx_process_t issuer, smx_process_t process, double timeout)
{
smx_synchro_t res = SIMIX_process_sleep(issuer, timeout);
- static_cast<simgrid::simix::Synchro*>(res)->ref();
+ static_cast<simgrid::kernel::activity::Synchro*>(res)->ref();
SIMIX_process_on_exit(process, (int_f_pvoid_pvoid_t)SIMIX_process_join_finish, res);
return res;
}
if (host->isOff())
THROWF(host_error, 0, "Host %s failed, you cannot call this function", sg_host_get_name(host));
- simgrid::simix::Sleep *synchro = new simgrid::simix::Sleep();
+ simgrid::kernel::activity::Sleep *synchro = new simgrid::kernel::activity::Sleep();
synchro->host = host;
synchro->surf_sleep = surf_host_sleep(host, duration);
synchro->surf_sleep->setData(synchro);
void SIMIX_process_sleep_destroy(smx_synchro_t synchro)
{
XBT_DEBUG("Destroy synchro %p", synchro);
- simgrid::simix::Sleep *sleep = static_cast<simgrid::simix::Sleep*>(synchro);
+ simgrid::kernel::activity::Sleep *sleep = static_cast<simgrid::kernel::activity::Sleep*>(synchro);
if (sleep->surf_sleep) {
sleep->surf_sleep->unref();
{
XBT_IN("(%p, %f)",smx_host,timeout);
- simgrid::simix::Raw *sync = new simgrid::simix::Raw();
+ simgrid::kernel::activity::Raw *sync = new simgrid::kernel::activity::Raw();
sync->sleep = surf_host_sleep(smx_host, timeout);
sync->sleep->setData(sync);
XBT_OUT();
int smpi_mpi_testany(int count, MPI_Request requests[], int *index, MPI_Status * status)
{
- std::vector<simgrid::simix::Synchro*> comms;
+ std::vector<simgrid::kernel::activity::Synchro*> comms;
comms.reserve(count);
int i;
}
if (request->action != nullptr){
- simgrid::simix::Comm *sync_comm = static_cast<simgrid::simix::Comm*>(request->action);
- MPI_Request req = static_cast<MPI_Request>(sync_comm->src_data);
+ simgrid::kernel::activity::Comm *sync_comm = static_cast<simgrid::kernel::activity::Comm*>(request->action);
+ MPI_Request req = static_cast<MPI_Request>(sync_comm->src_data);
*flag = 1;
if(status != MPI_STATUS_IGNORE && (req->flags & PREPARED) == 0) {
status->MPI_SOURCE = smpi_group_rank(smpi_comm_group(comm), req->src);
{
XBT_DEBUG("Copy the data over");
void* tmpbuff=buff;
- simgrid::simix::Comm *comm = dynamic_cast<simgrid::simix::Comm*>(synchro);
+ simgrid::kernel::activity::Comm *comm = dynamic_cast<simgrid::kernel::activity::Comm*>(synchro);
if((smpi_privatize_global_variables) && (static_cast<char*>(buff) >= smpi_start_data_exe)
&& (static_cast<char*>(buff) < smpi_start_data_exe + smpi_size_data_exe )