Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
convert vm_suspend from SMX to S4U
[simgrid.git] / src / simix / libsmx.cpp
index a3bf0a9..dec05d5 100644 (file)
@@ -46,20 +46,6 @@ void simcall_call(smx_actor_t process)
   }
 }
 
-// ***** AS simcalls
-
-/**
- * \ingroup simix_host_management
- * \brief Returns a dict of the properties assigned to a router or AS.
- *
- * \param name The name of the router or AS
- * \return The properties
- */
-xbt_dict_t simcall_asr_get_properties(const char *name)
-{
-  return simcall_BODY_asr_get_properties(name);
-}
-
 /**
  * \ingroup simix_process_management
  * \brief Creates a synchro that executes some computation of an host.
@@ -175,89 +161,6 @@ e_smx_state_t simcall_execution_wait(smx_activity_t execution)
   return (e_smx_state_t) simcall_BODY_execution_wait(execution);
 }
 
-/**
- * \ingroup simix_vm_management
- * \brief Start the given VM to the given physical host
- *
- * \param vm VM
- */
-void simcall_vm_start(sg_host_t vm)
-{
-  simgrid::simix::kernelImmediate(std::bind(SIMIX_vm_start, vm));
-}
-
-/**
- * @brief Function to set the CPU bound of the given SIMIX VM host.
- *
- * @param host the vm host (a sg_host_t)
- * @param bound bound (a double)
- */
-void simcall_vm_set_bound(sg_host_t vm, double bound)
-{
-  simgrid::simix::kernelImmediate(
-      [vm, bound]() { static_cast<simgrid::s4u::VirtualMachine*>(vm)->pimpl_vm_->setBound(bound); });
-}
-
-/**
- * \ingroup simix_vm_management
- * \brief Suspend the given VM
- *
- * \param vm VM
- */
-void simcall_vm_suspend(sg_host_t vm)
-{
-  simcall_BODY_vm_suspend(vm);
-}
-
-/**
- * \ingroup simix_vm_management
- * \brief Resume the given VM
- *
- * \param vm VM
- */
-void simcall_vm_resume(sg_host_t vm)
-{
-  simcall_BODY_vm_resume(vm);
-}
-
-/**
- * \ingroup simix_vm_management
- * \brief Save the given VM
- *
- * \param vm VM
- */
-void simcall_vm_save(sg_host_t vm)
-{
-  simcall_BODY_vm_save(vm);
-}
-
-/**
- * \ingroup simix_vm_management
- * \brief Restore the given VM
- *
- * \param vm VM
- */
-void simcall_vm_restore(sg_host_t vm)
-{
-  simgrid::simix::kernelImmediate([vm]() {
-    if (static_cast<simgrid::s4u::VirtualMachine*>(vm)->pimpl_vm_->getState() != SURF_VM_STATE_SAVED)
-      THROWF(vm_error, 0, "VM(%s) was not saved", vm->name().c_str());
-
-    XBT_DEBUG("restore VM(%s), where %d processes exist", vm->name().c_str(),
-              xbt_swag_size(sg_host_simix(vm)->process_list));
-
-    /* jump to vm_ws_restore() */
-    static_cast<simgrid::s4u::VirtualMachine*>(vm)->pimpl_vm_->restore();
-
-    smx_actor_t smx_process, smx_process_safe;
-    xbt_swag_foreach_safe(smx_process, smx_process_safe, sg_host_simix(vm)->process_list)
-    {
-      XBT_DEBUG("resume %s", smx_process->name.c_str());
-      SIMIX_process_resume(smx_process);
-    }
-  });
-}
-
 /**
  * \ingroup simix_vm_management
  * \brief Shutdown the given VM
@@ -392,8 +295,7 @@ void simcall_process_set_kill_time(smx_actor_t process, double kill_time)
 
   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->name.c_str(), sg_host_get_name(process->host));
+  XBT_DEBUG("Set kill time %f for process %s@%s", kill_time, process->cname(), process->host->cname());
   process->kill_timer = SIMIX_timer_set(kill_time, [=] {
     simix_global->kill_process_function(process);
     process->kill_timer=nullptr;