Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
771b034659752b892549e926820f28441fc75d06
[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 double SIMIX_host_get_current_power_peak(sg_host_t host);
45 double SIMIX_host_get_power_peak_at(sg_host_t host, int pstate_index);
46 int SIMIX_host_get_nb_pstates(sg_host_t host);
47 double SIMIX_host_get_consumed_energy(sg_host_t host);
48 double SIMIX_host_get_wattmin_at(sg_host_t host,int pstate);
49 double SIMIX_host_get_wattmax_at(sg_host_t host,int pstate);
50 void SIMIX_host_set_pstate(sg_host_t host, int pstate_index);
51 int SIMIX_host_get_pstate(sg_host_t host);
52 smx_synchro_t SIMIX_process_execute(smx_process_t issuer, const char *name,
53     double flops_amount, double priority, double bound, unsigned long affinity_mask);
54 smx_synchro_t SIMIX_process_parallel_execute(const char *name,
55     int host_nb, sg_host_t *host_list,
56     double *flops_amount, double *bytes_amount,
57     double amount, double rate);
58 void SIMIX_process_execution_destroy(smx_synchro_t synchro);
59 void SIMIX_process_execution_cancel(smx_synchro_t synchro);
60 double SIMIX_process_execution_get_remains(smx_synchro_t synchro);
61 e_smx_state_t SIMIX_process_execution_get_state(smx_synchro_t synchro);
62 void SIMIX_process_execution_set_priority(smx_synchro_t synchro, double priority);
63 void SIMIX_process_execution_set_bound(smx_synchro_t synchro, double bound);
64 void SIMIX_process_execution_set_affinity(smx_synchro_t synchro, sg_host_t host, unsigned long mask);
65 xbt_dynar_t SIMIX_host_get_attached_storage_list(sg_host_t host);
66
67 void SIMIX_host_execution_suspend(smx_synchro_t synchro);
68 void SIMIX_host_execution_resume(smx_synchro_t synchro);
69
70 void SIMIX_post_host_execute(smx_synchro_t synchro);
71 void SIMIX_set_category(smx_synchro_t synchro, const char *category);
72
73 /* vm related stuff */
74 sg_host_t SIMIX_vm_create(const char *name, sg_host_t ind_phys_host);
75
76 void SIMIX_vm_destroy(sg_host_t ind_vm);
77 // --
78 void SIMIX_vm_resume(sg_host_t ind_vm, smx_process_t issuer);
79
80 void SIMIX_vm_suspend(sg_host_t ind_vm, smx_process_t issuer);
81 // --
82 void SIMIX_vm_save(sg_host_t ind_vm, smx_process_t issuer);
83
84 void SIMIX_vm_restore(sg_host_t ind_vm, smx_process_t issuer);
85 // --
86 void SIMIX_vm_start(sg_host_t ind_vm);
87
88 void SIMIX_vm_shutdown(sg_host_t ind_vm, smx_process_t issuer);
89 // --
90
91 int SIMIX_vm_get_state(sg_host_t ind_vm);
92 // --
93 void SIMIX_vm_migrate(sg_host_t ind_vm, sg_host_t ind_dst_pm);
94
95 void *SIMIX_vm_get_pm(sg_host_t ind_vm);
96
97 void SIMIX_vm_set_bound(sg_host_t ind_vm, double bound);
98
99 void SIMIX_vm_set_affinity(sg_host_t ind_vm, sg_host_t ind_pm, unsigned long mask);
100
101 void SIMIX_vm_migratefrom_resumeto(sg_host_t vm, sg_host_t src_pm, sg_host_t dst_pm);
102
103 void SIMIX_host_get_params(sg_host_t ind_vm, vm_params_t params);
104
105 void SIMIX_host_set_params(sg_host_t ind_vm, vm_params_t params);
106
107 SG_END_DECL()
108
109 #endif
110