examples/s4u/actor-kill/s4u-actor-kill
examples/s4u/actor-lifetime/s4u-actor-lifetime
examples/s4u/actor-migration/s4u-actor-migration
-examples/s4u/actor-priority/s4u-actor-priority
examples/s4u/actor-suspend/s4u-actor-suspend
examples/s4u/actor-yield/s4u-actor-yield
examples/s4u/app-bittorrent/s4u-bittorrent
foreach (example actions-comm actions-storage
- actor-create actor-daemon actor-execute actor-join actor-kill actor-lifetime actor-migration actor-suspend actor-priority actor-yield
+ actor-create actor-daemon actor-execute 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
energy-link energy-pstate energy-ptask
set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/app-bittorrent/s4u-app-bittorrent.tesh
${CMAKE_CURRENT_SOURCE_DIR}/dht-chord/s4u-dht-chord.tesh
${CMAKE_CURRENT_SOURCE_DIR}/energy-pstate/s4u-energy-pstate.tesh
- ${CMAKE_CURRENT_SOURCE_DIR}/actor-priority/s4u-actor-priority.tesh
${CMAKE_CURRENT_SOURCE_DIR}/actor-lifetime/s4u-actor-lifetime.tesh
- ${CMAKE_CURRENT_SOURCE_DIR}/actor-priority/s4u-actor-priority.tesh
${CMAKE_CURRENT_SOURCE_DIR}/actor-yield/s4u-actor-yield.tesh
${CMAKE_CURRENT_SOURCE_DIR}/async-wait/s4u-async-wait.tesh
${CMAKE_CURRENT_SOURCE_DIR}/async-waitany/s4u-async-waitany.tesh
${CMAKE_CURRENT_SOURCE_DIR}/actions-storage/s4u-actions-storage_d.xml
${CMAKE_CURRENT_SOURCE_DIR}/actor-create/s4u-actor-create_d.xml
${CMAKE_CURRENT_SOURCE_DIR}/actor-lifetime/s4u-actor-lifetime_d.xml
- ${CMAKE_CURRENT_SOURCE_DIR}/actor-priority/s4u-actor-priority_d.xml
${CMAKE_CURRENT_SOURCE_DIR}/actor-yield/s4u-actor-yield_d.xml
${CMAKE_CURRENT_SOURCE_DIR}/app-bittorrent/s4u-app-bittorrent_d.xml
${CMAKE_CURRENT_SOURCE_DIR}/app-masterworker/s4u-app-masterworker_d.xml
${CMAKE_CURRENT_SOURCE_DIR}/README.doc PARENT_SCOPE)
foreach(example actions-comm actions-storage
- actor-create actor-daemon actor-execute actor-join actor-kill actor-lifetime actor-migration actor-suspend actor-priority actor-yield
+ actor-create actor-daemon actor-execute 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
dht-chord
Actors can be suspended and resumed during their executions
thanks to the @ref simgrid::s4u::Actor::suspend and @ref simgrid::s4u::Actor::resume methods.
- - <b>Priority actors</b>.
- @ref examples/s4u/actor-priority/s4u-actor-priority.cpp \n
- Actors can be launched according their priorities thanks to the @ref
- simgrid::s4u::this_actor::execute() method.
-
- <b>Kill actors</b>.
@ref examples/s4u/actor-kill/s4u-actor-kill.cpp \n
Actors can forcefully stop other actors with the @ref
@example examples/s4u/actor-lifetime/s4u-actor-lifetime.cpp
@example examples/s4u/actor-lifetime/s4u-actor-lifetime_d.xml
@example examples/s4u/actor-migration/s4u-actor-migration.cpp
-@example examples/s4u/actor-priority/s4u-actor-priority.cpp
@example examples/s4u/actor-suspend/s4u-actor-suspend.cpp
@example examples/s4u/actor-yield/s4u-actor-yield.cpp
@example examples/s4u/app-token-ring/s4u-app-token-ring.cpp
+++ /dev/null
-/* Copyright (c) 2007-2016. The SimGrid Team. All rights reserved. */
-
-/* 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 "simgrid/s4u.hpp"
-#include <cstdlib>
-#include <iostream>
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
-
-class test {
- double computation_amount;
- double priority;
-
-public:
- explicit test(std::vector<std::string> args)
-{
- computation_amount = std::stod(args[1]);
- priority = std::stod(args[2]);
-}
-void operator()()
-{
- XBT_INFO("Hello! Running an actor of size %g with priority %g", computation_amount, priority);
- simgrid::s4u::this_actor::execute(computation_amount, priority);
-
- XBT_INFO("Goodbye now!");
-}
-};
-
-int main(int argc, char *argv[])
-{
- simgrid::s4u::Engine e(&argc, argv);
- xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
- "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]);
-
- e.registerFunction<test>("test");
-
- e.loadPlatform(argv[1]);
- e.loadDeployment(argv[2]);
-
- e.run();
-
- return 0;
-}
+++ /dev/null
-#! ./tesh
-
-! output sort 19
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-actor-priority$EXEEXT ${platfdir}/small_platform.xml s4u-actor-priority_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
-> [ 0.000000] (1:test@Fafard) Hello! Running an actor of size 7.6296e+07 with priority 1
-> [ 0.000000] (2:test@Fafard) Hello! Running an actor of size 7.6296e+07 with priority 2
-> [ 1.500000] (2:test@Fafard) Goodbye now!
-> [ 2.000000] (1:test@Fafard) Goodbye now!
+++ /dev/null
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
-<platform version="4.1">
- <actor host="Fafard" function="test">
- <argument value="76296000"/>
- <argument value="1.0"/>
- </actor>
- <actor host="Fafard" function="test">
- <argument value="76296000"/>
- <argument value="2.0"/>
- </actor>
-</platform>