-smx_actor_t SIMIX_process_restart(smx_actor_t process, smx_actor_t issuer) {
- XBT_DEBUG("Restarting process %s on %s", process->cname(), process->host->cname());
-
- //retrieve the arguments of the old process
- //FIXME: Factorize this with SIMIX_host_add_auto_restart_process ?
- simgrid::simix::ProcessArg arg;
- arg.name = process->name;
- arg.code = process->code;
- arg.host = process->host;
- arg.kill_time = SIMIX_timer_get_date(process->kill_timer);
- arg.data = process->data;
- arg.properties = nullptr;
- arg.auto_restart = process->auto_restart;
-
- //kill the old process
- SIMIX_process_kill(process, issuer);
-
- //start the new process
- smx_actor_t actor = simix_global->create_process_function(arg.name.c_str(), std::move(arg.code), arg.data, arg.host,
- arg.properties, nullptr);
- if (arg.kill_time >= 0)
- simcall_process_set_kill_time(actor, arg.kill_time);
- if (arg.auto_restart)
- simcall_process_auto_restart_set(actor, arg.auto_restart);
-
- return actor;
-}
-
-void SIMIX_segment_index_set(smx_actor_t proc, int index){
- proc->segment_index = index;
-}
-