X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/4ff3a4cf6e03165421f65616a22be86b8f528e21..a3ec2039ff79218ec773f66e72b1d10ff33643b8:/examples/s4u/cloud-capping/s4u-cloud-capping.cpp diff --git a/examples/s4u/cloud-capping/s4u-cloud-capping.cpp b/examples/s4u/cloud-capping/s4u-cloud-capping.cpp index 7674ad2a61..42c2984003 100644 --- a/examples/s4u/cloud-capping/s4u-cloud-capping.cpp +++ b/examples/s4u/cloud-capping/s4u-cloud-capping.cpp @@ -11,18 +11,18 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "Messages specific for this s4u example") static void worker(double computation_amount, bool use_bound, double bound) { - double clock_start = simgrid::s4u::Engine::getClock(); + double clock_start = simgrid::s4u::Engine::get_clock(); simgrid::s4u::ExecPtr exec = simgrid::s4u::this_actor::exec_init(computation_amount); if (use_bound) { if (bound < 1e-12) /* close enough to 0 without any floating precision surprise */ XBT_INFO("bound == 0 means no capping (i.e., unlimited)."); - exec->setBound(bound); + exec->set_bound(bound); } exec->start(); exec->wait(); - double clock_end = simgrid::s4u::Engine::getClock(); + double clock_end = simgrid::s4u::Engine::get_clock(); double duration = clock_end - clock_start; double flops_per_sec = computation_amount / duration; @@ -41,12 +41,12 @@ static void worker_busy_loop(const char* name, double speed) if (speed > 0) { double new_bound = (speed / 10) * i; XBT_INFO("set bound of VM1 to %f", new_bound); - static_cast(simgrid::s4u::this_actor::getHost())->setBound(new_bound); + static_cast(simgrid::s4u::this_actor::get_host())->set_bound(new_bound); } simgrid::s4u::this_actor::sleep_for(100); double exec_remain_now = exec->get_remaining(); double flops_per_sec = exec_remain_prev - exec_remain_now; - XBT_INFO("%s@%s: %.0f flops/s", name, simgrid::s4u::this_actor::getHost()->get_cname(), flops_per_sec / 100); + XBT_INFO("%s@%s: %.0f flops/s", name, simgrid::s4u::this_actor::get_host()->get_cname(), flops_per_sec / 100); exec_remain_prev = exec_remain_now; simgrid::s4u::this_actor::sleep_for(1); } @@ -75,7 +75,7 @@ static void test_one_task(simgrid::s4u::Host* host) const double cpu_speed = host->getSpeed(); const double computation_amount = cpu_speed * 10; - XBT_INFO("### Test: with/without MSG_task_set_bound"); + XBT_INFO("### Test: with/without task set_bound"); XBT_INFO("### Test: no bound for Task1@%s", host->get_cname()); simgrid::s4u::Actor::create("worker0", host, worker, computation_amount, false, 0); @@ -189,7 +189,7 @@ static void master_main() vm0->destroy(); vm0 = new simgrid::s4u::VirtualMachine("VM0", pm0, 1); - vm0->setBound(pm0->getSpeed() / 10); + vm0->set_bound(pm0->getSpeed() / 10); vm0->start(); XBT_INFO("# 7. Put a single task on the VM capped by 10%%."); @@ -207,7 +207,7 @@ static void master_main() vm0->destroy(); vm0 = new simgrid::s4u::VirtualMachine("VM0", pm0, 1); - vm0->setRamsize(1e9); // 1GB + vm0->set_ramsize(1e9); // 1GB vm0->start(); double cpu_speed = pm0->getSpeed(); @@ -221,7 +221,7 @@ static void master_main() XBT_INFO(" "); XBT_INFO("# 10. (b) set 10%% bound to the VM, and then put a task on the VM."); - vm0->setBound(cpu_speed / 10); + vm0->set_bound(cpu_speed / 10); simgrid::s4u::Actor::create("worker0", vm0, worker, computation_amount, false, 0); simgrid::s4u::this_actor::sleep_for(1000); XBT_INFO(" "); @@ -249,12 +249,12 @@ int main(int argc, char* argv[]) /* load the platform file */ xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s ../platforms/small_platform.xml\n", argv[0], argv[0]); - e.loadPlatform(argv[1]); + e.load_platform(argv[1]); simgrid::s4u::Actor::create("master_", simgrid::s4u::Host::by_name("Fafard"), master_main); e.run(); - XBT_INFO("Bye (simulation time %g)", simgrid::s4u::Engine::getClock()); + XBT_INFO("Bye (simulation time %g)", simgrid::s4u::Engine::get_clock()); return 0; }