XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_host, simix, "SIMIX hosts");
-static void SIMIX_execution_finish(simgrid::simix::Exec *exec);
-
/**
* \brief Internal function to create a SIMIX host.
* \param name name of the host to create
void SIMIX_host_create(sg_host_t host) // FIXME: braindead prototype. Take sg_host as parameter
{
smx_host_priv_t smx_host = xbt_new0(s_smx_host_priv_t, 1);
- s_smx_process_t proc;
/* Host structure */
+ simgrid::simix::Process proc;
smx_host->process_list = xbt_swag_new(xbt_swag_offset(proc, host_proc_hookup));
/* Update global variables */
for (int i = 0; i < arg->argc; i++)
xbt_free(arg->argv[i]);
xbt_free(arg->argv);
- xbt_free(arg->name);
- xbt_free(arg);
+ delete arg;
}
/**
* \brief Add a process to the list of the processes that the host will restart when it comes back
if (!sg_host_simix(host)->auto_restart_processes) {
sg_host_simix(host)->auto_restart_processes = xbt_dynar_new(sizeof(smx_process_arg_t),_SIMIX_host_free_process_arg);
}
- smx_process_arg_t arg = xbt_new(s_smx_process_arg_t,1);
- arg->name = xbt_strdup(name);
+ smx_process_arg_t arg = new s_smx_process_arg_t();
+ arg->name = name;
arg->code = code;
arg->data = data;
arg->hostname = hostname;
SIMIX_execution_finish(exec);
}
-void SIMIX_execution_suspend(smx_synchro_t synchro)
-{
- synchro->suspend(); // FIXME: USELESS
-}
-
-void SIMIX_execution_resume(smx_synchro_t synchro)
-{
- synchro->resume(); // FIXME: USELESS
-}
-
void SIMIX_execution_finish(simgrid::simix::Exec *exec)
{
xbt_fifo_item_t item;
exec->unref();
}
-
-void SIMIX_post_host_execute(simgrid::simix::Exec *exec)
-{
- if (exec != nullptr && exec->host && /* FIMXE: handle resource failure for parallel tasks too */
- exec->host->isOff()) {
- /* If the host running the synchro failed, notice it. This way, the asking
- * process can be killed if it runs on that host itself */
- exec->state = SIMIX_FAILED;
- } else if (exec->surf_exec->getState() == simgrid::surf::Action::State::failed) {
- /* If the host running the synchro didn't fail, then the synchro was canceled */
- exec->state = SIMIX_CANCELED;
- } else {
- exec->state = SIMIX_DONE;
- }
-
- if (exec != nullptr && exec->surf_exec) {
- exec->surf_exec->unref();
- exec->surf_exec = NULL;
- }
-
- /* If there are simcalls associated with the synchro, then answer them */
- if (xbt_fifo_size(exec->simcalls))
- SIMIX_execution_finish(exec);
-}
-
-
void SIMIX_set_category(smx_synchro_t synchro, const char *category)
{
if (synchro->state != SIMIX_RUNNING) return;