Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
sanitize a bit the prototype of SIMIX_host_create()
[simgrid.git] / src / simix / smx_host_private.h
1 /* Copyright (c) 2007-2010, 2012-2014. 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 "popping_private.h"
12
13 SG_BEGIN_DECL()
14
15 /** @brief Host datatype from SIMIX POV */
16 typedef struct s_smx_host_priv {
17   xbt_swag_t process_list;
18   xbt_dynar_t auto_restart_processes;
19   xbt_dynar_t boot_processes;
20 } s_smx_host_priv_t;
21
22 void _SIMIX_host_free_process_arg(void *);
23 void SIMIX_host_create(const char *name);
24 void SIMIX_host_destroy(void *host);
25
26 void SIMIX_host_add_auto_restart_process(sg_host_t host,
27                                          const char *name,
28                                          xbt_main_func_t code,
29                                          void *data,
30                                          const char *hostname,
31                                          double kill_time,
32                                          int argc, char **argv,
33                                          xbt_dict_t properties,
34                                          int auto_restart);
35
36 void SIMIX_host_restart_processes(sg_host_t host);
37 void SIMIX_host_autorestart(sg_host_t host);
38 xbt_dict_t SIMIX_host_get_properties(sg_host_t host);
39 int SIMIX_host_get_core(sg_host_t host);
40 xbt_swag_t SIMIX_host_get_process_list(sg_host_t host);
41 double SIMIX_host_get_speed(sg_host_t host);
42 double SIMIX_host_get_available_speed(sg_host_t host);
43 int SIMIX_host_get_state(sg_host_t host);
44 void SIMIX_host_on(sg_host_t host);
45 void SIMIX_host_off(sg_host_t host, smx_process_t issuer);
46 double SIMIX_host_get_current_power_peak(sg_host_t host);
47 double SIMIX_host_get_power_peak_at(sg_host_t host, int pstate_index);
48 int SIMIX_host_get_nb_pstates(sg_host_t host);
49 double SIMIX_host_get_consumed_energy(sg_host_t host);
50 double SIMIX_host_get_wattmin_at(sg_host_t host,int pstate);
51 double SIMIX_host_get_wattmax_at(sg_host_t host,int pstate);
52 void SIMIX_host_set_pstate(sg_host_t host, int pstate_index);
53 int SIMIX_host_get_pstate(sg_host_t host);
54 smx_synchro_t SIMIX_host_execute(const char *name,
55     sg_host_t host, double flops_amount, double priority, double bound, unsigned long affinity_mask);
56 smx_synchro_t SIMIX_host_parallel_execute(const char *name,
57     int host_nb, sg_host_t *host_list,
58     double *flops_amount, double *bytes_amount,
59     double amount, double rate);
60 void SIMIX_host_execution_destroy(smx_synchro_t synchro);
61 void SIMIX_host_execution_cancel(smx_synchro_t synchro);
62 double SIMIX_host_execution_get_remains(smx_synchro_t synchro);
63 e_smx_state_t SIMIX_host_execution_get_state(smx_synchro_t synchro);
64 void SIMIX_host_execution_set_priority(smx_synchro_t synchro, double priority);
65 void SIMIX_host_execution_set_bound(smx_synchro_t synchro, double bound);
66 void SIMIX_host_execution_set_affinity(smx_synchro_t synchro, sg_host_t host, unsigned long mask);
67 xbt_dict_t SIMIX_host_get_mounted_storage_list(sg_host_t host);
68 xbt_dynar_t SIMIX_host_get_attached_storage_list(sg_host_t host);
69
70 void SIMIX_host_execution_suspend(smx_synchro_t synchro);
71 void SIMIX_host_execution_resume(smx_synchro_t synchro);
72
73 void SIMIX_post_host_execute(smx_synchro_t synchro);
74 void SIMIX_set_category(smx_synchro_t synchro, const char *category);
75
76 /* vm related stuff */
77 sg_host_t SIMIX_vm_create(const char *name, sg_host_t ind_phys_host);
78
79 void SIMIX_vm_destroy(sg_host_t ind_vm);
80 // --
81 void SIMIX_vm_resume(sg_host_t ind_vm, smx_process_t issuer);
82
83 void SIMIX_vm_suspend(sg_host_t ind_vm, smx_process_t issuer);
84 // --
85 void SIMIX_vm_save(sg_host_t ind_vm, smx_process_t issuer);
86
87 void SIMIX_vm_restore(sg_host_t ind_vm, smx_process_t issuer);
88 // --
89 void SIMIX_vm_start(sg_host_t ind_vm);
90
91 void SIMIX_vm_shutdown(sg_host_t ind_vm, smx_process_t issuer);
92 // --
93
94 int SIMIX_vm_get_state(sg_host_t ind_vm);
95 // --
96 void SIMIX_vm_migrate(sg_host_t ind_vm, sg_host_t ind_dst_pm);
97
98 void *SIMIX_vm_get_pm(sg_host_t ind_vm);
99
100 void SIMIX_vm_set_bound(sg_host_t ind_vm, double bound);
101
102 void SIMIX_vm_set_affinity(sg_host_t ind_vm, sg_host_t ind_pm, unsigned long mask);
103
104 void SIMIX_vm_migratefrom_resumeto(sg_host_t vm, sg_host_t src_pm, sg_host_t dst_pm);
105
106 void SIMIX_host_get_params(sg_host_t ind_vm, ws_params_t params);
107
108 void SIMIX_host_set_params(sg_host_t ind_vm, ws_params_t params);
109
110 SG_END_DECL()
111
112 #endif
113