1 /* Copyright (c) 2006-2015. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
6 #include <xbt/sysdep.h>
8 #include "simgrid/s4u.h"
10 XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "a sample log category");
15 XBT_INFO("Hello s4u, I'm ready to serve");
16 char *msg = static_cast<char*>(simgrid::s4u::this_actor::recv(
17 *simgrid::s4u::Mailbox::byName("worker")));
18 XBT_INFO("I received '%s'",msg);
19 XBT_INFO("I'm done. See you.");
26 const char *msg = "GaBuZoMeu";
27 XBT_INFO("Hello s4u, I have something to send");
28 simgrid::s4u::this_actor::send(*simgrid::s4u::Mailbox::byName("worker"), xbt_strdup(msg), strlen(msg));
29 XBT_INFO("I'm done. See you.");
34 int main(int argc, char **argv) {
35 simgrid::s4u::Engine *e = new simgrid::s4u::Engine(&argc,argv);
36 e->loadPlatform("../../platforms/two_hosts_platform.xml");
37 new simgrid::s4u::Actor("worker", simgrid::s4u::Host::by_name("host0"), Worker());
38 new simgrid::s4u::Actor("master", simgrid::s4u::Host::by_name("host1"), 0, Master());