Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Replace xbt_heap with boost::heap for surf actions.
[simgrid.git] / src / surf / HostImpl.hpp
1 /* Copyright (c) 2004-2016. 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 #include "surf_interface.hpp"
7 #include "cpu_interface.hpp"
8 #include "network_interface.hpp"
9 #include "src/surf/PropertyHolder.hpp"
10
11 #include "StorageImpl.hpp"
12 #include <xbt/base.h>
13
14 #ifndef SURF_HOST_INTERFACE_HPP_
15 #define SURF_HOST_INTERFACE_HPP_
16
17 /***********
18  * Classes *
19  ***********/
20
21 namespace simgrid {
22 namespace surf {
23 class XBT_PRIVATE HostAction;
24 }
25 }
26
27 /*********
28  * Tools *
29  *********/
30
31 XBT_PUBLIC_DATA(simgrid::surf::HostModel*) surf_host_model;
32
33 /*********
34  * Model *
35  *********/
36
37 namespace simgrid {
38 namespace surf {
39
40 /** @ingroup SURF_host_interface
41  * @brief SURF Host model interface class
42  * @details A model is an object which handle the interactions between its Resources and its Actions
43  */
44 class XBT_PRIVATE HostModel : public Model {
45 public:
46   HostModel() : Model() {}
47
48   virtual void ignoreEmptyVmInPmLMM();
49   virtual Action* executeParallelTask(int host_nb, sg_host_t* host_list, double* flops_amount, double* bytes_amount,
50                                       double rate);
51 };
52
53 /************
54  * Resource *
55  ************/
56 /** @ingroup SURF_host_interface
57  * @brief SURF Host interface class
58  * @details An host represents a machine with a aggregation of a Cpu, a RoutingEdge and a Storage
59  */
60 class XBT_PRIVATE HostImpl : public simgrid::surf::PropertyHolder {
61
62 public:
63   explicit HostImpl(s4u::Host* host);
64   virtual ~HostImpl() = default;
65
66   /** @brief Get the vector of storages (by names) attached to the Host */
67   virtual void getAttachedStorageList(std::vector<const char*>* storages);
68
69   std::map<std::string, simgrid::surf::StorageImpl*> storage_;
70   simgrid::s4u::Host* piface_ = nullptr;
71
72   simgrid::s4u::Host* getHost() { return piface_; }
73 };
74 }
75 }
76
77 #endif /* SURF_Host_INTERFACE_HPP_ */