1 /* Copyright (c) 2004-2016. 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_
24 class XBT_PRIVATE HostModel;
25 class XBT_PRIVATE HostImpl;
26 class XBT_PRIVATE HostAction;
34 XBT_PUBLIC_DATA(simgrid::surf::HostModel*) surf_host_model;
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
47 class HostModel : public Model {
49 HostModel() : Model() {}
51 virtual void ignoreEmptyVmInPmLMM();
52 virtual Action* executeParallelTask(int host_nb, sg_host_t* host_list, double* flops_amount, double* bytes_amount,
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
63 class HostImpl : public simgrid::surf::PropertyHolder {
66 explicit HostImpl(s4u::Host* host);
67 virtual ~HostImpl() = default;
69 /** @brief Return the storage of corresponding mount point */
70 virtual simgrid::surf::StorageImpl* findStorageOnMountList(const char* storage);
72 /** @brief Get the xbt_dynar_t of storages attached to the Host */
73 virtual void getAttachedStorageList(std::vector<const char*>* storages);
78 * @param fd The file descriptor to read
79 * @param size The size in bytes to read
80 * @return The StorageAction corresponding to the reading
82 virtual Action* read(surf_file_t fd, sg_size_t size);
87 * @param fd The file descriptor to write
88 * @param size The size in bytes to write
89 * @return The StorageAction corresponding to the writing
91 virtual Action* write(surf_file_t fd, sg_size_t size);
93 std::map<std::string, simgrid::surf::StorageImpl*> storage_;
94 simgrid::s4u::Host* piface_ = nullptr;
96 simgrid::s4u::Host* getHost() { return piface_; }
101 #endif /* SURF_Host_INTERFACE_HPP_ */