actor-create actor-daemon actor-join actor-kill actor-lifetime actor-migration actor-suspend actor-yield
app-masterworker app-pingpong app-token-ring
async-wait async-waitany async-waitall
- cloud-progress-monitor
energy-link energy-pstate energy-ptask energy-vm
- exec-async exec-basic
+ exec-async exec-basic exec-monitor
io-file-system io-file-remote io-storage-raw
platform-properties plugin-hostload mutex)
add_executable (s4u-${example} ${example}/s4u-${example}.cpp)
actor-create actor-daemon actor-join actor-kill actor-lifetime actor-migration actor-suspend actor-yield
app-bittorrent app-masterworker app-pingpong app-token-ring
async-wait async-waitall async-waitany
- cloud-progress-monitor
dht-chord
energy-link energy-pstate energy-ptask energy-vm
- exec-async exec-basic
+ exec-async exec-basic exec-monitor
platform-properties plugin-hostload mutex
io-file-system io-file-remote io-storage-raw)
ADD_TESH_FACTORIES(s4u-${example} "thread;ucontext;raw;boost"
You can start asynchronous executions, in a way that is very
similar to asynchronous communications.
+ - <b>Monitoring asynchronous executions</b>.
+ @ref examples/s4u/exec-monitor/s4u-exec-monitor.cpp \n
+ This example shows how to start an asynchronous execution, and
+ monitor its status.
+
TODO: add an example about parallel executions.
@section s4u_ex_actors Acting on Actors
@example examples/s4u/async-waitall/s4u-async-waitall.cpp
@example examples/s4u/async-waitany/s4u-async-waitany.cpp
@example examples/s4u/exec-basic/s4u-exec-basic.cpp
+@example examples/s4u/exec-async/s4u-exec-async.cpp
+@example examples/s4u/exec-monitor/s4u-exec-monitor.cpp
@example examples/s4u/app-token-ring/s4u-app-token-ring.cpp
@example examples/s4u/app-masterworker/s4u-app-masterworker.cpp
@example examples/s4u/app-pingpong/s4u-app-pingpong.cpp
@example examples/s4u/energy-pstate/s4u-energy-pstate.cpp
@example examples/s4u/io-file-system/s4u-io-file-system.cpp
@example examples/s4u/io-file-remote/s4u-io-file-remote.cpp
-@example examples/s4u/io-storage-raw/s4u-io-storage-raw.cpp \n
+@example examples/s4u/io-storage-raw/s4u-io-storage-raw.cpp
@example examples/s4u/mutex/s4u-mutex.cpp
@example examples/s4u/platform-properties/s4u-platform-properties.cpp
@example examples/s4u/platform-properties/s4u-platform-properties_d.xml
static void monitor()
{
- simgrid::s4u::Host* pm0 = simgrid::s4u::Host::by_name("Fafard");
- simgrid::s4u::VirtualMachine* vm0 = new simgrid::s4u::VirtualMachine("VM0", pm0, 1);
- vm0->start();
-
- simgrid::s4u::Actor::createActor("compute", vm0, executor);
+ simgrid::s4u::Actor::createActor("compute", simgrid::s4u::Host::by_name("Fafard"), executor);
while (simgrid::s4u::Engine::getClock() < 100) {
if (activity)
}
simgrid::s4u::this_actor::sleep_for(10000);
- vm0->destroy();
}
int main(int argc, char* argv[])
p Testing a vm with two successive tasks
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-cloud-progress-monitor$EXEEXT ${platfdir}/small_platform.xml
+$ $SG_TEST_EXENV ${bindir:=.}/s4u-exec-monitor$EXEEXT ${platfdir}/small_platform.xml
> [VM0:compute:(2) 0.000000] [s4u_test/INFO] VM0:compute task 1 created 0
> [Fafard:master_:(1) 1.000000] [s4u_test/INFO] activity remaining duration: 9.23704e+08
> [Fafard:master_:(1) 2.000000] [s4u_test/INFO] activity remaining duration: 8.47408e+08