Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove unused type definitions.
[simgrid.git] / src / surf / HostImpl.hpp
1 /* Copyright (c) 2004-2019. 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 SURF_HOST_INTERFACE_HPP_
7 #define SURF_HOST_INTERFACE_HPP_
8
9 #include "src/kernel/actor/ActorImpl.hpp"
10 #include "src/surf/PropertyHolder.hpp"
11 #include "src/surf/StorageImpl.hpp"
12 #include "src/surf/cpu_interface.hpp"
13 #include "src/surf/network_interface.hpp"
14
15 #include <vector>
16
17 namespace simgrid {
18 namespace surf {
19
20 /*********
21  * Model *
22  *********/
23
24 /** @ingroup SURF_host_interface
25  * @brief SURF Host model interface class
26  * @details A model is an object which handle the interactions between its Resources and its Actions
27  */
28 class XBT_PRIVATE HostModel : public kernel::resource::Model {
29 public:
30   HostModel() : Model(Model::UpdateAlgo::FULL) {}
31
32   virtual kernel::resource::Action* execute_parallel(const std::vector<s4u::Host*>& host_list,
33                                                      const double* flops_amount, const double* bytes_amount,
34                                                      double rate);
35 };
36
37 /************
38  * Resource *
39  ************/
40 /** @ingroup SURF_host_interface
41  * @brief SURF Host interface class
42  * @details An host represents a machine with a aggregation of a Cpu, a RoutingEdge and a Storage
43  */
44 class XBT_PRIVATE HostImpl : public simgrid::surf::PropertyHolder {
45
46 public:
47   explicit HostImpl(s4u::Host* host);
48   virtual ~HostImpl();
49
50   /** @brief Get the vector of storages (by names) attached to the Host */
51   virtual std::vector<const char*> get_attached_storages();
52
53   std::map<std::string, kernel::resource::StorageImpl*> storage_;
54   s4u::Host* piface_ = nullptr;
55
56   void turn_on();
57   void turn_off();
58   std::vector<s4u::ActorPtr> get_all_actors();
59   size_t get_actor_count();
60
61   typedef boost::intrusive::list<
62       kernel::actor::ActorImpl,
63       boost::intrusive::member_hook<kernel::actor::ActorImpl, boost::intrusive::list_member_hook<>,
64                                     &kernel::actor::ActorImpl::host_process_list_hook>>
65       ActorList;
66
67   // FIXME: make these private
68   ActorList process_list_;
69   std::vector<kernel::actor::ProcessArg*> actors_at_boot_;
70 };
71 }
72 }
73
74 XBT_PUBLIC_DATA simgrid::surf::HostModel* surf_host_model;
75
76 #endif /* SURF_Host_INTERFACE_HPP_ */