1 /* Copyright (c) 2016-2017. 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 "src/kernel/EngineImpl.hpp"
7 #include "simgrid/s4u/Host.hpp"
8 #include "src/kernel/routing/NetPoint.hpp"
9 #include "src/kernel/routing/NetZoneImpl.hpp"
16 EngineImpl::EngineImpl() = default;
17 EngineImpl::~EngineImpl()
19 /* copy all names to not modify the map while iterating over it.
21 * Plus, the hosts are destroyed in the lexicographic order to ensure
22 * that the output is reproducible: we don't want to kill them in the
23 * pointer order as it could be platform-dependent, which would break
26 std::vector<std::string> names;
27 for (auto const& kv : hosts_)
28 names.push_back(kv.second->getName());
30 std::sort(names.begin(), names.end());
32 for (auto const& name : names)
33 hosts_.at(name)->destroy();
35 /* Also delete the other data */
37 for (auto const& kv : netpoints_)