#include "mc/mc.h"
#include "smx_private.h"
+#include "src/kernel/activity/CommImpl.hpp"
#include "src/mc/mc_replay.h"
#include "src/plugins/vm/VirtualMachineImpl.hpp"
-#include <xbt/ex.hpp>
-
-#include "src/kernel/activity/SynchroComm.hpp"
+#include "xbt/ex.hpp"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_host, simix, "SIMIX hosts");
Host::Host()
{
- if (!Host::EXTENSION_ID.valid())
+ if (not Host::EXTENSION_ID.valid())
Host::EXTENSION_ID = s4u::Host::extension_create<simix::Host>();
simgrid::simix::ActorImpl act;
arg->properties = properties;
arg->auto_restart = auto_restart;
- if (host->isOff() && !xbt_dict_get_or_null(watched_hosts_lib, host->cname())) {
+ if (host->isOff() && not xbt_dict_get_or_null(watched_hosts_lib, host->cname())) {
xbt_dict_set(watched_hosts_lib, host->cname(), host, nullptr);
XBT_DEBUG("Push host %s to watched_hosts_lib because state == SURF_RESOURCE_OFF", host->cname());
}
double bound){
/* alloc structures and initialize */
- simgrid::kernel::activity::Exec *exec = new simgrid::kernel::activity::Exec(name, issuer->host);
+ simgrid::kernel::activity::ExecImpl* exec = new simgrid::kernel::activity::ExecImpl(name, issuer->host);
/* set surf's action */
- if (!MC_is_active() && !MC_record_replay_is_active()) {
+ 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);
{
/* alloc structures and initialize */
- simgrid::kernel::activity::Exec *exec = new simgrid::kernel::activity::Exec(name, nullptr);
+ simgrid::kernel::activity::ExecImpl* exec = 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 (!MC_is_active() && !MC_record_replay_is_active()) {
+ 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);
if (timeout > 0) {
void SIMIX_execution_cancel(smx_activity_t synchro)
{
XBT_DEBUG("Cancel synchro %p", synchro);
- simgrid::kernel::activity::Exec *exec = static_cast<simgrid::kernel::activity::Exec *>(synchro);
+ simgrid::kernel::activity::ExecImpl* exec = static_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::Exec *exec = static_cast<simgrid::kernel::activity::Exec *>(synchro);
+ simgrid::kernel::activity::ExecImpl* exec = static_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::Exec *exec = static_cast<simgrid::kernel::activity::Exec *>(synchro);
+ simgrid::kernel::activity::ExecImpl* exec = static_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::Exec *exec = static_cast<simgrid::kernel::activity::Exec *>(synchro);
+ simgrid::kernel::activity::ExecImpl* exec = static_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::Exec *exec)
+void SIMIX_execution_finish(simgrid::kernel::activity::ExecImpl* exec)
{
for (smx_simcall_t simcall : exec->simcalls) {
switch (exec->state) {
if (synchro->state != SIMIX_RUNNING)
return;
- simgrid::kernel::activity::Exec *exec = dynamic_cast<simgrid::kernel::activity::Exec *>(synchro);
+ simgrid::kernel::activity::ExecImpl* exec = dynamic_cast<simgrid::kernel::activity::ExecImpl*>(synchro);
if (exec != nullptr) {
exec->surf_exec->setCategory(category);
return;
}
- simgrid::kernel::activity::Comm *comm = dynamic_cast<simgrid::kernel::activity::Comm *>(synchro);
+ simgrid::kernel::activity::CommImpl* comm = dynamic_cast<simgrid::kernel::activity::CommImpl*>(synchro);
if (comm != nullptr) {
comm->surf_comm->setCategory(category);
}