XBT_PUBLIC(void) sg_host_user_set(sg_host_t host, void* userdata);
XBT_PUBLIC(void) sg_host_user_destroy(sg_host_t host);
-// ========== Simix layer =============
-XBT_PUBLIC(smx_host_priv_t) sg_host_simix(sg_host_t host);
-
// ========= storage related functions ============
XBT_PUBLIC(xbt_dict_t) sg_host_get_mounted_storage_list(sg_host_t host);
XBT_PUBLIC(xbt_dynar_t) sg_host_get_attached_storage_list(sg_host_t host);
host->extension_set(USER_HOST_LEVEL, nullptr);
}
-// ========== Simix layer =============
-smx_host_priv_t sg_host_simix(sg_host_t host){
- return host->extension<simgrid::simix::Host>();
-}
-
// ========= storage related functions ============
xbt_dict_t sg_host_get_mounted_storage_list(sg_host_t host){
return host->pimpl_->getMountedStorageList();
XBT_DEBUG("%p should not be run anymore",process);
simix_global->process_list.erase(process->pid);
if (process->host)
- xbt_swag_remove(process, sg_host_simix(process->host)->process_list);
+ xbt_swag_remove(process, process->host->extension<simgrid::simix::Host>()->process_list);
xbt_swag_insert(process, simix_global->process_to_destroy);
process->context->iwannadie = 0;
process->properties = properties;
/* Add the process to it's host process list */
- xbt_swag_insert(process, sg_host_simix(host)->process_list);
+ xbt_swag_insert(process, host->extension<simgrid::simix::Host>()->process_list);
XBT_DEBUG("Start context '%s'", process->name.c_str());
process->properties = properties;
/* Add the process to it's host process list */
- xbt_swag_insert(process, sg_host_simix(host)->process_list);
+ xbt_swag_insert(process, host->extension<simgrid::simix::Host>()->process_list);
/* Now insert it in the global process list and in the process to run list */
simix_global->process_list[process->pid] = process;
void SIMIX_process_change_host(smx_actor_t process, sg_host_t dest)
{
xbt_assert((process != nullptr), "Invalid parameters");
- xbt_swag_remove(process, sg_host_simix(process->host)->process_list);
+ xbt_swag_remove(process, process->host->extension<simgrid::simix::Host>()->process_list);
process->host = dest;
- xbt_swag_insert(process, sg_host_simix(dest)->process_list);
+ xbt_swag_insert(process, dest->extension<simgrid::simix::Host>()->process_list);
}
/** @brief Stop the host if it is on */
void SIMIX_host_off(sg_host_t h, smx_actor_t issuer)
{
- smx_host_priv_t host = sg_host_simix(h);
+ smx_host_priv_t host = h->extension<simgrid::simix::Host>();
xbt_assert((host != nullptr), "Invalid parameters");
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());
}
- sg_host_simix(host)->auto_restart_processes.push_back(arg);
+ host->extension<simgrid::simix::Host>()->auto_restart_processes.push_back(arg);
}
/** @brief Restart the list of processes that have been registered to the host */
void SIMIX_host_autorestart(sg_host_t host)
{
- std::vector<simgrid::simix::ProcessArg*> process_list = sg_host_simix(host)->auto_restart_processes;
- if (process_list.empty())
- return;
+ std::vector<simgrid::simix::ProcessArg*> process_list =
+ host->extension<simgrid::simix::Host>()->auto_restart_processes;
for (auto arg : process_list) {
-
XBT_DEBUG("Restarting Process %s@%s right now", arg->name.c_str(), arg->host->cname());
simix_global->create_process_function(arg->name.c_str(), arg->code, nullptr, arg->host, arg->kill_time,
arg->properties, arg->auto_restart, nullptr);
arg->kill_time = kill_time;
arg->properties = current_property_set;
- sg_host_simix(host)->boot_processes.push_back(arg);
+ host->extension<simgrid::simix::Host>()->boot_processes.push_back(arg);
if (start_time > SIMIX_get_clock()) {