Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cosmetics: rename a function, deprecate old name
authorMartin Quinson <martin.quinson@loria.fr>
Fri, 9 Mar 2018 16:23:51 +0000 (17:23 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Fri, 9 Mar 2018 16:23:51 +0000 (17:23 +0100)
15 files changed:
examples/s4u/actor-suspend/s4u-actor-suspend.cpp
examples/s4u/app-bittorrent/s4u-bittorrent.cpp
examples/s4u/app-token-ring/s4u-app-token-ring.cpp
examples/s4u/dht-chord/s4u-dht-chord.cpp
examples/s4u/exec-ptask/s4u-exec-ptask.cpp
examples/s4u/platform-properties/s4u-platform-properties.cpp
include/simgrid/s4u/Engine.hpp
src/s4u/s4u_engine.cpp
src/simdag/sd_dotloader.cpp
src/simgrid/host.cpp
src/smpi/internals/smpi_deployment.cpp
src/surf/plugins/host_energy.cpp
src/surf/plugins/link_energy.cpp
src/surf/sg_platf.cpp
teshsuite/s4u/comm-pt2pt/comm-pt2pt.cpp

index 967e803..60aa8ef 100644 (file)
@@ -70,7 +70,7 @@ int main(int argc, char* argv[])
   xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]);
 
   e.loadPlatform(argv[1]); /* - Load the platform description */
-  std::vector<simgrid::s4u::Host*> list = e.getHostList();
+  std::vector<simgrid::s4u::Host*> list = e.getAllHosts();
   simgrid::s4u::Actor::createActor("dream_master", list.front(), dream_master);
 
   e.run(); /* - Run the simulation */
index 9307ba0..0ce2b97 100644 (file)
@@ -21,7 +21,7 @@ int main(int argc, char* argv[])
 
   HostBittorrent::EXTENSION_ID = simgrid::s4u::Host::extension_create<HostBittorrent>();
 
-  std::vector<simgrid::s4u::Host*> list = simgrid::s4u::Engine::getInstance()->getHostList();
+  std::vector<simgrid::s4u::Host*> list = simgrid::s4u::Engine::getInstance()->getAllHosts();
   for (auto const& host : list)
     host->extension_set(new HostBittorrent(host));
 
index 893e6df..f953506 100644 (file)
@@ -60,7 +60,7 @@ int main(int argc, char** argv)
 
   XBT_INFO("Number of hosts '%zu'", e.getHostCount());
   int id = 0;
-  std::vector<simgrid::s4u::Host*> list = e.getHostList();
+  std::vector<simgrid::s4u::Host*> list = e.getAllHosts();
   for (auto const& host : list) {
     /* - Give a unique rank to each host and create a @ref relay_runner process on each */
     simgrid::s4u::Actor::createActor((std::to_string(id)).c_str(), host, RelayRunner());
index f18cf54..86cdfbf 100644 (file)
@@ -28,7 +28,7 @@ static void chord_init()
 
   HostChord::EXTENSION_ID = simgrid::s4u::Host::extension_create<HostChord>();
 
-  std::vector<simgrid::s4u::Host*> list = simgrid::s4u::Engine::getInstance()->getHostList();
+  std::vector<simgrid::s4u::Host*> list = simgrid::s4u::Engine::getInstance()->getAllHosts();
   for (auto const& host : list)
     host->extension_set(new HostChord(host));
 }
