actor-create actor-daemon actor-kill actor-migration actor-suspend
app-masterworker app-pingpong app-token-ring
async-wait async-waitany async-waitall
+ actor-execute
plugin-hostload io mutex)
add_executable (s4u-${example} ${example}/s4u-${example}.cpp)
target_link_libraries(s4u-${example} simgrid)
${CMAKE_CURRENT_SOURCE_DIR}/dht-chord/s4u-dht-chord.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}/async-waitall/s4u-async-waitall.tesh PARENT_SCOPE)
+ ${CMAKE_CURRENT_SOURCE_DIR}/async-waitall/s4u-async-waitall.tesh
+ ${CMAKE_CURRENT_SOURCE_DIR}/process-create/s4u-actor-execute.tesh PARENT_SCOPE)
set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/actions-comm/s4u-actions-comm-split_d.xml
${CMAKE_CURRENT_SOURCE_DIR}/actions-comm/s4u-actions-comm_d.xml
${CMAKE_CURRENT_SOURCE_DIR}/actions-storage/s4u-actions-storage_d.xml
actor-create actor-daemon actor-kill actor-migration actor-suspend
app-bittorrent app-masterworker app-pingpong app-token-ring
async-wait async-waitall async-waitany
+ actor-execute
dht-chord plugin-hostload io mutex)
ADD_TESH_FACTORIES(s4u-${example} "thread;ucontext;raw;boost" --setenv bindir=${CMAKE_CURRENT_BINARY_DIR}/${example} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_HOME_DIRECTORY}/examples/s4u/${example} s4u-${example}.tesh)
endforeach()
@ref examples/s4u/actor-create/s4u-actor-create_d.xml \n
Shows how to start your actors to populate your simulation.
+ - <b>Excute actors</b>.
+ @ref examples/s4u/process-create/s4u-process-create.cpp \n
+ Most processes are started from the deployment XML file.
+
- <b>Ping Pong</b>: @ref examples/s4u/app-pingpong/s4u-app-pingpong.c\n
It's hard to think of a simpler example: it is just sending one message back and forth.
The tesh file laying in the directory show how to start the simulator binary, highlighting how to pass options to
@ref examples/s4u/async-waitany/s4u-async-waitany.cpp\n
The @ref simgrid::s4u::Comm::wait_any() function is useful when you want to block
until one activity of the set completes, no matter which terminates
- first.
+ first.
@section s4u_ex_actors Acting on Actors
--- /dev/null
+make: *** No targets specified and no makefile found. Stop.
+make: *** No targets specified and no makefile found. Stop.
+vendredi 6 octobre 2017, 16:34:15 (UTC+0200)
--- /dev/null
+/* Copyright (c) 2010-2017. 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>
+
+/* Main function of the actor I want to start manually */
+static int actor_function(std::vector<std::string> args)
+{
+ simgrid::s4u::this_actor::execute(100);
+ return 0;
+}
+
+int main(int argc, char *argv[])
+{
+ simgrid::s4u::Engine e(&argc, argv);
+ std::vector<std::string> args;
+ xbt_assert(argc > 1, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]);
+
+ e.loadPlatform(argv[1]);
+
+ simgrid::s4u::Actor::createActor("simple_func", simgrid::s4u::Host::by_name("Tremblay"), actor_function, args);
+
+ e.run();
+
+ return 0;
+}
--- /dev/null
+#! ./tesh
+
+p Start remote processes
+$ $SG_TEST_EXENV ${bindir:=.}/s4u-actor-execute$EXEEXT ${srcdir:=.}/small_platform.xml