-/* Copyright (c) 2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 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. */
if (rank == 0) {
/* The root process (rank 0) first sends the token then waits to receive it back */
XBT_INFO("Host \"%u\" send 'Token' to Host \"%s\"", rank, neighbor_mailbox->name());
- simgrid::s4u::this_actor::send(neighbor_mailbox, xbt_strdup("Token"), task_comm_size);
- char* res = static_cast<char*>(simgrid::s4u::this_actor::recv(my_mailbox));
+ neighbor_mailbox->put(xbt_strdup("Token"), task_comm_size);
+ char* res = static_cast<char*>(my_mailbox->get());
XBT_INFO("Host \"%u\" received \"%s\"", rank, res);
xbt_free(res);
} else {
- char* res = static_cast<char*>(simgrid::s4u::this_actor::recv(my_mailbox));
+ char* res = static_cast<char*>(my_mailbox->get());
XBT_INFO("Host \"%u\" received \"%s\"", rank, res);
XBT_INFO("Host \"%u\" send 'Token' to Host \"%s\"", rank, neighbor_mailbox->name());
- simgrid::s4u::this_actor::send(neighbor_mailbox, res, task_comm_size);
+ neighbor_mailbox->put(res, task_comm_size);
}
}
};
}
e->run();
XBT_INFO("Simulation time %g", e->getClock());
+
+ delete e;
return 0;
}