{
xbt_assert((task != nullptr), "Cannot cancel a nullptr task");
- if (task->simdata->compute) {
- simcall_execution_cancel(task->simdata->compute);
- }
- else if (task->simdata->comm) {
- simdata_task_t simdata = task->simdata;
+ simdata_task_t simdata = task->simdata;
+ if (simdata->compute) {
+ simcall_execution_cancel(simdata->compute);
+ MSG_host_del_task(MSG_process_get_host(MSG_process_self()), task);
+ } else if (simdata->comm) {
simcall_comm_cancel(simdata->comm);
- simdata->setNotUsed();
}
+ simdata->setNotUsed();
return MSG_OK;
}
boost::dynamic_pointer_cast<simgrid::kernel::activity::IoImpl>(process->waiting_synchro);
if (exec != nullptr) {
- /* Nothing to do */
+ if (exec->surf_exec) {
+ exec->surf_exec->cancel();
+ exec->surf_exec->unref();
+ exec->surf_exec = nullptr;
+ }
} else if (comm != nullptr) {
process->comms.remove(process->waiting_synchro);
comm->cancel();
*/
void simcall_execution_cancel(smx_activity_t 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);
-
+ simgrid::kernel::activity::ExecImplPtr exec =
+ boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(execution);
+ if (not exec->surf_exec)
+ return;
+ simgrid::simix::kernelImmediate([exec] {
+ XBT_DEBUG("Cancel synchro %p", exec.get());
if (exec->surf_exec)
exec->surf_exec->cancel();
});
test =6;
if (xbt_dynar_search_or_negative(tests, &test)!=-1){
- MSG_process_set_data_cleanup(NULL); /* FIXME: we are leaking here, but removing this line changes the test output */
XBT_INFO("Test 6: Turn on Jupiter, assign a VM on Jupiter, launch a process inside the VM, and turn off the node");
// Create VM0
> [Tremblay:test_launcher:(1) 10.000000] [msg_test/INFO] Turn Jupiter off
> [Tremblay:test_launcher:(1) 10.000000] [msg_test/INFO] Shutdown vm0
> [Tremblay:test_launcher:(1) 10.000000] [msg_test/INFO] Destroy vm0
-> [10.000000] [surf_vm/WARNING] Dirty page tracking: 1 pending task(s) on a destroyed VM (first one is (name hidden)).
-> If you don't understand why your task was not properly removed, please report that bug.
-> This is a known bug if you turned the host off during the VM execution.
-> Please remind us of that problem at some point: our code base is not ready to fix this harmless issue in 2016, sorry.
> [Tremblay:test_launcher:(1) 10.000000] [msg_test/INFO] Test 6 is also weird: when the node Jupiter is turned off once again, the VM and its daemon are not killed. However, the issue regarding the shutdown of hosted VMs can be seen a feature not a bug ;)
> [Tremblay:test_launcher:(1) 10.000000] [msg_test/INFO] Test done. See you!
> [10.000000] [msg_test/INFO] Simulation time 10
-> [10.000000] [surf_maxmin/WARNING] Probable bug: a simgrid::surf::CpuCas01Action variable (#13) not removed before the LMM system destruction.
-> [10.000000] [surf_maxmin/WARNING] Probable bug: a simgrid::surf::CpuCas01Action variable (#2) not removed before the LMM system destruction.
-
-p The previous test suffers of bug https://github.com/simgrid/simgrid/issues/120
-p but the code is still not clean enough to really solve it.