index 4de50c2..4f9b81a 100644 (file)
@@ -28,7 +28,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_energyptask, "Messages specific for this s4u ex
 static void runner()
 {
   /* Retrieve the list of all hosts as an array of hosts */
-  std::vector<simgrid::s4u::Host*> hosts = simgrid::s4u::Engine::getInstance()->getHostList();
+  std::vector<simgrid::s4u::Host*> hosts = simgrid::s4u::Engine::getInstance()->getAllHosts();
   int hosts_count = hosts.size();
 
   XBT_INFO("First, build a classical parallel task, with 1 Gflop to execute on each node, "
index 2d9f388..f2a948d 100644 (file)
@@ -106,7 +106,7 @@ int main(int argc, char* argv[])
   size_t totalHosts = sg_host_count();
 
   XBT_INFO("There are %zu hosts in the environment", totalHosts);
-  std::vector<simgrid::s4u::Host*> hosts = e.getHostList();
+  std::vector<simgrid::s4u::Host*> hosts = e.getAllHosts();
   for (unsigned int i = 0; i < hosts.size(); i++)
     XBT_INFO("Host '%s' runs at %.0f flops/s", hosts[i]->getCname(), hosts[i]->getSpeed());
 
index 8b2f0cd..cd42aec 100644 (file)
@@ -65,11 +65,11 @@ public:
 
   size_t getHostCount();
   void getHostList(std::vector<Host*> * whereTo);
-  std::vector<Host*> getHostList();
+  std::vector<Host*> getAllHosts();
 
   size_t getLinkCount();
   void getLinkList(std::vector<Link*> * list);
-  std::vector<Link*> getLinkList();
+  std::vector<Link*> getAllLinks();
 
   /** @brief Run the simulation */
   void run();
index 5a231d6..e49b59d 100644 (file)
@@ -85,14 +85,17 @@ size_t Engine::getHostCount()
 {
   return pimpl->hosts_.size();
 }
-/** @brief Fills the passed list with all hosts found in the platform */
-void Engine::getHostList(std::vector<Host*>* list)
+/** @brief Fills the passed list with all hosts found in the platform
+ *  @deprecated Please prefer Engine::getAllHosts()
+ */
+void XBT_ATTRIB_DEPRECATED_v322("Engine::getHostList() is deprecated in favor of Engine::getAllHosts(). Please switch before v3.22")
+Engine::getHostList(std::vector<Host*>* list)
 {
   for (auto const& kv : pimpl->hosts_)
     list->push_back(kv.second);
 }
 /** @brief Returns the list of all hosts found in the platform */
-std::vector<Host*> Engine::getHostList()
+std::vector<Host*> Engine::getAllHosts()
 {
   std::vector<Host*> res;
   for (auto const& kv : pimpl->hosts_)
@@ -122,13 +125,16 @@ size_t Engine::getLinkCount()
 {
   return simgrid::surf::LinkImpl::linksCount();
 }
-/** @brief Fills the passed list with all links found in the platform */
-void Engine::getLinkList(std::vector<Link*>* list)
+/** @brief Fills the passed list with all links found in the platform
+ *
+ *  @deprecated. Prefer Engine::getAllLinks() */
+void XBT_ATTRIB_DEPRECATED_v322("Engine::getLinkList() is deprecated in favor of Engine::getAllLinks(). Please switch before v3.22")
+Engine::getLinkList(std::vector<Link*>* list)
 {
   simgrid::surf::LinkImpl::linksList(list);
 }
 /** @brief Returns the list of all links found in the platform */
-std::vector<Link*> Engine::getLinkList()
+std::vector<Link*> Engine::getAllLinks()
 {
   std::vector<Link*> res;
   simgrid::surf::LinkImpl::linksList(&res);
index 10bb4ad..db121d7 100644 (file)
@@ -213,7 +213,7 @@ xbt_dynar_t SD_dotload_generic(const char* filename, bool sequential, bool sched
 
   if(schedule){
     if (schedule_success) {
-      std::vector<simgrid::s4u::Host*> hosts = simgrid::s4u::Engine::getInstance()->getHostList();
+      std::vector<simgrid::s4u::Host*> hosts = simgrid::s4u::Engine::getInstance()->getAllHosts();
 
       for (auto const& elm : computers) {
         SD_task_t previous_task = nullptr;
index faf160f..e8ea892 100644 (file)
@@ -37,7 +37,7 @@ size_t sg_host_count()
  */
 sg_host_t *sg_host_list() {
   xbt_assert(sg_host_count() > 0, "There is no host!");
-  std::vector<simgrid::s4u::Host*> hosts = simgrid::s4u::Engine::getInstance()->getHostList();
+  std::vector<simgrid::s4u::Host*> hosts = simgrid::s4u::Engine::getInstance()->getAllHosts();
 
   sg_host_t* res = (sg_host_t*)malloc(sizeof(sg_host_t) * hosts.size());
   memcpy(res, hosts.data(), sizeof(sg_host_t) * hosts.size());
@@ -75,7 +75,7 @@ xbt_dynar_t sg_hosts_as_dynar()
 {
   xbt_dynar_t res = xbt_dynar_new(sizeof(sg_host_t),nullptr);
 
-  std::vector<simgrid::s4u::Host*> list = simgrid::s4u::Engine::getInstance()->getHostList();
+  std::vector<simgrid::s4u::Host*> list = simgrid::s4u::Engine::getInstance()->getAllHosts();
 
   for (auto const& host : list) {
     if (host && host->pimpl_netpoint && host->pimpl_netpoint->isHost())
index 174447a..ad05eae 100644 (file)
@@ -57,7 +57,7 @@ void SMPI_app_instance_register(const char *name, xbt_main_func_t code, int num_
   static int already_called = 0;
   if (not already_called) {
     already_called = 1;
-    std::vector<simgrid::s4u::Host*> list = simgrid::s4u::Engine::getInstance()->getHostList();
+    std::vector<simgrid::s4u::Host*> list = simgrid::s4u::Engine::getInstance()->getAllHosts();
     for (auto const& host : list) {
       host->extension_set(new simgrid::smpi::SmpiHost(host));
     }
index f999bd1..5523636 100644 (file)
@@ -432,7 +432,7 @@ static void onHostDestruction(simgrid::s4u::Host& host)
 
 static void onSimulationEnd()
 {
-  std::vector<simgrid::s4u::Host*> hosts = simgrid::s4u::Engine::getInstance()->getHostList();
+  std::vector<simgrid::s4u::Host*> hosts = simgrid::s4u::Engine::getInstance()->getAllHosts();
 
   double total_energy      = 0.0; // Total energy consumption (whole platform)
   double used_hosts_energy = 0.0; // Energy consumed by hosts that computed something
@@ -483,7 +483,7 @@ void sg_host_energy_plugin_init()
 void sg_host_energy_update_all()
 {
   simgrid::simix::kernelImmediate([]() {
-    std::vector<simgrid::s4u::Host*> list = simgrid::s4u::Engine::getInstance()->getHostList();
+    std::vector<simgrid::s4u::Host*> list = simgrid::s4u::Engine::getInstance()->getAllHosts();
     for (auto const& host : list)
       if (dynamic_cast<simgrid::s4u::VirtualMachine*>(host) == nullptr) // Ignore virtual machines
         host->extension<HostEnergy>()->update();
index cee5ad2..d4a9f37 100644 (file)
@@ -164,7 +164,7 @@ static void onCommunicate(simgrid::surf::NetworkAction* action, simgrid::s4u::Ho
 
 static void onSimulationEnd()
 {
-  std::vector<simgrid::s4u::Link*> links = simgrid::s4u::Engine::getInstance()->getLinkList();
+  std::vector<simgrid::s4u::Link*> links = simgrid::s4u::Engine::getInstance()->getAllLinks();
 
   double total_energy = 0.0; // Total dissipated energy (whole platform)
   for (const auto link : links) {
index f372ea8..c542476 100644 (file)
@@ -417,7 +417,7 @@ void sg_platf_new_actor(ActorCreationArgs* actor)
     std::string msg = std::string("Cannot create actor '") + actor->function + "': host '" + actor->host +
                       "' does not exist\nExisting hosts: '";
 
-    std::vector<simgrid::s4u::Host*> list = simgrid::s4u::Engine::getInstance()->getHostList();
+    std::vector<simgrid::s4u::Host*> list = simgrid::s4u::Engine::getInstance()->getAllHosts();
 
     for (auto const& host : list) {
       msg += host->getName();
index 8dce758..c28714e 100644 (file)
@@ -182,7 +182,7 @@ int main(int argc, char* argv[])
   }
   xbt_assert(argSend.front().size() == argRecv.front().size(), "Sender and receiver spec must be of the same size");
 
-  std::vector<simgrid::s4u::Host*> hosts = e.getHostList();
+  std::vector<simgrid::s4u::Host*> hosts = e.getAllHosts();
 
   simgrid::s4u::Actor::createActor("sender", hosts[0], sender, argSend);
   simgrid::s4u::Actor::createActor("recver", hosts[1], receiver, argRecv);