Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Fix MC with the class-hierarchification of simgrid::simix::Synchro
[simgrid.git] / src / simix / smx_host_private.h
1 /* Copyright (c) 2007-2010, 2012-2015. 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 <xbt/base.h>
11
12 #include "simgrid/simix.h"
13 #include "popping_private.h"
14
15 #include "src/simix/SynchroExec.hpp"
16
17 SG_BEGIN_DECL()
18
19 /** @brief Host datatype from SIMIX POV */
20 typedef struct s_smx_host_priv {
21   xbt_swag_t process_list;
22   xbt_dynar_t auto_restart_processes;
23   xbt_dynar_t boot_processes;
24 } s_smx_host_priv_t;
25
26 XBT_PRIVATE void _SIMIX_host_free_process_arg(void *);
27 XBT_PRIVATE void SIMIX_host_create(sg_host_t host);
28 XBT_PRIVATE void SIMIX_host_destroy(void *host);
29
30 XBT_PRIVATE void SIMIX_host_add_auto_restart_process(sg_host_t host,
31                                          const char *name,
32                                          xbt_main_func_t code,
33                                          void *data,
34                                          const char *hostname,
35                                          double kill_time,
36                                          int argc, char **argv,
37                                          xbt_dict_t properties,
38                                          int auto_restart);
39
40 XBT_PRIVATE void SIMIX_host_restart_processes(sg_host_t host);
41 XBT_PRIVATE void SIMIX_host_autorestart(sg_host_t host);
42 XBT_PRIVATE smx_synchro_t SIMIX_execution_start(smx_process_t issuer, const char *name,
43     double flops_amount, double priority, double bound, unsigned long affinity_mask);
44 XBT_PRIVATE smx_synchro_t SIMIX_execution_parallel_start(const char *name,
45     int host_nb, sg_host_t *host_list,
46     double *flops_amount, double *bytes_amount,
47     double amount, double rate);
48 XBT_PRIVATE void SIMIX_execution_cancel(smx_synchro_t synchro);
49 XBT_PRIVATE void SIMIX_execution_set_priority(smx_synchro_t synchro, double priority);
50 XBT_PRIVATE void SIMIX_execution_set_bound(smx_synchro_t synchro, double bound);
51 XBT_PRIVATE void SIMIX_execution_set_affinity(smx_synchro_t synchro, sg_host_t host, unsigned long mask);
52
53 XBT_PRIVATE void SIMIX_execution_suspend(smx_synchro_t synchro);
54 XBT_PRIVATE void SIMIX_execution_resume(smx_synchro_t synchro);
55 XBT_PRIVATE void SIMIX_execution_finish(simgrid::simix::Exec *exec);
56
57 XBT_PRIVATE void SIMIX_set_category(smx_synchro_t synchro, const char *category);
58
59 /* vm related stuff */
60 XBT_PRIVATE sg_host_t SIMIX_vm_create(const char *name, sg_host_t ind_phys_host);
61
62 XBT_PRIVATE void SIMIX_vm_destroy(sg_host_t ind_vm);
63 // --
64 XBT_PRIVATE void SIMIX_vm_resume(sg_host_t ind_vm, smx_process_t issuer);
65
66 XBT_PRIVATE void SIMIX_vm_suspend(sg_host_t ind_vm, smx_process_t issuer);
67 // --
68 XBT_PRIVATE void SIMIX_vm_save(sg_host_t ind_vm, smx_process_t issuer);
69
70 XBT_PRIVATE void SIMIX_vm_restore(sg_host_t ind_vm, smx_process_t issuer);
71 // --
72 XBT_PRIVATE void SIMIX_vm_start(sg_host_t ind_vm);
73
74 XBT_PRIVATE void SIMIX_vm_shutdown(sg_host_t ind_vm, smx_process_t issuer);
75 // --
76
77 XBT_PRIVATE e_surf_vm_state_t SIMIX_vm_get_state(sg_host_t ind_vm);
78 // --
79 XBT_PRIVATE void SIMIX_vm_migrate(sg_host_t ind_vm, sg_host_t ind_dst_pm);
80
81 XBT_PRIVATE void *SIMIX_vm_get_pm(sg_host_t ind_vm);
82
83 XBT_PRIVATE void SIMIX_vm_set_bound(sg_host_t ind_vm, double bound);
84
85 XBT_PRIVATE void SIMIX_vm_set_affinity(sg_host_t ind_vm, sg_host_t ind_pm, unsigned long mask);
86
87 XBT_PRIVATE void SIMIX_vm_migratefrom_resumeto(sg_host_t vm, sg_host_t src_pm, sg_host_t dst_pm);
88
89 SG_END_DECL()
90
91 #endif
92