Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid
[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
24 class XBT_PRIVATE HostModel;
25 class XBT_PRIVATE HostImpl;
26 class XBT_PRIVATE HostAction;
27 }
28 }
29
30 /*********
31  * Tools *
32  *********/
33
34 XBT_PUBLIC_DATA(simgrid::surf::HostModel*) surf_host_model;
35
36 /*********
37  * Model *
38  *********/
39
40 namespace simgrid {
41 namespace surf {
42
43 /** @ingroup SURF_host_interface
44  * @brief SURF Host model interface class
45  * @details A model is an object which handle the interactions between its Resources and its Actions
46  */
47 class HostModel : public Model {
48 public:
49   HostModel() : Model() {}
50
51   virtual void ignoreEmptyVmInPmLMM();
52   virtual Action* executeParallelTask(int host_nb, sg_host_t* host_list, double* flops_amount, double* bytes_amount,
53                                       double rate);
54 };
55
56 /************
57  * Resource *
58  ************/
59 /** @ingroup SURF_host_interface
60  * @brief SURF Host interface class
61  * @details An host represents a machine with a aggregation of a Cpu, a RoutingEdge and a Storage
62  */
63 class HostImpl : public simgrid::surf::PropertyHolder {
64
65 public:
66   explicit HostImpl(s4u::Host* host);
67   virtual ~HostImpl() = default;
68
69   /** @brief Get the vector of storages (by names) attached to the Host */
70   virtual void getAttachedStorageList(std::vector<const char*>* storages);
71
72   std::map<std::string, simgrid::surf::StorageImpl*> storage_;
73   simgrid::s4u::Host* piface_ = nullptr;
74
75   simgrid::s4u::Host* getHost() { return piface_; }
76 };
77 }
78 }
79
80 #endif /* SURF_Host_INTERFACE_HPP_ */