Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
00f681a18008873bc88be568d3b66338f3f79bfe
[simgrid.git] / src / simix / smx_host_private.hpp
1 /* Copyright (c) 2007-2018. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #ifndef SIMIX_HOST_PRIVATE_HPP
7 #define SIMIX_HOST_PRIVATE_HPP
8
9 #include <boost/intrusive/list.hpp>
10 #include <functional>
11 #include <map>
12 #include <vector>
13
14 #include <xbt/Extendable.hpp>
15 #include <xbt/base.h>
16
17 #include "popping_private.hpp"
18 #include "simgrid/simix.h"
19
20 #include "ActorImpl.hpp"
21 #include "src/kernel/activity/ExecImpl.hpp"
22
23 /** @brief Host datatype from SIMIX POV */
24 namespace simgrid {
25 namespace simix {
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   boost::intrusive::list<kernel::actor::ActorImpl,
35                          boost::intrusive::member_hook<kernel::actor::ActorImpl, boost::intrusive::list_member_hook<>,
36                                                        &kernel::actor::ActorImpl::host_process_list_hook>>
37       process_list;
38   std::vector<kernel::actor::ProcessArg*> auto_restart_processes;
39   std::vector<kernel::actor::ProcessArg*> boot_processes;
40
41   void turnOn();
42 };
43 }
44 }
45
46 extern "C" {
47 XBT_PRIVATE void SIMIX_host_add_auto_restart_process(sg_host_t host, const char* name, std::function<void()> code,
48                                                      void* data, double kill_time,
49                                                      std::map<std::string, std::string>* properties, int auto_restart);
50
51 XBT_PRIVATE void SIMIX_host_autorestart(sg_host_t host);
52
53 XBT_PRIVATE void SIMIX_execution_finish(smx_activity_t synchro);
54
55 XBT_PRIVATE void SIMIX_set_category(smx_activity_t synchro, const char* category);
56 }
57
58 XBT_PRIVATE boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>
59 SIMIX_execution_start(const char* name, double flops_amount, double priority, double bound, sg_host_t host);
60 XBT_PRIVATE boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>
61 SIMIX_execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list, double* flops_amount,
62                                double* bytes_amount, double rate, double timeout);
63
64 #endif