Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
rename the plugins from the command line, and document it
[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 "src/simix/ActorImpl.hpp"
15 #include "src/simix/popping_private.hpp"
16 #include "xbt/Extendable.hpp"
17
18 /** @brief Host datatype from SIMIX POV */
19 namespace simgrid {
20 namespace simix {
21
22 class Host {
23 public:
24   static simgrid::xbt::Extension<simgrid::s4u::Host, Host> EXTENSION_ID;
25
26   explicit Host();
27   virtual ~Host();
28
29   boost::intrusive::list<kernel::actor::ActorImpl,
30                          boost::intrusive::member_hook<kernel::actor::ActorImpl, boost::intrusive::list_member_hook<>,
31                                                        &kernel::actor::ActorImpl::host_process_list_hook>>
32       process_list;
33   std::vector<kernel::actor::ProcessArg*> auto_restart_processes;
34   std::vector<kernel::actor::ProcessArg*> boot_processes;
35
36   void turnOn();
37 };
38 }
39 }
40
41 XBT_PRIVATE void SIMIX_host_add_auto_restart_process(sg_host_t host, const char* name, std::function<void()> code,
42                                                      void* data, double kill_time,
43                                                      std::map<std::string, std::string>* properties, int auto_restart);
44
45 XBT_PRIVATE void SIMIX_host_autorestart(sg_host_t host);
46
47 XBT_PRIVATE void SIMIX_execution_finish(smx_activity_t synchro);
48
49 XBT_PRIVATE void SIMIX_set_category(smx_activity_t synchro, const char* category);
50
51 XBT_PRIVATE boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>
52 SIMIX_execution_start(const char* name, double flops_amount, double priority, double bound, sg_host_t host);
53 XBT_PRIVATE boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>
54 SIMIX_execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list, double* flops_amount,
55                                double* bytes_amount, double rate, double timeout);
56
57 #endif