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 #ifndef SURF_HOST_INTERFACE_HPP_
7 #define SURF_HOST_INTERFACE_HPP_
9 #include "StorageImpl.hpp"
10 #include "cpu_interface.hpp"
11 #include "network_interface.hpp"
12 #include "src/simix/ActorImpl.hpp"
13 #include "src/surf/PropertyHolder.hpp"
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
28 class XBT_PRIVATE HostModel : public kernel::resource::Model {
30 HostModel() : Model(Model::UpdateAlgo::FULL) {}
32 virtual void ignore_empty_vm_in_pm_LMM();
33 virtual kernel::resource::Action* execute_parallel(int host_nb, sg_host_t* host_list, double* flops_amount,
34 double* bytes_amount, double rate);
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
44 class XBT_PRIVATE HostImpl : public simgrid::surf::PropertyHolder {
47 explicit HostImpl(s4u::Host* host);
50 /** @brief Get the vector of storages (by names) attached to the Host */
51 virtual std::vector<const char*> get_attached_storages();
53 std::map<std::string, simgrid::surf::StorageImpl*> storage_;
54 simgrid::s4u::Host* piface_ = nullptr;
58 std::vector<s4u::ActorPtr> get_all_actors();
59 int get_actor_count();
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>>
67 // FIXME: make these private
68 ActorList process_list_;
69 std::vector<kernel::actor::ProcessArg*> auto_restart_processes_;
70 std::vector<kernel::actor::ProcessArg*> boot_processes_;
75 XBT_PUBLIC_DATA simgrid::surf::HostModel* surf_host_model;
77 #endif /* SURF_Host_INTERFACE_HPP_ */