/* */
/* This is somehow the "libc" of SimGrid */
-/* Copyright (c) 2010-2015. The SimGrid Team.
+/* Copyright (c) 2010-2017. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
#include "simgrid/s4u/VirtualMachine.hpp"
#include "simgrid/simix.hpp"
#include "simgrid/simix/blocking_simcall.hpp"
-#include "smx_private.h"
+#include "smx_private.hpp"
#include "src/kernel/activity/CommImpl.hpp"
#include "src/mc/mc_forward.hpp"
#include "src/mc/mc_replay.h"
#include "src/plugins/vm/VirtualMachineImpl.hpp"
-#include "src/simix/smx_host_private.h"
+#include "src/simix/smx_host_private.hpp"
#include "xbt/ex.h"
#include "xbt/functional.hpp"
void simcall_call(smx_actor_t actor)
{
if (actor != simix_global->maestro_process) {
- XBT_DEBUG("Yield actor '%s' on simcall %s (%d)", actor->cname(), SIMIX_simcall_name(actor->simcall.call),
+ XBT_DEBUG("Yield actor '%s' on simcall %s (%d)", actor->getCname(), SIMIX_simcall_name(actor->simcall.call),
(int)actor->simcall.call);
SIMIX_process_yield(actor);
} else {
*/
void simcall_execution_cancel(smx_activity_t execution)
{
- simcall_BODY_execution_cancel(execution);
+ simgrid::simix::kernelImmediate([execution] {
+ XBT_DEBUG("Cancel synchro %p", execution.get());
+ simgrid::kernel::activity::ExecImplPtr exec =
+ boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(execution);
+
+ if (exec->surf_exec)
+ exec->surf_exec->cancel();
+ });
}
/**
{
/* checking for infinite values */
xbt_assert(std::isfinite(priority), "priority is not finite!");
+ simgrid::simix::kernelImmediate([execution, priority] {
- simcall_BODY_execution_set_priority(execution, priority);
+ simgrid::kernel::activity::ExecImplPtr exec =
+ boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(execution);
+ if (exec->surf_exec)
+ exec->surf_exec->setSharingWeight(priority);
+ });
}
/**
*/
void simcall_execution_set_bound(smx_activity_t execution, double bound)
{
- simcall_BODY_execution_set_bound(execution, bound);
+ simgrid::simix::kernelImmediate([execution, bound] {
+ simgrid::kernel::activity::ExecImplPtr exec =
+ boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(execution);
+ if (exec->surf_exec)
+ static_cast<simgrid::surf::CpuAction*>(exec->surf_exec)->setBound(bound);
+ });
}
/**
if (kill_time <= SIMIX_get_clock() || simix_global->kill_process_function == nullptr)
return;
- XBT_DEBUG("Set kill time %f for process %s@%s", kill_time, process->cname(), process->host->getCname());
+ XBT_DEBUG("Set kill time %f for process %s@%s", kill_time, process->getCname(), process->host->getCname());
process->kill_timer = SIMIX_timer_set(kill_time, [process] {
simix_global->kill_process_function(process);
process->kill_timer=nullptr;