Logo AND Algorithmique Numérique Distribuée

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