*/
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);
#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"
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);
#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"
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);
/* 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>
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;
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);
}
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::Action* actionA = hostA->pimpl_cpu->execution_start(1000.0);
+ simgrid::surf::Action* actionB = 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();
/* 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);