/* Create maestro process and intilialize it */
maestro = xbt_new0(s_smx_process_t, 1);
maestro->pid = simix_process_maxpid++;
/* Create maestro process and intilialize it */
maestro = xbt_new0(s_smx_process_t, 1);
maestro->pid = simix_process_maxpid++;
maestro->name = (char *) "";
maestro->running_ctx = xbt_new(xbt_running_ctx_t, 1);
XBT_RUNNING_CTX_INITIALIZE(maestro->running_ctx);
maestro->context = SIMIX_context_new(NULL, 0, NULL, NULL, maestro);
maestro->simcall.issuer = maestro;
maestro->name = (char *) "";
maestro->running_ctx = xbt_new(xbt_running_ctx_t, 1);
XBT_RUNNING_CTX_INITIALIZE(maestro->running_ctx);
maestro->context = SIMIX_context_new(NULL, 0, NULL, NULL, maestro);
maestro->simcall.issuer = maestro;
- return SIMIX_process_create(process, name, code, data, hostname,
- kill_time, argc, argv, properties, auto_restart);
+ SIMIX_process_create(process, name, code, data, hostname,
+ kill_time, argc, argv, properties, auto_restart,
+ simcall->issuer);
- return SIMIX_host_execute("suspend", process->smx_host, 0.0, 1.0);
+ /* FIXME: computation size is zero. Is it okay that bound is zero ? */
+ return SIMIX_host_execute("suspend", process->smx_host, 0.0, 1.0, 0.0, 0);
THROWF(host_error, 0, "Host %s failed, you cannot call this function",
sg_host_name(host));
}
THROWF(host_error, 0, "Host %s failed, you cannot call this function",
sg_host_name(host));
}
case SURF_ACTION_FAILED:
simcall->issuer->context->iwannadie = 1;
//SMX_EXCEPTION(simcall->issuer, host_error, 0, "Host failed");
case SURF_ACTION_FAILED:
simcall->issuer->context->iwannadie = 1;
//SMX_EXCEPTION(simcall->issuer, host_error, 0, "Host failed");
simcall->issuer->context->iwannadie = 1;
}
simcall_process_sleep__set__result(simcall, state);
simcall->issuer->waiting_action = NULL;
simcall->issuer->context->iwannadie = 1;
}
simcall_process_sleep__set__result(simcall, state);
simcall->issuer->waiting_action = NULL;
- SIMIX_simcall_answer(simcall);
-
+ if (simcall->issuer->suspended) {
+ XBT_DEBUG("Wait! This process is suspended and can't wake up now.");
+ simcall->issuer->suspended = 0;
+ SIMIX_pre_process_suspend(simcall, simcall->issuer);
+ } else {
+ SIMIX_simcall_answer(simcall);
+ }
SIMIX_process_sleep_destroy(action);
}
void SIMIX_process_sleep_destroy(smx_action_t action)
{
XBT_DEBUG("Destroy action %p", action);
SIMIX_process_sleep_destroy(action);
}
void SIMIX_process_sleep_destroy(smx_action_t action)
{
XBT_DEBUG("Destroy action %p", action);
xbt_mallocator_release(simix_global->action_mallocator, action);
}
void SIMIX_process_sleep_suspend(smx_action_t action)
{
xbt_mallocator_release(simix_global->action_mallocator, action);
}
void SIMIX_process_sleep_suspend(smx_action_t action)
{
- surf_workstation_model->resume(action->sleep.surf_sleep);
+ XBT_DEBUG("Action state is %d on process_sleep_resume.", action->state);
+ xbt_assert(action->type == SIMIX_ACTION_SLEEP);
+ surf_action_resume(action->sleep.surf_sleep);