1 /* Copyright (c) 2007-2010, 2012-2014. The SimGrid Team.
2 * All rights reserved. */
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. */
7 #ifndef _SIMIX_HOST_PRIVATE_H
8 #define _SIMIX_HOST_PRIVATE_H
10 #include "simgrid/simix.h"
11 #include "popping_private.h"
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;
22 void _SIMIX_host_free_process_arg(void *);
23 void SIMIX_host_create(const char *name);
24 void SIMIX_host_destroy(void *host);
26 void SIMIX_host_add_auto_restart_process(sg_host_t host,
32 int argc, char **argv,
33 xbt_dict_t properties,
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_process_execute(smx_process_t issuer, const char *name,
55 double flops_amount, double priority, double bound, unsigned long affinity_mask);
56 smx_synchro_t SIMIX_process_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_process_execution_destroy(smx_synchro_t synchro);
61 void SIMIX_process_execution_cancel(smx_synchro_t synchro);
62 double SIMIX_process_execution_get_remains(smx_synchro_t synchro);
63 e_smx_state_t SIMIX_process_execution_get_state(smx_synchro_t synchro);
64 void SIMIX_process_execution_set_priority(smx_synchro_t synchro, double priority);
65 void SIMIX_process_execution_set_bound(smx_synchro_t synchro, double bound);
66 void SIMIX_process_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);
70 void SIMIX_host_execution_suspend(smx_synchro_t synchro);
71 void SIMIX_host_execution_resume(smx_synchro_t synchro);
73 void SIMIX_post_host_execute(smx_synchro_t synchro);
74 void SIMIX_set_category(smx_synchro_t synchro, const char *category);
76 /* vm related stuff */
77 sg_host_t SIMIX_vm_create(const char *name, sg_host_t ind_phys_host);
79 void SIMIX_vm_destroy(sg_host_t ind_vm);
81 void SIMIX_vm_resume(sg_host_t ind_vm, smx_process_t issuer);
83 void SIMIX_vm_suspend(sg_host_t ind_vm, smx_process_t issuer);
85 void SIMIX_vm_save(sg_host_t ind_vm, smx_process_t issuer);
87 void SIMIX_vm_restore(sg_host_t ind_vm, smx_process_t issuer);
89 void SIMIX_vm_start(sg_host_t ind_vm);
91 void SIMIX_vm_shutdown(sg_host_t ind_vm, smx_process_t issuer);
94 int SIMIX_vm_get_state(sg_host_t ind_vm);
96 void SIMIX_vm_migrate(sg_host_t ind_vm, sg_host_t ind_dst_pm);
98 void *SIMIX_vm_get_pm(sg_host_t ind_vm);
100 void SIMIX_vm_set_bound(sg_host_t ind_vm, double bound);
102 void SIMIX_vm_set_affinity(sg_host_t ind_vm, sg_host_t ind_pm, unsigned long mask);
104 void SIMIX_vm_migratefrom_resumeto(sg_host_t vm, sg_host_t src_pm, sg_host_t dst_pm);
106 void SIMIX_host_get_params(sg_host_t ind_vm, vm_params_t params);
108 void SIMIX_host_set_params(sg_host_t ind_vm, vm_params_t params);