X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/bfe04f0649d88e4875c7abef0d47dcbc039027b1..ebbf93ef2f2d1164e90a579d18328a570fd67acb:/include/simgrid/simix.h diff --git a/include/simgrid/simix.h b/include/simgrid/simix.h index bd12391e93..984f1c440a 100644 --- a/include/simgrid/simix.h +++ b/include/simgrid/simix.h @@ -174,6 +174,11 @@ XBT_PUBLIC(int) SIMIX_is_maestro(); /* Initialization and exit */ XBT_PUBLIC(void) SIMIX_global_init(int *argc, char **argv); +/* Set to execute in the maestro + * + * If no maestro code is registered (the default), the main thread + * is assumed to be the maestro. */ +XBT_PUBLIC(void) SIMIX_set_maestro(void (*code)(void*), void* data); XBT_PUBLIC(void) SIMIX_function_register_process_cleanup(void_pfn_smxprocess_t function); XBT_PUBLIC(void) SIMIX_function_register_process_create(smx_creation_func_t function); @@ -210,6 +215,24 @@ XBT_PUBLIC(void) SIMIX_process_set_function(const char* process_host, double process_start_time, double process_kill_time); +/*********************************** Host *************************************/ +/* Functions for running a process in main() + * + * 1. create the maestro process + * 2. attach (create a context and wait for maestro to give control back to you) + * 3. do you process job + * 4. detach (this waits for the simulation to terminate) + */ + +XBT_PUBLIC(void) SIMIX_maestro_create(void (*code)(void*), void* data); +XBT_PUBLIC(smx_process_t) SIMIX_process_attach( + const char* name, + void *data, + const char* hostname, + xbt_dict_t properties, + smx_process_t parent_process); +XBT_PUBLIC(void) SIMIX_process_detach(void); + /*********************************** Host *************************************/ XBT_PUBLIC(sg_host_t) SIMIX_host_self(void); XBT_PUBLIC(const char*) SIMIX_host_self_get_name(void);