Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
inline a useless function
authorMartin Quinson <martin.quinson@loria.fr>
Wed, 21 Dec 2016 11:44:46 +0000 (12:44 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Wed, 21 Dec 2016 11:44:46 +0000 (12:44 +0100)
src/include/surf/surf.h
src/simix/ActorImpl.cpp
src/simix/smx_network.cpp
src/simix/smx_synchro.cpp
src/surf/surf_c_bindings.cpp
teshsuite/surf/surf_usage/surf_usage.cpp
teshsuite/surf/surf_usage2/surf_usage2.cpp

index 67a61f1..dae5142 100644 (file)
@@ -165,9 +165,6 @@ XBT_PUBLIC(surf_action_t) surf_model_extract_failed_action_set(surf_model_t mode
  */
 XBT_PUBLIC(int) surf_model_running_action_set_size(surf_model_t model);
 
-/** @brief Create a sleep action on the given host */
-XBT_PUBLIC(surf_action_t) surf_host_sleep(sg_host_t host, double duration);
-
 /** @brief Create a file opening action on the given host */
 XBT_PUBLIC(surf_action_t) surf_host_open(sg_host_t host, const char* fullpath);
 
index 346c51b..be85cd7 100644 (file)
 
 #include <mc/mc.h>
 
-#include "src/surf/surf_interface.hpp"
 #include "smx_private.h"
-#include "src/mc/mc_replay.h"
+#include "src/kernel/activity/SynchroIo.hpp"
+#include "src/kernel/activity/SynchroRaw.hpp"
+#include "src/kernel/activity/SynchroSleep.hpp"
 #include "src/mc/Client.hpp"
+#include "src/mc/mc_replay.h"
 #include "src/msg/msg_private.h"
-#include "src/kernel/activity/SynchroSleep.hpp"
-#include "src/kernel/activity/SynchroRaw.hpp"
-#include "src/kernel/activity/SynchroIo.hpp"
+#include "src/surf/cpu_interface.hpp"
+#include "src/surf/surf_interface.hpp"
 
 #ifdef HAVE_SMPI
 #include "src/smpi/private.h"
@@ -789,7 +790,7 @@ smx_activity_t SIMIX_process_sleep(smx_actor_t process, double duration)
 
   simgrid::kernel::activity::Sleep *synchro = new simgrid::kernel::activity::Sleep();
   synchro->host = host;
-  synchro->surf_sleep = surf_host_sleep(host, duration);
+  synchro->surf_sleep                       = host->pimpl_cpu->sleep(duration);
   synchro->surf_sleep->setData(synchro);
   XBT_DEBUG("Create sleep synchronization %p", synchro);
 
index 1c168bc..409a20d 100644 (file)
 
 #include <simgrid/s4u/host.hpp>
 
-#include "src/surf/surf_interface.hpp"
-#include "src/simix/smx_private.h"
-#include "xbt/log.h"
 #include "mc/mc.h"
+#include "simgrid/s4u/Mailbox.hpp"
 #include "src/mc/mc_replay.h"
+#include "src/simix/smx_private.h"
+#include "src/surf/cpu_interface.hpp"
+#include "src/surf/surf_interface.hpp"
 #include "xbt/dict.h"
-#include "simgrid/s4u/Mailbox.hpp"
+#include "xbt/log.h"
 
 #include "src/kernel/activity/SynchroComm.hpp"
 #include "src/surf/network_interface.hpp"
@@ -409,7 +410,7 @@ void simcall_HANDLER_comm_wait(smx_simcall_t simcall, smx_activity_t synchro, do
   if (synchro->state != SIMIX_WAITING && synchro->state != SIMIX_RUNNING) {
     SIMIX_comm_finish(synchro);
   } else { /* if (timeout >= 0) { we need a surf sleep action even when there is no timeout, otherwise surf won't tell us when the host fails */
-    surf_action_t sleep = surf_host_sleep(simcall->issuer->host, timeout);
+    surf_action_t sleep = simcall->issuer->host->pimpl_cpu->sleep(timeout);
     sleep->setData(synchro);
 
     simgrid::kernel::activity::Comm *comm = static_cast<simgrid::kernel::activity::Comm*>(synchro);
index b1a6485..b2867f4 100644 (file)
@@ -5,8 +5,9 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "src/surf/surf_interface.hpp"
 #include "smx_private.h"
+#include "src/surf/cpu_interface.hpp"
+#include "src/surf/surf_interface.hpp"
 #include <xbt/ex.hpp>
 #include <xbt/log.h>
 
@@ -27,7 +28,7 @@ static smx_activity_t SIMIX_synchro_wait(sg_host_t smx_host, double timeout)
   XBT_IN("(%p, %f)",smx_host,timeout);
 
   simgrid::kernel::activity::Raw *sync = new simgrid::kernel::activity::Raw();
-  sync->sleep = surf_host_sleep(smx_host, timeout);
+  sync->sleep                          = smx_host->pimpl_cpu->sleep(timeout);
   sync->sleep->setData(sync);
   XBT_OUT();
   return sync;
index 8e4e20a..ed0f2fc 100644 (file)
@@ -164,10 +164,6 @@ int surf_model_running_action_set_size(surf_model_t model){
   return model->getRunningActionSet()->size();
 }
 
-surf_action_t surf_host_sleep(sg_host_t host, double duration){
-  return host->pimpl_cpu->sleep(duration);
-}
-
 surf_action_t surf_host_open(sg_host_t host, const char* fullpath){
   return host->pimpl_->open(fullpath);
 }
index fb33bb5..6aec7c0 100644 (file)
@@ -51,9 +51,9 @@ int main(int argc, char **argv)
   simgrid::s4u::Host* hostB = sg_host_by_name("Cpu B");
 
   /* Let's do something on it */
-  simgrid::surf::Action *actionA = hostA->pimpl_cpu->execution_start(1000.0);
-  simgrid::surf::Action *actionB = hostB->pimpl_cpu->execution_start(1000.0);
-  simgrid::surf::Action *actionC = surf_host_sleep(hostB, 7.32);
+  simgrid::surf::ActionactionA = hostA->pimpl_cpu->execution_start(1000.0);
+  simgrid::surf::ActionactionB = hostB->pimpl_cpu->execution_start(1000.0);
+  simgrid::surf::Action* actionC = hostB->pimpl_cpu->sleep(7.32);
 
   simgrid::surf::Action::State stateActionA = actionA->getState();
   simgrid::surf::Action::State stateActionB = actionB->getState();
index b7e0950..3825f36 100644 (file)
@@ -36,7 +36,7 @@ int main(int argc, char **argv)
   /* Let's do something on it */
   hostA->pimpl_cpu->execution_start(1000.0);
   hostB->pimpl_cpu->execution_start(1000.0);
-  surf_host_sleep(hostB, 7.32);
+  hostB->pimpl_cpu->sleep(7.32);
 
   surf_network_model->communicate(hostA, hostB, 150.0, -1.0);