1 /* Copyright (c) 2004-2018. The SimGrid Team. All rights reserved. */
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. */
6 #include "surf_interface.hpp"
7 #include "cpu_interface.hpp"
8 #include "network_interface.hpp"
9 #include "src/surf/PropertyHolder.hpp"
11 #include "StorageImpl.hpp"
14 #ifndef SURF_HOST_INTERFACE_HPP_
15 #define SURF_HOST_INTERFACE_HPP_
21 XBT_PUBLIC_DATA simgrid::surf::HostModel* surf_host_model;
30 /** @ingroup SURF_host_interface
31 * @brief SURF Host model interface class
32 * @details A model is an object which handle the interactions between its Resources and its Actions
34 class XBT_PRIVATE HostModel : public kernel::resource::Model {
36 HostModel() : Model() {}
38 virtual void ignoreEmptyVmInPmLMM();
39 virtual kernel::resource::Action* executeParallelTask(int host_nb, sg_host_t* host_list, double* flops_amount,
40 double* bytes_amount, double rate);
46 /** @ingroup SURF_host_interface
47 * @brief SURF Host interface class
48 * @details An host represents a machine with a aggregation of a Cpu, a RoutingEdge and a Storage
50 class XBT_PRIVATE HostImpl : public simgrid::surf::PropertyHolder {
53 explicit HostImpl(s4u::Host* host);
54 virtual ~HostImpl() = default;
56 /** @brief Get the vector of storages (by names) attached to the Host */
57 virtual void getAttachedStorageList(std::vector<const char*>* storages);
59 std::map<std::string, simgrid::surf::StorageImpl*> storage_;
60 simgrid::s4u::Host* piface_ = nullptr;
62 simgrid::s4u::Host* getHost() { return piface_; }
67 #endif /* SURF_Host_INTERFACE_HPP_ */