Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
use a typed extension for simix::Host
[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 <functional>
11
12 #include <xbt/base.h>
13 #include <xbt/Extendable.hpp>
14
15 #include "simgrid/simix.h"
16 #include "popping_private.h"
17
18 #include "src/kernel/activity/SynchroExec.hpp"
19
20 SG_BEGIN_DECL()
21
22 /** @brief Host datatype from SIMIX POV */
23 namespace simgrid {
24   namespace simix {
25     class Host {
26     public:
27       static simgrid::xbt::Extension<simgrid::s4u::Host, Host> EXTENSION_ID;
28
29       explicit Host();
30       virtual ~Host();
31
32       xbt_swag_t process_list;
33       xbt_dynar_t auto_restart_processes = nullptr;
34       xbt_dynar_t boot_processes = nullptr;
35     };
36   }
37 }
38 typedef simgrid::simix::Host s_smx_host_priv_t;
39
40 XBT_PRIVATE void _SIMIX_host_free_process_arg(void *);
41 XBT_PRIVATE void SIMIX_host_create(sg_host_t host);
42
43 XBT_PRIVATE void SIMIX_host_add_auto_restart_process(sg_host_t host,
44                                          const char *name,
45                                          std::function<void()> code,
46                                          void *data,
47                                          const char *hostname,
48                                          double kill_time,
49                                          xbt_dict_t properties,
50                                          int auto_restart);
51
52 XBT_PRIVATE void SIMIX_host_restart_processes(sg_host_t host);
53 XBT_PRIVATE void SIMIX_host_autorestart(sg_host_t host);
54 XBT_PRIVATE smx_activity_t SIMIX_execution_start(smx_actor_t issuer, const char *name,
55     double flops_amount, double priority, double bound);
56 XBT_PRIVATE smx_activity_t SIMIX_execution_parallel_start(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 XBT_PRIVATE void SIMIX_execution_cancel(smx_activity_t synchro);
61 XBT_PRIVATE void SIMIX_execution_set_priority(smx_activity_t synchro, double priority);
62 XBT_PRIVATE void SIMIX_execution_set_bound(smx_activity_t synchro, double bound);
63
64 XBT_PRIVATE void SIMIX_execution_finish(simgrid::kernel::activity::Exec *exec);
65
66 XBT_PRIVATE void SIMIX_set_category(smx_activity_t synchro, const char *category);
67
68 /* vm related stuff */
69 XBT_PRIVATE sg_host_t SIMIX_vm_create(const char *name, sg_host_t ind_phys_host);
70
71 XBT_PRIVATE void SIMIX_vm_destroy(sg_host_t ind_vm);
72 // --
73 XBT_PRIVATE void SIMIX_vm_resume(sg_host_t ind_vm, smx_actor_t issuer);
74
75 XBT_PRIVATE void SIMIX_vm_suspend(sg_host_t ind_vm, smx_actor_t issuer);
76 // --
77 XBT_PRIVATE void SIMIX_vm_save(sg_host_t ind_vm, smx_actor_t issuer);
78
79 XBT_PRIVATE void SIMIX_vm_restore(sg_host_t ind_vm, smx_actor_t issuer);
80 // --
81 XBT_PRIVATE void SIMIX_vm_start(sg_host_t ind_vm);
82
83 XBT_PRIVATE void SIMIX_vm_shutdown(sg_host_t ind_vm, smx_actor_t issuer);
84 // --
85
86 XBT_PRIVATE e_surf_vm_state_t SIMIX_vm_get_state(sg_host_t ind_vm);
87 // --
88 XBT_PRIVATE void SIMIX_vm_migrate(sg_host_t ind_vm, sg_host_t ind_dst_pm);
89
90 XBT_PRIVATE void *SIMIX_vm_get_pm(sg_host_t ind_vm);
91
92 XBT_PRIVATE void SIMIX_vm_set_bound(sg_host_t ind_vm, double bound);
93
94 XBT_PRIVATE void SIMIX_vm_migratefrom_resumeto(sg_host_t vm, sg_host_t src_pm, sg_host_t dst_pm);
95
96 SG_END_DECL()
97
98 #endif
99