Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
794df1984c3e43c262e2bbb8c9b1edd87bf8990f
[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 <vector>
11 #include <functional>
12
13 #include <xbt/base.h>
14 #include <xbt/Extendable.hpp>
15
16 #include "simgrid/simix.h"
17 #include "popping_private.h"
18
19 #include "simgrid/s4u/VirtualMachine.hpp"
20 #include "src/kernel/activity/SynchroExec.hpp"
21
22 /** @brief Host datatype from SIMIX POV */
23 namespace simgrid {
24   namespace simix {
25     class ProcessArg;
26
27     class Host {
28     public:
29       static simgrid::xbt::Extension<simgrid::s4u::Host, Host> EXTENSION_ID;
30
31       explicit Host();
32       virtual ~Host();
33
34       xbt_swag_t process_list;
35       std::vector<ProcessArg*> auto_restart_processes;
36       std::vector<ProcessArg*> boot_processes;
37
38       void turnOn();
39     };
40   }
41 }
42 typedef simgrid::simix::Host s_smx_host_priv_t;
43
44 SG_BEGIN_DECL()
45 XBT_PRIVATE void _SIMIX_host_free_process_arg(void *);
46
47 XBT_PRIVATE void SIMIX_host_add_auto_restart_process(sg_host_t host,
48                                          const char *name,
49                                          std::function<void()> code,
50                                          void *data,
51                                          double kill_time,
52                                          xbt_dict_t properties,
53                                          int auto_restart);
54
55 XBT_PRIVATE void SIMIX_host_autorestart(sg_host_t host);
56 XBT_PRIVATE smx_activity_t SIMIX_execution_start(smx_actor_t issuer, const char *name,
57     double flops_amount, double priority, double bound);
58 XBT_PRIVATE smx_activity_t SIMIX_execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list,
59                                                           double* flops_amount, double* bytes_amount, double amount,
60                                                           double rate, double timeout);
61 XBT_PRIVATE void SIMIX_execution_cancel(smx_activity_t synchro);
62 XBT_PRIVATE void SIMIX_execution_set_priority(smx_activity_t synchro, double priority);
63 XBT_PRIVATE void SIMIX_execution_set_bound(smx_activity_t synchro, double bound);
64
65 XBT_PRIVATE void SIMIX_execution_finish(simgrid::kernel::activity::Exec *exec);
66
67 XBT_PRIVATE void SIMIX_set_category(smx_activity_t synchro, const char *category);
68
69 /* vm related stuff */
70 XBT_PRIVATE void SIMIX_vm_resume(sg_host_t ind_vm);
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_start(sg_host_t ind_vm);
77
78 XBT_PRIVATE void SIMIX_vm_shutdown(sg_host_t ind_vm, smx_actor_t issuer);
79 // --
80
81 SG_END_DECL()
82
83 #endif
84