X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/a35857675df75b15725d79c3542dc56e24500e3e..6260d187764dc644d699e1a53454f7efdcc682df:/examples/cpp/comm-dependent/s4u-comm-dependent.cpp diff --git a/examples/cpp/comm-dependent/s4u-comm-dependent.cpp b/examples/cpp/comm-dependent/s4u-comm-dependent.cpp index 7c88907c9b..d40c99feff 100644 --- a/examples/cpp/comm-dependent/s4u-comm-dependent.cpp +++ b/examples/cpp/comm-dependent/s4u-comm-dependent.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2007-2021. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2007-2023. 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. */ @@ -15,7 +15,7 @@ static void sender(sg4::Mailbox* mailbox) sg4::CommPtr comm = mailbox->put_init(computation_amount, 7e6); exec->set_name("exec on sender")->add_successor(comm)->start(); - comm->set_name("comm to receiver")->vetoable_start(); + comm->set_name("comm to receiver")->start(); exec->wait(); comm->wait(); } @@ -28,7 +28,7 @@ static void receiver(sg4::Mailbox* mailbox) sg4::CommPtr comm = mailbox->get_init()->set_dst_data((void**)&received, sizeof(double)); comm->set_name("comm from sender")->add_successor(exec)->start(); - exec->set_name("exec on receiver")->vetoable_start(); + exec->set_name("exec on receiver")->start(); comm->wait(); exec->wait(); @@ -41,14 +41,14 @@ int main(int argc, char* argv[]) sg4::Engine e(&argc, argv); e.load_platform(argv[1]); - sg4::Mailbox* mbox = sg4::Mailbox::by_name("Mailbox"); + sg4::Mailbox* mbox = e.mailbox_by_name_or_create("Mailbox"); - sg4::Actor::create("sender", sg4::Host::by_name("Tremblay"), sender, mbox); - sg4::Actor::create("receiver", sg4::Host::by_name("Jupiter"), receiver, mbox); + sg4::Actor::create("sender", e.host_by_name("Tremblay"), sender, mbox); + sg4::Actor::create("receiver", e.host_by_name("Jupiter"), receiver, mbox); e.run(); - XBT_INFO("Simulation time: %.3f", e.get_clock()); + XBT_INFO("Simulation time: %.3f", sg4::Engine::get_clock()); return 0; }