#include "xbt/function_types.h"
#include "xbt/parmap.h"
#include "xbt/swag.h"
-#include "simgrid/platf.h"
#include "simgrid/datatypes.h"
#include "simgrid/host.h"
/* 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);
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);
XBT_PUBLIC(int) SIMIX_process_count(void);
XBT_PUBLIC(smx_process_t) SIMIX_process_self(void);
XBT_PUBLIC(const char*) SIMIX_process_self_get_name(void);
-XBT_PUBLIC(void) SIMIX_process_self_set_data(smx_process_t self, void *data);
-XBT_PUBLIC(void*) SIMIX_process_self_get_data(smx_process_t self);
+XBT_PUBLIC(void) SIMIX_process_self_set_data(void *data);
+XBT_PUBLIC(void*) SIMIX_process_self_get_data(void);
XBT_PUBLIC(smx_context_t) SIMIX_process_get_context(smx_process_t);
XBT_PUBLIC(void) SIMIX_process_set_context(smx_process_t p,smx_context_t c);
XBT_PUBLIC(int) SIMIX_process_has_pending_comms(smx_process_t process);
/************************** Synchro simcalls **********************************/
XBT_PUBLIC(smx_mutex_t) simcall_mutex_init(void);
-XBT_PUBLIC(void) simcall_mutex_destroy(smx_mutex_t mutex);
+XBT_PUBLIC(void) SIMIX_mutex_destroy(smx_mutex_t mutex);
XBT_PUBLIC(void) simcall_mutex_lock(smx_mutex_t mutex);
XBT_PUBLIC(int) simcall_mutex_trylock(smx_mutex_t mutex);
XBT_PUBLIC(void) simcall_mutex_unlock(smx_mutex_t mutex);
XBT_PUBLIC(smx_cond_t) simcall_cond_init(void);
-XBT_PUBLIC(void) simcall_cond_destroy(smx_cond_t cond);
+XBT_PUBLIC(void) SIMIX_cond_destroy(smx_cond_t cond);
XBT_PUBLIC(void) simcall_cond_signal(smx_cond_t cond);
XBT_PUBLIC(void) simcall_cond_wait(smx_cond_t cond, smx_mutex_t mutex);
XBT_PUBLIC(void) simcall_cond_wait_timeout(smx_cond_t cond,
XBT_PUBLIC(void) simcall_cond_broadcast(smx_cond_t cond);
XBT_PUBLIC(smx_sem_t) simcall_sem_init(int capacity);
-XBT_PUBLIC(void) simcall_sem_destroy(smx_sem_t sem);
+XBT_PUBLIC(void) SIMIX_sem_destroy(smx_sem_t sem);
XBT_PUBLIC(void) simcall_sem_release(smx_sem_t sem);
XBT_PUBLIC(int) simcall_sem_would_block(smx_sem_t sem);
XBT_PUBLIC(void) simcall_sem_acquire(smx_sem_t sem);