Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add test() for asynchronous executions
[simgrid.git] / src / simix / smx_host_private.hpp
1 /* Copyright (c) 2007-2017. 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<ActorImpl, boost::intrusive::member_hook<ActorImpl, boost::intrusive::list_member_hook<>,
35                                                                   &ActorImpl::host_process_list_hook>>
36       process_list;
37   std::vector<ProcessArg*> auto_restart_processes;
38   std::vector<ProcessArg*> boot_processes;
39
40   void turnOn();
41 };
42 }
43 }
44
45 extern "C" {
46 XBT_PRIVATE void SIMIX_host_add_auto_restart_process(sg_host_t host, const char* name, std::function<void()> code,
47                                                      void* data, double kill_time,
48                                                      std::map<std::string, std::string>* properties, int auto_restart);
49
50 XBT_PRIVATE void SIMIX_host_autorestart(sg_host_t host);
51
52 XBT_PRIVATE void SIMIX_execution_finish(smx_activity_t synchro);
53
54 XBT_PRIVATE void SIMIX_set_category(smx_activity_t synchro, const char* category);
55 }
56
57 XBT_PRIVATE boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>
58 SIMIX_execution_start(const char* name, double flops_amount, double priority, double bound, sg_host_t host);
59 XBT_PRIVATE boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>
60 SIMIX_execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list, double* flops_amount,
61                                double* bytes_amount, double rate, double timeout);
62
63 #endif