${CMAKE_CURRENT_SOURCE_DIR}/async-waitall/s4u-async-waitall_d.xml
${CMAKE_CURRENT_SOURCE_DIR}/async-wait/s4u-async-wait_d.xml
${CMAKE_CURRENT_SOURCE_DIR}/dht-chord/s4u-dht-chord_d.xml
- ${CMAKE_CURRENT_SOURCE_DIR}/execute-priority/s4u-execute-priority_d.xml
${CMAKE_CURRENT_SOURCE_DIR}/io-file-remote/s4u-io-file-remote_d.xml
${CMAKE_CURRENT_SOURCE_DIR}/platform-properties/s4u-platform-properties_d.xml
PARENT_SCOPE)
XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "Messages specific for this s4u example");
-static int test(int argc, char** argv)
+static void test(double computation_amount, double priority)
{
- double computation_amount = std::stod(argv[1]);
- double priority = std::stod(argv[2]);
-
XBT_INFO("Hello! Execute %g flops with priority %g", computation_amount, priority);
simgrid::s4u::ExecPtr activity = simgrid::s4u::Actor::self()->exec_init(computation_amount);
activity->setPriority(priority);
activity->wait();
XBT_INFO("Goodbye now!");
- return 0;
}
int main(int argc, char* argv[])
{
simgrid::s4u::Engine e(&argc, argv);
- e.loadPlatform(argv[1]); /* - Load the platform description */
- e.registerFunction("test", test);
- e.loadDeployment(argv[2]);
+ e.loadPlatform(argv[1]);
+ simgrid::s4u::Actor::createActor("test", simgrid::s4u::Host::by_name("Fafard"), test, 7.6296e+07, 1.0);
+ simgrid::s4u::Actor::createActor("test", simgrid::s4u::Host::by_name("Fafard"), test, 7.6296e+07, 2.0);
e.run();
#! ./tesh
! output sort 19
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-execute-priority$EXEEXT ${platfdir}/small_platform.xml ${srcdir:=.}/s4u-execute-priority_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ $SG_TEST_EXENV ${bindir:=.}/s4u-execute-priority$EXEEXT ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
> [ 0.000000] (1:test@Fafard) Hello! Execute 7.6296e+07 flops with priority 1
> [ 0.000000] (2:test@Fafard) Hello! Execute 7.6296e+07 flops with priority 2
> [ 1.500000] (2: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>