Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Change simcall functions
[simgrid.git] / src / simix / smx_host_private.h
1 /* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #ifndef _SIMIX_HOST_PRIVATE_H
8 #define _SIMIX_HOST_PRIVATE_H
9
10 #include "simgrid/simix.h"
11 #include "smx_smurf_private.h"
12
13 /** @brief Host datatype */
14 typedef struct s_smx_host {
15   char *name;              /**< @brief host name if any */
16   void *host;                   /* SURF modeling */
17   xbt_swag_t process_list;
18   xbt_dynar_t auto_restart_processes;
19   void *data;              /**< @brief user data */
20 } s_smx_host_t;
21
22 smx_host_t SIMIX_host_create(const char *name, void *workstation, void *data);
23 void SIMIX_host_destroy(void *host);
24
25 void SIMIX_host_add_auto_restart_process(smx_host_t host,
26                                          const char *name,
27                                          xbt_main_func_t code,
28                                          void *data,
29                                          const char *hostname,
30                                          double kill_time,
31                                          int argc, char **argv,
32                                          xbt_dict_t properties,
33                                          int auto_restart);
34
35 void SIMIX_host_restart_processes(smx_host_t host);
36 void SIMIX_host_autorestart(smx_host_t host);
37 xbt_dict_t SIMIX_host_get_properties(smx_host_t host);
38 double SIMIX_host_get_speed(smx_host_t host);
39 double SIMIX_host_get_available_speed(smx_host_t host);
40 int SIMIX_host_get_state(smx_host_t host);
41 smx_action_t SIMIX_host_execute(const char *name,
42     smx_host_t host, double computation_amount, double priority);
43 smx_action_t SIMIX_host_parallel_execute(const char *name,
44     int host_nb, smx_host_t *host_list,
45     double *computation_amount, double *communication_amount,
46     double amount, double rate);
47 void SIMIX_host_execution_destroy(smx_action_t action);
48 void SIMIX_host_execution_cancel(smx_action_t action);
49 double SIMIX_host_execution_get_remains(smx_action_t action);
50 e_smx_state_t SIMIX_host_execution_get_state(smx_action_t action);
51 void SIMIX_host_execution_set_priority(smx_action_t action, double priority);
52 void SIMIX_pre_host_execution_wait(smx_simcall_t simcall, smx_action_t action);
53
54 // pre prototypes
55 smx_host_t SIMIX_pre_host_get_by_name(smx_simcall_t, const char*);
56 const char* SIMIX_pre_host_self_get_name(smx_simcall_t);
57 const char* SIMIX_pre_host_get_name(smx_simcall_t, smx_host_t);
58 xbt_dict_t SIMIX_pre_host_get_properties(smx_simcall_t, smx_host_t);
59 double SIMIX_pre_host_get_speed(smx_simcall_t, smx_host_t);
60 double SIMIX_pre_host_get_available_speed(smx_simcall_t, smx_host_t);
61 int SIMIX_pre_host_get_state(smx_simcall_t, smx_host_t);
62 void* SIMIX_pre_host_self_get_data(smx_simcall_t);
63 void* SIMIX_pre_host_get_data(smx_simcall_t, smx_host_t);
64 void SIMIX_pre_host_set_data(smx_simcall_t, smx_host_t, void*);
65 smx_action_t SIMIX_pre_host_execute(smx_simcall_t, const char*, smx_host_t, double, double);
66 smx_action_t SIMIX_pre_host_parallel_execute(smx_simcall_t, const char*, int, smx_host_t*,
67                                              double*, double*, double, double);
68 void SIMIX_pre_host_execution_destroy(smx_simcall_t, smx_action_t);
69 void SIMIX_pre_host_execution_cancel(smx_simcall_t, smx_action_t);
70 double SIMIX_pre_host_execution_get_remains(smx_simcall_t, smx_action_t);
71 e_smx_state_t SIMIX_pre_host_execution_get_state(smx_simcall_t, smx_action_t);
72 void SIMIX_pre_host_execution_set_priority(smx_simcall_t, smx_action_t, double);
73
74 void SIMIX_host_execution_suspend(smx_action_t action);
75 void SIMIX_host_execution_resume(smx_action_t action);
76
77 void SIMIX_post_host_execute(smx_action_t action);
78
79 #ifdef HAVE_TRACING
80 void SIMIX_pre_set_category(smx_simcall_t simcall, smx_action_t action,
81                             const char *category);
82 void SIMIX_set_category(smx_action_t action, const char *category);
83 #endif
84
85 #endif
86