Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix commit f48cc395ebecc84d865ab551a672d2a2358624e5
[simgrid.git] / include / simgrid / simix.h
index 4464505..f541a1b 100644 (file)
@@ -93,6 +93,7 @@ typedef void (*smx_creation_func_t) ( /* process */ smx_process_t*,
                                       /* code */ xbt_main_func_t,
                                       /* userdata */ void*,
                                       /* hostname */ const char*,
+                                      /* kill_time */ double,
                                       /* argc */ int,
                                       /* argv */ char**,
                                       /* props */ xbt_dict_t);
@@ -163,7 +164,7 @@ typedef struct s_smx_context {
   void *data;   /* Here SIMIX stores the smx_process_t containing the context */
   char **argv;
   int argc;
-  int iwannadie:1;
+  unsigned iwannadie:1;
 } s_smx_ctx_base_t;
 
 /* methods of this class */
@@ -239,6 +240,8 @@ XBT_PUBLIC(const char*) SIMIX_host_self_get_name(void);
 XBT_PUBLIC(const char*) SIMIX_host_get_name(smx_host_t host); /* FIXME: make private: only the name of SIMIX_host_self() should be public without request */
 XBT_PUBLIC(void) SIMIX_host_self_set_data(void *data);
 XBT_PUBLIC(void*) SIMIX_host_self_get_data(void);
+XBT_PUBLIC(void*) SIMIX_host_get_data(smx_host_t host);
+XBT_PUBLIC(void) SIMIX_host_set_data(smx_host_t host, void *data);
 
 /********************************* Process ************************************/
 XBT_PUBLIC(int) SIMIX_process_count(void);
@@ -249,6 +252,8 @@ XBT_PUBLIC(void*) SIMIX_process_self_get_data(smx_process_t self);
 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);
+XBT_PUBLIC(void) SIMIX_process_on_exit_runall(smx_process_t process);
+XBT_PUBLIC(void) SIMIX_process_on_exit(smx_process_t process, int_f_pvoid_t fun, void *data);
 
 /****************************** Communication *********************************/
 XBT_PUBLIC(void) SIMIX_comm_set_copy_data_callback(void (*callback) (smx_action_t, void*, size_t));
@@ -307,6 +312,7 @@ XBT_PUBLIC(void) simcall_process_create(smx_process_t *process,
                                           xbt_main_func_t code,
                                           void *data,
                                           const char *hostname,
+                                          double kill_time,
                                           int argc, char **argv,
                                           xbt_dict_t properties);
 
@@ -316,7 +322,7 @@ XBT_PUBLIC(void) simcall_process_killall(void);
 /* Process handling */
 XBT_PUBLIC(void) simcall_process_cleanup(smx_process_t process);
 XBT_PUBLIC(void) simcall_process_change_host(smx_process_t process,
-                                              smx_host_t dest);
+                 smx_host_t dest);
 XBT_PUBLIC(void) simcall_process_suspend(smx_process_t process);
 XBT_PUBLIC(void) simcall_process_resume(smx_process_t process);
 
@@ -328,6 +334,7 @@ XBT_PUBLIC(smx_host_t) simcall_process_get_host(smx_process_t process);
 XBT_PUBLIC(const char *) simcall_process_get_name(smx_process_t process);
 XBT_PUBLIC(int) simcall_process_is_suspended(smx_process_t process);
 XBT_PUBLIC(xbt_dict_t) simcall_process_get_properties(smx_process_t host);
+XBT_PUBLIC(void) simcall_process_set_kill_time(smx_process_t process, double kill_time);
 
 /* Sleep control */
 XBT_PUBLIC(e_smx_state_t) simcall_process_sleep(double duration);
@@ -424,11 +431,11 @@ XBT_PUBLIC(void) simcall_sem_acquire_timeout(smx_sem_t sem,
 XBT_PUBLIC(unsigned int) simcall_sem_acquire_any(xbt_dynar_t sems);
 XBT_PUBLIC(int) simcall_sem_get_capacity(smx_sem_t sem);
 
-XBT_PUBLIC(size_t) simcall_file_read(const char* storage, void* ptr, size_t size, size_t nmemb, smx_file_t stream);
-XBT_PUBLIC(size_t) simcall_file_write(const char* storage, const void* ptr, size_t size, size_t nmemb, smx_file_t stream);
+XBT_PUBLIC(double) simcall_file_read(void* ptr, size_t size, size_t nmemb, smx_file_t stream);
+XBT_PUBLIC(size_t) simcall_file_write(const void* ptr, size_t size, size_t nmemb, smx_file_t stream);
 XBT_PUBLIC(smx_file_t) simcall_file_open(const char* storage, const char* path, const char* mode);
-XBT_PUBLIC(int) simcall_file_close(const char* storage, smx_file_t fp);
-XBT_PUBLIC(int) simcall_file_stat(const char* storage, smx_file_t fd, s_file_stat_t *buf);
+XBT_PUBLIC(int) simcall_file_close(smx_file_t fp);
+XBT_PUBLIC(int) simcall_file_stat(smx_file_t fd, s_file_stat_t *buf);
 
 SG_END_DECL()
 #endif                          /* _SIMIX_SIMIX_H */