const char *hostname,
double kill_time,
int argc, char **argv,
- xbt_dict_t properties)
+ xbt_dict_t properties,
+ int auto_restart)
{
smx_simcall_t simcall = SIMIX_simcall_mine();
simcall->process_create.argc = argc;
simcall->process_create.argv = argv;
simcall->process_create.properties = properties;
+ simcall->process_create.auto_restart = auto_restart;
SIMIX_simcall_push(simcall->issuer);
}
/**
* \brief Set the kill time of a process.
- *
* \param process a process
* \param kill_time a double
*/
SIMIX_simcall_push(simcall->issuer);
return simcall->process_get_properties.result;
}
+/**
+ * \brief Add an on_exit function
+ * Add an on_exit function which will be executed when the process exits/is killed.
+ */
+XBT_PUBLIC(void) simcall_process_on_exit(smx_process_t process, int_f_pvoid_t fun, void *data) {
+ smx_simcall_t simcall = SIMIX_simcall_mine();
+ simcall->call = SIMCALL_PROCESS_ON_EXIT;
+ simcall->process_on_exit.process = process;
+ simcall->process_on_exit.fun = fun;
+ simcall->process_on_exit.data = data;
+
+ SIMIX_simcall_push(simcall->issuer);
+}
+/**
+ * \brief Sets the process to be auto-restarted or not by SIMIX when its host comes back up.
+ * Will restart the process when the host comes back up if auto_restart is set to 1.
+ */
+
+XBT_PUBLIC(void) simcall_process_auto_restart_set(smx_process_t process, int auto_restart) {
+ smx_simcall_t simcall = SIMIX_simcall_mine();
+
+ simcall->call = SIMCALL_PROCESS_AUTO_RESTART_SET;
+ simcall->process_auto_restart.process = process;
+ simcall->process_auto_restart.auto_restart = auto_restart;
+
+ SIMIX_simcall_push(simcall->issuer);
+}
/** \brief Creates a new sleep SIMIX action.
*
* This function creates a SURF action and allocates the data necessary
smx_mutex_t simcall_mutex_init(void)
{
if(!simix_global) {
- fprintf(stderr,"You must run MSG_global_init or gras_init before using MSG or GRAS\n"); // I would have loved using xbt_die but I can't since it is not initialized yet... :)
+ fprintf(stderr,"You must run MSG_init or gras_init before using MSG or GRAS\n"); // I would have loved using xbt_die but I can't since it is not initialized yet... :)
abort();
}
smx_simcall_t simcall = SIMIX_simcall_mine();
return simcall->sem_get_capacity.result;
}
-size_t simcall_file_read(void* ptr, size_t size, size_t nmemb, smx_file_t stream)
+double simcall_file_read(void* ptr, size_t size, size_t nmemb, smx_file_t stream)
{
smx_simcall_t simcall = SIMIX_simcall_mine();