From 8c416e92254512408c1d0ce729e8d3cf82ec9938 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sat, 21 Apr 2018 23:03:32 +0200 Subject: [PATCH] start snake_casing s4u::Engine --- .../s4u/actor-create/s4u-actor-create.cpp | 4 +- .../s4u/actor-daemon/s4u-actor-daemon.cpp | 2 +- examples/s4u/actor-join/s4u-actor-join.cpp | 2 +- examples/s4u/actor-kill/s4u-actor-kill.cpp | 2 +- .../s4u/actor-lifetime/s4u-actor-lifetime.cpp | 4 +- .../actor-migration/s4u-actor-migration.cpp | 2 +- .../s4u/actor-suspend/s4u-actor-suspend.cpp | 4 +- examples/s4u/actor-yield/s4u-actor-yield.cpp | 6 +- .../s4u/app-bittorrent/s4u-bittorrent.cpp | 10 +-- .../s4u/app-chainsend/s4u-app-chainsend.cpp | 2 +- .../app-masterworker/s4u-app-masterworker.cpp | 8 +- .../s4u/app-pingpong/s4u-app-pingpong.cpp | 2 +- .../s4u/app-token-ring/s4u-app-token-ring.cpp | 8 +- examples/s4u/async-wait/s4u-async-wait.cpp | 4 +- .../s4u/async-waitall/s4u-async-waitall.cpp | 4 +- .../s4u/async-waitany/s4u-async-waitany.cpp | 8 +- .../s4u/cloud-capping/s4u-cloud-capping.cpp | 2 +- .../cloud-migration/s4u-cloud-migration.cpp | 2 +- .../s4u/cloud-simple/s4u-cloud-simple.cpp | 2 +- examples/s4u/dht-chord/s4u-dht-chord.cpp | 8 +- .../s4u/dht-kademlia/s4u-dht-kademlia.cpp | 6 +- examples/s4u/energy-boot/s4u-energy-boot.cpp | 2 +- examples/s4u/energy-exec/s4u-energy-exec.cpp | 2 +- examples/s4u/energy-link/s4u-energy-link.cpp | 2 +- examples/s4u/energy-vm/s4u-energy-vm.cpp | 2 +- examples/s4u/exec-async/s4u-exec-async.cpp | 2 +- examples/s4u/exec-basic/s4u-exec-basic.cpp | 2 +- examples/s4u/exec-dvfs/s4u-exec-dvfs.cpp | 2 +- .../s4u/exec-monitor/s4u-exec-monitor.cpp | 2 +- examples/s4u/exec-ptask/s4u-exec-ptask.cpp | 4 +- examples/s4u/exec-remote/s4u-exec-remote.cpp | 2 +- .../s4u/io-file-remote/s4u-io-file-remote.cpp | 6 +- .../s4u/io-file-system/s4u-io-file-system.cpp | 2 +- .../s4u/io-storage-raw/s4u-io-storage-raw.cpp | 2 +- examples/s4u/mutex/s4u-mutex.cpp | 2 +- .../s4u-platform-properties.cpp | 14 +-- .../plugin-hostload/s4u-plugin-hostload.cpp | 2 +- examples/s4u/replay-comm/s4u-replay-comm.cpp | 6 +- .../s4u/replay-storage/s4u-replay-storage.cpp | 6 +- .../s4u-routing-get-clusters.cpp | 2 +- .../s4u/trace-platform/s4u-trace-platform.cpp | 2 +- include/simgrid/s4u/Engine.hpp | 85 ++++++++++++++----- include/simgrid/simix.hpp | 2 +- src/s4u/s4u_Engine.cpp | 32 +++---- src/s4u/s4u_Host.cpp | 12 +-- src/s4u/s4u_Storage.cpp | 4 +- src/simdag/sd_dotloader.cpp | 2 +- src/simdag/sd_global.cpp | 2 +- src/simgrid/host.cpp | 6 +- src/simix/smx_deployment.cpp | 2 +- src/smpi/internals/smpi_deployment.cpp | 2 +- src/surf/plugins/host_energy.cpp | 4 +- src/surf/sg_platf.cpp | 4 +- src/surf/xml/simgrid.dtd | 6 +- teshsuite/s4u/actor/actor.cpp | 2 +- .../cloud-interrupt-migration.cpp | 2 +- teshsuite/s4u/comm-pt2pt/comm-pt2pt.cpp | 2 +- teshsuite/s4u/concurrent_rw/concurrent_rw.cpp | 2 +- .../s4u/host_on_off_wait/host_on_off_wait.cpp | 2 +- teshsuite/s4u/listen_async/listen_async.cpp | 2 +- teshsuite/s4u/pid/pid.cpp | 2 +- .../storage_client_server.cpp | 2 +- 62 files changed, 192 insertions(+), 145 deletions(-) diff --git a/examples/s4u/actor-create/s4u-actor-create.cpp b/examples/s4u/actor-create/s4u-actor-create.cpp index 3e3d1e9b39..5b5c71bdde 100644 --- a/examples/s4u/actor-create/s4u-actor-create.cpp +++ b/examples/s4u/actor-create/s4u-actor-create.cpp @@ -91,7 +91,7 @@ int main(int argc, char** argv) simgrid::s4u::Engine e(&argc, argv); /* Then you should load a platform file, describing your simulated platform */ - e.loadPlatform("../../platforms/small_platform.xml"); + e.load_platform("../../platforms/small_platform.xml"); /* And now you have to ask SimGrid to actually start your actors. * @@ -109,7 +109,7 @@ int main(int argc, char** argv) /* The third way to start your actors is to use a deployment file. */ e.registerFunction("receiver"); // You first have to register the actor as with the second approach - e.loadDeployment("s4u-actor-create_d.xml"); // And then, you load the deployment file + e.load_deployment("s4u-actor-create_d.xml"); // And then, you load the deployment file /* Once every actors are started in the engine, the simulation can start */ e.run(); diff --git a/examples/s4u/actor-daemon/s4u-actor-daemon.cpp b/examples/s4u/actor-daemon/s4u-actor-daemon.cpp index 9e83e959c5..9cb3028b9c 100644 --- a/examples/s4u/actor-daemon/s4u-actor-daemon.cpp +++ b/examples/s4u/actor-daemon/s4u-actor-daemon.cpp @@ -33,7 +33,7 @@ int main(int argc, char* argv[]) { simgrid::s4u::Engine e(&argc, argv); - e.loadPlatform(argv[1]); + e.load_platform(argv[1]); simgrid::s4u::Actor::create("worker", simgrid::s4u::Host::by_name("Boivin"), worker); simgrid::s4u::Actor::create("daemon", simgrid::s4u::Host::by_name("Tremblay"), my_daemon); diff --git a/examples/s4u/actor-join/s4u-actor-join.cpp b/examples/s4u/actor-join/s4u-actor-join.cpp index e91264c1cb..f159dd2e3e 100644 --- a/examples/s4u/actor-join/s4u-actor-join.cpp +++ b/examples/s4u/actor-join/s4u-actor-join.cpp @@ -52,7 +52,7 @@ int main(int argc, char* argv[]) simgrid::s4u::Engine e(&argc, argv); xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s msg_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("Tremblay"), master); diff --git a/examples/s4u/actor-kill/s4u-actor-kill.cpp b/examples/s4u/actor-kill/s4u-actor-kill.cpp index 7bac6a7f76..3442fd22e5 100644 --- a/examples/s4u/actor-kill/s4u-actor-kill.cpp +++ b/examples/s4u/actor-kill/s4u-actor-kill.cpp @@ -73,7 +73,7 @@ int main(int argc, char* argv[]) simgrid::s4u::Engine e(&argc, argv); xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]); - e.loadPlatform(argv[1]); /* - Load the platform description */ + e.load_platform(argv[1]); /* - Load the platform description */ /* - Create and deploy killer process, that will create the victim actors */ simgrid::s4u::Actor::create("killer", simgrid::s4u::Host::by_name("Tremblay"), killer); diff --git a/examples/s4u/actor-lifetime/s4u-actor-lifetime.cpp b/examples/s4u/actor-lifetime/s4u-actor-lifetime.cpp index 0390881e0e..16b693cc60 100644 --- a/examples/s4u/actor-lifetime/s4u-actor-lifetime.cpp +++ b/examples/s4u/actor-lifetime/s4u-actor-lifetime.cpp @@ -39,9 +39,9 @@ int main(int argc, char* argv[]) "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]); - e.loadPlatform(argv[1]); /* - Load the platform description */ + e.load_platform(argv[1]); /* - Load the platform description */ e.registerFunction("sleeper"); - e.loadDeployment(argv[2]); /* - Deploy the sleeper processes with explicit start/kill times */ + e.load_deployment(argv[2]); /* - Deploy the sleeper processes with explicit start/kill times */ e.run(); /* - Run the simulation */ diff --git a/examples/s4u/actor-migration/s4u-actor-migration.cpp b/examples/s4u/actor-migration/s4u-actor-migration.cpp index 60a77821f3..d6fb4c5fda 100644 --- a/examples/s4u/actor-migration/s4u-actor-migration.cpp +++ b/examples/s4u/actor-migration/s4u-actor-migration.cpp @@ -62,7 +62,7 @@ int main(int argc, char* argv[]) { simgrid::s4u::Engine e(&argc, argv); xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]); - e.loadPlatform(argv[1]); + e.load_platform(argv[1]); simgrid::s4u::Actor::create("monitor", simgrid::s4u::Host::by_name("Boivin"), monitor); e.run(); diff --git a/examples/s4u/actor-suspend/s4u-actor-suspend.cpp b/examples/s4u/actor-suspend/s4u-actor-suspend.cpp index 757d2eed57..57b7d0ce2b 100644 --- a/examples/s4u/actor-suspend/s4u-actor-suspend.cpp +++ b/examples/s4u/actor-suspend/s4u-actor-suspend.cpp @@ -69,8 +69,8 @@ int main(int argc, char* argv[]) simgrid::s4u::Engine e(&argc, argv); xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]); - e.loadPlatform(argv[1]); /* - Load the platform description */ - std::vector list = e.getAllHosts(); + e.load_platform(argv[1]); /* - Load the platform description */ + std::vector list = e.get_all_hosts(); simgrid::s4u::Actor::create("dream_master", list.front(), dream_master); e.run(); /* - Run the simulation */ diff --git a/examples/s4u/actor-yield/s4u-actor-yield.cpp b/examples/s4u/actor-yield/s4u-actor-yield.cpp index 982bf187bf..8fc130c6fe 100644 --- a/examples/s4u/actor-yield/s4u-actor-yield.cpp +++ b/examples/s4u/actor-yield/s4u-actor-yield.cpp @@ -36,10 +36,10 @@ int main(int argc, char* argv[]) "\tExample: %s platform.xml deployment.xml\n", argv[0], argv[0]); - e.loadPlatform(argv[1]); /* - Load the platform description */ - e.registerFunction("yielder"); + e.load_platform(argv[1]); /* - Load the platform description */ + e.register_function("yielder"); - e.loadDeployment(argv[2]); + e.load_deployment(argv[2]); e.run(); /* - Run the simulation */ diff --git a/examples/s4u/app-bittorrent/s4u-bittorrent.cpp b/examples/s4u/app-bittorrent/s4u-bittorrent.cpp index b9b72d9db0..66bcd81b16 100644 --- a/examples/s4u/app-bittorrent/s4u-bittorrent.cpp +++ b/examples/s4u/app-bittorrent/s4u-bittorrent.cpp @@ -17,17 +17,17 @@ int main(int argc, char* argv[]) /* Check the arguments */ xbt_assert(argc > 2, "Usage: %s platform_file deployment_file", argv[0]); - e.loadPlatform(argv[1]); + e.load_platform(argv[1]); HostBittorrent::EXTENSION_ID = simgrid::s4u::Host::extension_create(); - std::vector list = simgrid::s4u::Engine::getInstance()->getAllHosts(); + std::vector list = simgrid::s4u::Engine::getInstance()->get_all_hosts(); for (auto const& host : list) host->extension_set(new HostBittorrent(host)); - e.registerFunction("tracker"); - e.registerFunction("peer"); - e.loadDeployment(argv[2]); + e.register_function("tracker"); + e.register_function("peer"); + e.load_deployment(argv[2]); e.run(); diff --git a/examples/s4u/app-chainsend/s4u-app-chainsend.cpp b/examples/s4u/app-chainsend/s4u-app-chainsend.cpp index e465c208f0..0a81c22505 100644 --- a/examples/s4u/app-chainsend/s4u-app-chainsend.cpp +++ b/examples/s4u/app-chainsend/s4u-app-chainsend.cpp @@ -187,7 +187,7 @@ int main(int argc, char* argv[]) { simgrid::s4u::Engine e(&argc, argv); - e.loadPlatform(argv[1]); + e.load_platform(argv[1]); simgrid::s4u::Actor::create("broadcaster", simgrid::s4u::Host::by_name("node-0.acme.org"), broadcaster, 8, 256); diff --git a/examples/s4u/app-masterworker/s4u-app-masterworker.cpp b/examples/s4u/app-masterworker/s4u-app-masterworker.cpp index 7265a80215..47420c8a30 100644 --- a/examples/s4u/app-masterworker/s4u-app-masterworker.cpp +++ b/examples/s4u/app-masterworker/s4u-app-masterworker.cpp @@ -89,10 +89,10 @@ int main(int argc, char* argv[]) "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]); - e.loadPlatform(argv[1]); /** - Load the platform description */ - e.registerFunction("master"); - e.registerFunction("worker"); /** - Register the function to be executed by the processes */ - e.loadDeployment(argv[2]); /** - Deploy the application */ + e.load_platform(argv[1]); /** - Load the platform description */ + e.register_function("master"); + e.register_function("worker"); /** - Register the function to be executed by the processes */ + e.load_deployment(argv[2]); /** - Deploy the application */ e.run(); /** - Run the simulation */ diff --git a/examples/s4u/app-pingpong/s4u-app-pingpong.cpp b/examples/s4u/app-pingpong/s4u-app-pingpong.cpp index e09f35ea5e..c94df9ccc0 100644 --- a/examples/s4u/app-pingpong/s4u-app-pingpong.cpp +++ b/examples/s4u/app-pingpong/s4u-app-pingpong.cpp @@ -56,7 +56,7 @@ int main(int argc, char* argv[]) { simgrid::s4u::Engine e(&argc, argv); - e.loadPlatform(argv[1]); + e.load_platform(argv[1]); std::vector args; args.push_back("Jupiter"); simgrid::s4u::Actor::create("pinger", simgrid::s4u::Host::by_name("Tremblay"), pinger, args); diff --git a/examples/s4u/app-token-ring/s4u-app-token-ring.cpp b/examples/s4u/app-token-ring/s4u-app-token-ring.cpp index fec72b7ccc..5bf49e8c5d 100644 --- a/examples/s4u/app-token-ring/s4u-app-token-ring.cpp +++ b/examples/s4u/app-token-ring/s4u-app-token-ring.cpp @@ -29,7 +29,7 @@ public: ia.what()); } my_mailbox = simgrid::s4u::Mailbox::byName(std::to_string(rank)); - if (rank + 1 == simgrid::s4u::Engine::getInstance()->getHostCount()) + if (rank + 1 == simgrid::s4u::Engine::getInstance()->get_host_count()) /* The last process, which sends the token back to rank 0 */ neighbor_mailbox = simgrid::s4u::Mailbox::byName("0"); else @@ -56,11 +56,11 @@ int main(int argc, char** argv) { simgrid::s4u::Engine e(&argc, argv); xbt_assert(argc > 1, "Usage: %s platform.xml\n", argv[0]); - e.loadPlatform(argv[1]); + e.load_platform(argv[1]); - XBT_INFO("Number of hosts '%zu'", e.getHostCount()); + XBT_INFO("Number of hosts '%zu'", e.get_host_count()); int id = 0; - std::vector list = e.getAllHosts(); + std::vector list = e.get_all_hosts(); for (auto const& host : list) { /* - Give a unique rank to each host and create a @ref relay_runner process on each */ simgrid::s4u::Actor::create((std::to_string(id)).c_str(), host, RelayRunner()); diff --git a/examples/s4u/async-wait/s4u-async-wait.cpp b/examples/s4u/async-wait/s4u-async-wait.cpp index f675ce041e..c8a344c548 100644 --- a/examples/s4u/async-wait/s4u-async-wait.cpp +++ b/examples/s4u/async-wait/s4u-async-wait.cpp @@ -106,8 +106,8 @@ int main(int argc, char *argv[]) e.registerFunction("sender"); e.registerFunction("receiver"); - e.loadPlatform(argv[1]); - e.loadDeployment(argv[2]); + e.load_platform(argv[1]); + e.load_deployment(argv[2]); e.run(); return 0; diff --git a/examples/s4u/async-waitall/s4u-async-waitall.cpp b/examples/s4u/async-waitall/s4u-async-waitall.cpp index 6e483c8ff2..4d2c49c77b 100644 --- a/examples/s4u/async-waitall/s4u-async-waitall.cpp +++ b/examples/s4u/async-waitall/s4u-async-waitall.cpp @@ -102,8 +102,8 @@ int main(int argc, char *argv[]) e.registerFunction("sender"); e.registerFunction("receiver"); - e.loadPlatform(argv[1]); - e.loadDeployment(argv[2]); + e.load_platform(argv[1]); + e.load_deployment(argv[2]); e.run(); return 0; diff --git a/examples/s4u/async-waitany/s4u-async-waitany.cpp b/examples/s4u/async-waitany/s4u-async-waitany.cpp index 6cb74a1889..79d0ebf209 100644 --- a/examples/s4u/async-waitany/s4u-async-waitany.cpp +++ b/examples/s4u/async-waitany/s4u-async-waitany.cpp @@ -115,11 +115,11 @@ int main(int argc, char *argv[]) xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n", argv[0]); simgrid::s4u::Engine e(&argc, argv); - e.registerFunction("sender"); - e.registerFunction("receiver"); + e.register_function("sender"); + e.register_function("receiver"); - e.loadPlatform(argv[1]); - e.loadDeployment(argv[2]); + e.load_platform(argv[1]); + e.load_deployment(argv[2]); e.run(); return 0; diff --git a/examples/s4u/cloud-capping/s4u-cloud-capping.cpp b/examples/s4u/cloud-capping/s4u-cloud-capping.cpp index 95bc71ac5b..c0281b0e55 100644 --- a/examples/s4u/cloud-capping/s4u-cloud-capping.cpp +++ b/examples/s4u/cloud-capping/s4u-cloud-capping.cpp @@ -249,7 +249,7 @@ 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); diff --git a/examples/s4u/cloud-migration/s4u-cloud-migration.cpp b/examples/s4u/cloud-migration/s4u-cloud-migration.cpp index 51e747b188..cfb9e08b6f 100644 --- a/examples/s4u/cloud-migration/s4u-cloud-migration.cpp +++ b/examples/s4u/cloud-migration/s4u-cloud-migration.cpp @@ -88,7 +88,7 @@ int main(int argc, char* argv[]) sg_vm_live_migration_plugin_init(); /* load the platform file */ - e.loadPlatform(argv[1]); + e.load_platform(argv[1]); simgrid::s4u::Actor::create("master_", simgrid::s4u::Host::by_name("Fafard"), master_main); diff --git a/examples/s4u/cloud-simple/s4u-cloud-simple.cpp b/examples/s4u/cloud-simple/s4u-cloud-simple.cpp index be899fb195..ba2a67d57b 100644 --- a/examples/s4u/cloud-simple/s4u-cloud-simple.cpp +++ b/examples/s4u/cloud-simple/s4u-cloud-simple.cpp @@ -210,7 +210,7 @@ int main(int argc, char* argv[]) { simgrid::s4u::Engine e(&argc, argv); sg_vm_live_migration_plugin_init(); - e.loadPlatform(argv[1]); /* - Load the platform description */ + e.load_platform(argv[1]); /* - Load the platform description */ simgrid::s4u::Actor::create("master_", simgrid::s4u::Host::by_name("Fafard"), master_main); diff --git a/examples/s4u/dht-chord/s4u-dht-chord.cpp b/examples/s4u/dht-chord/s4u-dht-chord.cpp index f0a2575c1e..1b261349ca 100644 --- a/examples/s4u/dht-chord/s4u-dht-chord.cpp +++ b/examples/s4u/dht-chord/s4u-dht-chord.cpp @@ -28,7 +28,7 @@ static void chord_init() HostChord::EXTENSION_ID = simgrid::s4u::Host::extension_create(); - std::vector list = simgrid::s4u::Engine::getInstance()->getAllHosts(); + std::vector list = simgrid::s4u::Engine::getInstance()->get_all_hosts(); for (auto const& host : list) host->extension_set(new HostChord(host)); } @@ -62,12 +62,12 @@ int main(int argc, char* argv[]) options++; } - e.loadPlatform(options[0]); + e.load_platform(options[0]); chord_init(); - e.registerFunction("node"); - e.loadDeployment(options[1]); + e.register_function("node"); + e.load_deployment(options[1]); e.run(); diff --git a/examples/s4u/dht-kademlia/s4u-dht-kademlia.cpp b/examples/s4u/dht-kademlia/s4u-dht-kademlia.cpp index ac7c9d77e9..edf9c5c280 100644 --- a/examples/s4u/dht-kademlia/s4u-dht-kademlia.cpp +++ b/examples/s4u/dht-kademlia/s4u-dht-kademlia.cpp @@ -90,9 +90,9 @@ int main(int argc, char* argv[]) xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n\tExample: %s cluster.xml dht-kademlia_d.xml\n", argv[0], argv[0]); - e.loadPlatform(argv[1]); - e.registerFunction("node", node); - e.loadDeployment(argv[2]); + e.load_platform(argv[1]); + e.register_function("node", node); + e.load_deployment(argv[2]); e.run(); diff --git a/examples/s4u/energy-boot/s4u-energy-boot.cpp b/examples/s4u/energy-boot/s4u-energy-boot.cpp index 0085dde5ca..9d5aac85ae 100644 --- a/examples/s4u/energy-boot/s4u-energy-boot.cpp +++ b/examples/s4u/energy-boot/s4u-energy-boot.cpp @@ -104,7 +104,7 @@ int main(int argc, char* argv[]) xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s platform.xml\n", argv[0], argv[0]); - e.loadPlatform(argv[1]); + e.load_platform(argv[1]); simgrid::s4u::Actor::create("Boot Monitor", simgrid::s4u::Host::by_name("MyHost2"), monitor); e.run(); diff --git a/examples/s4u/energy-exec/s4u-energy-exec.cpp b/examples/s4u/energy-exec/s4u-energy-exec.cpp index b91d7ec07a..fa9833a87b 100644 --- a/examples/s4u/energy-exec/s4u-energy-exec.cpp +++ b/examples/s4u/energy-exec/s4u-energy-exec.cpp @@ -70,7 +70,7 @@ int main(int argc, char* argv[]) xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]); - e.loadPlatform(argv[1]); + e.load_platform(argv[1]); simgrid::s4u::Actor::create("dvfs_test", simgrid::s4u::Host::by_name("MyHost1"), dvfs); e.run(); diff --git a/examples/s4u/energy-link/s4u-energy-link.cpp b/examples/s4u/energy-link/s4u-energy-link.cpp index 2ebdf30155..6de157cc32 100644 --- a/examples/s4u/energy-link/s4u-energy-link.cpp +++ b/examples/s4u/energy-link/s4u-energy-link.cpp @@ -79,7 +79,7 @@ int main(int argc, char* argv[]) xbt_assert(argc > 1, "\nUsage: %s platform_file [flowCount [datasize]]\n" "\tExample: %s s4uplatform.xml \n", argv[0], argv[0]); - e.loadPlatform(argv[1]); + e.load_platform(argv[1]); /* prepare to launch the actors */ std::vector argSender; diff --git a/examples/s4u/energy-vm/s4u-energy-vm.cpp b/examples/s4u/energy-vm/s4u-energy-vm.cpp index 6add343a4a..ef487e932f 100644 --- a/examples/s4u/energy-vm/s4u-energy-vm.cpp +++ b/examples/s4u/energy-vm/s4u-energy-vm.cpp @@ -57,7 +57,7 @@ int main(int argc, char* argv[]) xbt_assert(argc > 1, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]); - e.loadPlatform(argv[1]); + e.load_platform(argv[1]); simgrid::s4u::Actor::create("dvfs", simgrid::s4u::Host::by_name("MyHost1"), dvfs); diff --git a/examples/s4u/exec-async/s4u-exec-async.cpp b/examples/s4u/exec-async/s4u-exec-async.cpp index 0f4c4a0c3e..fd841f4d07 100644 --- a/examples/s4u/exec-async/s4u-exec-async.cpp +++ b/examples/s4u/exec-async/s4u-exec-async.cpp @@ -21,7 +21,7 @@ static void test(double computation_amount, double priority) int main(int argc, char* argv[]) { simgrid::s4u::Engine e(&argc, argv); - e.loadPlatform(argv[1]); + e.load_platform(argv[1]); simgrid::s4u::Actor::create("test", simgrid::s4u::Host::by_name("Fafard"), test, 7.6296e+07, 1.0); simgrid::s4u::Actor::create("test", simgrid::s4u::Host::by_name("Fafard"), test, 7.6296e+07, 2.0); diff --git a/examples/s4u/exec-basic/s4u-exec-basic.cpp b/examples/s4u/exec-basic/s4u-exec-basic.cpp index 8a9683c420..4fd33fa784 100644 --- a/examples/s4u/exec-basic/s4u-exec-basic.cpp +++ b/examples/s4u/exec-basic/s4u-exec-basic.cpp @@ -43,7 +43,7 @@ int main(int argc, char* argv[]) std::vector args; xbt_assert(argc > 1, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]); - e.loadPlatform(argv[1]); + e.load_platform(argv[1]); simgrid::s4u::Actor::create("executor", simgrid::s4u::Host::by_name("Tremblay"), executor, args); simgrid::s4u::Actor::create("privileged", simgrid::s4u::Host::by_name("Tremblay"), privileged, args); diff --git a/examples/s4u/exec-dvfs/s4u-exec-dvfs.cpp b/examples/s4u/exec-dvfs/s4u-exec-dvfs.cpp index 2c44125cae..b224cc9fb8 100644 --- a/examples/s4u/exec-dvfs/s4u-exec-dvfs.cpp +++ b/examples/s4u/exec-dvfs/s4u-exec-dvfs.cpp @@ -52,7 +52,7 @@ int main(int argc, char* argv[]) xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]); - e.loadPlatform(argv[1]); + e.load_platform(argv[1]); simgrid::s4u::Actor::create("dvfs_test", simgrid::s4u::Host::by_name("MyHost1"), dvfs); simgrid::s4u::Actor::create("dvfs_test", simgrid::s4u::Host::by_name("MyHost2"), dvfs); diff --git a/examples/s4u/exec-monitor/s4u-exec-monitor.cpp b/examples/s4u/exec-monitor/s4u-exec-monitor.cpp index 994ec37ec1..3c18917bfd 100644 --- a/examples/s4u/exec-monitor/s4u-exec-monitor.cpp +++ b/examples/s4u/exec-monitor/s4u-exec-monitor.cpp @@ -39,7 +39,7 @@ static void executor() int main(int argc, char* argv[]) { simgrid::s4u::Engine e(&argc, argv); - e.loadPlatform(argv[1]); + e.load_platform(argv[1]); simgrid::s4u::Actor::create("executor", simgrid::s4u::Host::by_name("Fafard"), executor); diff --git a/examples/s4u/exec-ptask/s4u-exec-ptask.cpp b/examples/s4u/exec-ptask/s4u-exec-ptask.cpp index 4da47fe0dd..37fe2e2df0 100644 --- a/examples/s4u/exec-ptask/s4u-exec-ptask.cpp +++ b/examples/s4u/exec-ptask/s4u-exec-ptask.cpp @@ -28,7 +28,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_energyptask, "Messages specific for this s4u ex static void runner() { /* Retrieve the list of all hosts as an array of hosts */ - std::vector hosts = simgrid::s4u::Engine::getInstance()->getAllHosts(); + std::vector hosts = simgrid::s4u::Engine::getInstance()->get_all_hosts(); int hosts_count = hosts.size(); XBT_INFO("First, build a classical parallel task, with 1 Gflop to execute on each node, " @@ -95,7 +95,7 @@ int main(int argc, char* argv[]) if (argc == 3 && argv[2][2] == 'e') sg_host_energy_plugin_init(); - e.loadPlatform(argv[1]); + e.load_platform(argv[1]); /* Pick a process, no matter which, from the platform file */ simgrid::s4u::Actor::create("test", simgrid::s4u::Host::by_name("MyHost1"), runner); diff --git a/examples/s4u/exec-remote/s4u-exec-remote.cpp b/examples/s4u/exec-remote/s4u-exec-remote.cpp index 292aefb4d4..d9c43afd55 100644 --- a/examples/s4u/exec-remote/s4u-exec-remote.cpp +++ b/examples/s4u/exec-remote/s4u-exec-remote.cpp @@ -47,7 +47,7 @@ static void wizard() int main(int argc, char* argv[]) { simgrid::s4u::Engine e(&argc, argv); - e.loadPlatform(argv[1]); + e.load_platform(argv[1]); simgrid::s4u::Actor::create("test", simgrid::s4u::Host::by_name("Fafard"), wizard); e.run(); diff --git a/examples/s4u/io-file-remote/s4u-io-file-remote.cpp b/examples/s4u/io-file-remote/s4u-io-file-remote.cpp index dca06d5625..e7d1ee1a5d 100644 --- a/examples/s4u/io-file-remote/s4u-io-file-remote.cpp +++ b/examples/s4u/io-file-remote/s4u-io-file-remote.cpp @@ -51,9 +51,9 @@ int main(int argc, char** argv) { simgrid::s4u::Engine e(&argc, argv); sg_storage_file_system_init(); - e.loadPlatform(argv[1]); - e.registerFunction("host", host); - e.loadDeployment(argv[2]); + e.load_platform(argv[1]); + e.register_function("host", host); + e.load_deployment(argv[2]); std::vector allStorages = e.getAllStorages(); for (auto const& s : allStorages) { diff --git a/examples/s4u/io-file-system/s4u-io-file-system.cpp b/examples/s4u/io-file-system/s4u-io-file-system.cpp index 2e33319f0c..6f0f84b4fe 100644 --- a/examples/s4u/io-file-system/s4u-io-file-system.cpp +++ b/examples/s4u/io-file-system/s4u-io-file-system.cpp @@ -94,7 +94,7 @@ int main(int argc, char** argv) { simgrid::s4u::Engine e(&argc, argv); sg_storage_file_system_init(); - e.loadPlatform(argv[1]); + e.load_platform(argv[1]); simgrid::s4u::Actor::create("host", simgrid::s4u::Host::by_name("denise"), MyHost()); e.run(); diff --git a/examples/s4u/io-storage-raw/s4u-io-storage-raw.cpp b/examples/s4u/io-storage-raw/s4u-io-storage-raw.cpp index caf074f966..e73b588230 100644 --- a/examples/s4u/io-storage-raw/s4u-io-storage-raw.cpp +++ b/examples/s4u/io-storage-raw/s4u-io-storage-raw.cpp @@ -47,7 +47,7 @@ static void host() int main(int argc, char** argv) { simgrid::s4u::Engine e(&argc, argv); - e.loadPlatform(argv[1]); + e.load_platform(argv[1]); simgrid::s4u::Actor::create("", simgrid::s4u::Host::by_name("denise"), host); diff --git a/examples/s4u/mutex/s4u-mutex.cpp b/examples/s4u/mutex/s4u-mutex.cpp index 10b9120c6a..d3dd4f4d38 100644 --- a/examples/s4u/mutex/s4u-mutex.cpp +++ b/examples/s4u/mutex/s4u-mutex.cpp @@ -62,7 +62,7 @@ static void master() int main(int argc, char **argv) { simgrid::s4u::Engine e(&argc, argv); - e.loadPlatform("../../platforms/two_hosts.xml"); + e.load_platform("../../platforms/two_hosts.xml"); simgrid::s4u::Actor::create("main", simgrid::s4u::Host::by_name("Tremblay"), master); e.run(); diff --git a/examples/s4u/platform-properties/s4u-platform-properties.cpp b/examples/s4u/platform-properties/s4u-platform-properties.cpp index d04311c98b..a5c6c53a6c 100644 --- a/examples/s4u/platform-properties/s4u-platform-properties.cpp +++ b/examples/s4u/platform-properties/s4u-platform-properties.cpp @@ -96,21 +96,21 @@ static int bob(int argc, char* argv[]) int main(int argc, char* argv[]) { simgrid::s4u::Engine e(&argc, argv); - e.loadPlatform(argv[1]); + e.load_platform(argv[1]); - e.registerFunction("alice", alice); - e.registerFunction("bob", bob); - e.registerFunction("carole", carole); - e.registerFunction("david", david); + e.register_function("alice", alice); + e.register_function("bob", bob); + e.register_function("carole", carole); + e.register_function("david", david); size_t totalHosts = sg_host_count(); XBT_INFO("There are %zu hosts in the environment", totalHosts); - std::vector hosts = e.getAllHosts(); + std::vector hosts = e.get_all_hosts(); for (unsigned int i = 0; i < hosts.size(); i++) XBT_INFO("Host '%s' runs at %.0f flops/s", hosts[i]->get_cname(), hosts[i]->getSpeed()); - e.loadDeployment(argv[2]); + e.load_deployment(argv[2]); e.run(); return 0; diff --git a/examples/s4u/plugin-hostload/s4u-plugin-hostload.cpp b/examples/s4u/plugin-hostload/s4u-plugin-hostload.cpp index 7a5087a8dd..6345b2e956 100644 --- a/examples/s4u/plugin-hostload/s4u-plugin-hostload.cpp +++ b/examples/s4u/plugin-hostload/s4u-plugin-hostload.cpp @@ -83,7 +83,7 @@ int main(int argc, char* argv[]) simgrid::s4u::Engine e(&argc, argv); xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]); - e.loadPlatform(argv[1]); + e.load_platform(argv[1]); simgrid::s4u::Actor::create("load_test", simgrid::s4u::Host::by_name("MyHost1"), execute_load_test); simgrid::s4u::Actor::create("change_speed", simgrid::s4u::Host::by_name("MyHost1"), change_speed); diff --git a/examples/s4u/replay-comm/s4u-replay-comm.cpp b/examples/s4u/replay-comm/s4u-replay-comm.cpp index c9ee2550c6..8605a10f34 100644 --- a/examples/s4u/replay-comm/s4u-replay-comm.cpp +++ b/examples/s4u/replay-comm/s4u-replay-comm.cpp @@ -95,11 +95,11 @@ int main(int argc, char* argv[]) "\tExample: %s msg_platform.xml msg_deployment.xml ", argv[0], argv[0], argv[0]); - e.loadPlatform(argv[1]); - e.registerDefault(&simgrid::xbt::replay_runner); + e.load_platform(argv[1]); + e.register_default(&simgrid::xbt::replay_runner); e.registerFunction("p0"); e.registerFunction("p1"); - e.loadDeployment(argv[2]); + e.load_deployment(argv[2]); /* Action registration */ xbt_replay_action_register("compute", Replayer::compute); diff --git a/examples/s4u/replay-storage/s4u-replay-storage.cpp b/examples/s4u/replay-storage/s4u-replay-storage.cpp index 9869aeee0d..f1a76f2855 100644 --- a/examples/s4u/replay-storage/s4u-replay-storage.cpp +++ b/examples/s4u/replay-storage/s4u-replay-storage.cpp @@ -111,10 +111,10 @@ int main(int argc, char* argv[]) "\texample: %s platform.xml deployment.xml", argv[0], argv[0], argv[0]); - e.loadPlatform(argv[1]); - e.registerDefault(&simgrid::xbt::replay_runner); + e.load_platform(argv[1]); + e.register_default(&simgrid::xbt::replay_runner); e.registerFunction("p0"); - e.loadDeployment(argv[2]); + e.load_deployment(argv[2]); /* Action registration */ xbt_replay_action_register("open", Replayer::open); diff --git a/examples/s4u/routing-get-clusters/s4u-routing-get-clusters.cpp b/examples/s4u/routing-get-clusters/s4u-routing-get-clusters.cpp index 602c222ab7..d10b4154db 100644 --- a/examples/s4u/routing-get-clusters/s4u-routing-get-clusters.cpp +++ b/examples/s4u/routing-get-clusters/s4u-routing-get-clusters.cpp @@ -12,7 +12,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "Messages specific for this s4u example") int main(int argc, char* argv[]) { simgrid::s4u::Engine e(&argc, argv); - e.loadPlatform(argv[1]); + e.load_platform(argv[1]); std::vector* clusters = new std::vector; diff --git a/examples/s4u/trace-platform/s4u-trace-platform.cpp b/examples/s4u/trace-platform/s4u-trace-platform.cpp index a122ad20ab..e86426da59 100644 --- a/examples/s4u/trace-platform/s4u-trace-platform.cpp +++ b/examples/s4u/trace-platform/s4u-trace-platform.cpp @@ -13,7 +13,7 @@ int main(int argc, char* argv[]) { simgrid::s4u::Engine e(&argc, argv); - e.loadPlatform(argv[1]); + e.load_platform(argv[1]); e.run(); return 0; } diff --git a/include/simgrid/s4u/Engine.hpp b/include/simgrid/s4u/Engine.hpp index 636f678ed2..52224c13b8 100644 --- a/include/simgrid/s4u/Engine.hpp +++ b/include/simgrid/s4u/Engine.hpp @@ -38,38 +38,38 @@ public: * The environment is either a XML file following the simgrid.dtd formalism, or a lua file. * Some examples can be found in the directory examples/platforms. */ - void loadPlatform(const char* platf); + void load_platform(const char* platf); /** Registers the main function of an actor that will be launched from the deployment file */ - void registerFunction(const char* name, int (*code)(int, char**)); + void register_function(const char* name, int (*code)(int, char**)); /** Registers a function as the default main function of actors * * It will be used as fallback when the function requested from the deployment file was not registered. * It is used for trace-based simulations (see examples/s4u/replay-comms and similar). */ - void registerDefault(int (*code)(int, char**)); + void register_default(int (*code)(int, char**)); /** @brief Load a deployment file and launch the actors that it contains */ - void loadDeployment(const char* deploy); + void load_deployment(const char* deploy); protected: friend s4u::Host; friend s4u::Storage; - void addHost(std::string name, simgrid::s4u::Host * host); - void delHost(std::string name); - void addStorage(std::string name, simgrid::s4u::Storage * storage); - void delStorage(std::string name); + void add_host(std::string name, simgrid::s4u::Host* host); + void del_host(std::string name); + void add_storage(std::string name, simgrid::s4u::Storage* storage); + void del_storage(std::string name); public: - simgrid::s4u::Host* hostByName(std::string name); - simgrid::s4u::Host* hostByNameOrNull(std::string name); - simgrid::s4u::Storage* storageByName(std::string name); - simgrid::s4u::Storage* storageByNameOrNull(std::string name); + simgrid::s4u::Host* host_by_name(std::string name); + simgrid::s4u::Host* host_by_name_or_null(std::string name); + simgrid::s4u::Storage* storage_by_name(std::string name); + simgrid::s4u::Storage* storage_by_name_or_null(std::string name); - size_t getHostCount(); - void getHostList(std::vector * whereTo); - std::vector getAllHosts(); + size_t get_host_count(); + void get_host_list(std::vector* whereTo); + std::vector get_all_hosts(); size_t getLinkCount(); void getLinkList(std::vector * list); @@ -100,9 +100,9 @@ public: void netpointRegister(simgrid::kernel::routing::NetPoint * card); void netpointUnregister(simgrid::kernel::routing::NetPoint * card); - template void registerFunction(const char* name) + template void register_actor(const char* name) { - simgrid::simix::registerFunction(name, [](std::vector args) { + simgrid::simix::register_function(name, [](std::vector args) { return simgrid::simix::ActorCode([args] { F code(std::move(args)); code(); @@ -110,9 +110,9 @@ public: }); } - template void registerFunction(const char* name, F code) + template void register_actor(const char* name, F code) { - simgrid::simix::registerFunction(name, [code](std::vector args) { + simgrid::simix::register_function(name, [code](std::vector args) { return simgrid::simix::ActorCode([code, args] { code(std::move(args)); }); }); } @@ -129,6 +129,53 @@ public: */ void setConfig(std::string str); + XBT_ATTRIB_DEPRECATED_v323("Please use Engine::load_platform()") void loadPlatform(const char* platf) + { + load_platform(platf); + } + XBT_ATTRIB_DEPRECATED_v323("Please use Engine::register_function()") void registerFunction(const char* name, + int (*code)(int, char**)) + { + register_function(name, code); + } + XBT_ATTRIB_DEPRECATED_v323("Please use Engine::register_default()") void registerDefault(int (*code)(int, char**)) + { + register_default(code); + } + XBT_ATTRIB_DEPRECATED_v323("Please use Engine::load_deployment()") void loadDeployment(const char* deploy) + { + load_deployment(deploy); + } + XBT_ATTRIB_DEPRECATED_v323("Please use Engine::host_by_name()") simgrid::s4u::Host* hostByName(std::string name) + { + return host_by_name(name); + } + XBT_ATTRIB_DEPRECATED_v323("Please use Engine::host_by_name_or_null()") simgrid::s4u::Host* hostByNameOrNull( + std::string name) + { + return host_by_name_or_null(name); + } + XBT_ATTRIB_DEPRECATED_v323("Please use Engine::storage_by_name()") simgrid::s4u::Storage* storageByName( + std::string name) + { + return storage_by_name(name); + } + XBT_ATTRIB_DEPRECATED_v323("Please use Engine::storage_by_name_or_null()") simgrid::s4u::Storage* storageByNameOrNull( + std::string name) + { + return storage_by_name_or_null(name); + } + + XBT_ATTRIB_DEPRECATED_v323("Please use Engine::get_host_count()") size_t getHostCount() { return get_host_count(); } + XBT_ATTRIB_DEPRECATED_v323("Please use Engine::get_host_list()") void getHostList(std::vector* whereTo) + { + get_host_list(whereTo); + } + XBT_ATTRIB_DEPRECATED_v323("Please use Engine::get_all_hosts()") std::vector getAllHosts() + { + return get_all_hosts(); + } + simgrid::kernel::EngineImpl* pimpl; private: diff --git a/include/simgrid/simix.hpp b/include/simgrid/simix.hpp index 172ebe9891..ff4625b36e 100644 --- a/include/simgrid/simix.hpp +++ b/include/simgrid/simix.hpp @@ -77,7 +77,7 @@ typedef std::function ActorCode; // Create ActorCode based on argv: typedef std::function args)> ActorCodeFactory; -XBT_PUBLIC void registerFunction(const char* name, ActorCodeFactory factory); +XBT_PUBLIC void register_function(const char* name, ActorCodeFactory factory); /** These functions will be called when we detect a deadlock: any remaining process is locked on an action * diff --git a/src/s4u/s4u_Engine.cpp b/src/s4u/s4u_Engine.cpp index 5374db3345..8d1a71ed6e 100644 --- a/src/s4u/s4u_Engine.cpp +++ b/src/s4u/s4u_Engine.cpp @@ -66,25 +66,25 @@ double Engine::getClock() return SIMIX_get_clock(); } -void Engine::loadPlatform(const char* platf) +void Engine::load_platform(const char* platf) { SIMIX_create_environment(platf); } -void Engine::registerFunction(const char* name, int (*code)(int, char**)) +void Engine::register_function(const char* name, int (*code)(int, char**)) { SIMIX_function_register(name, code); } -void Engine::registerDefault(int (*code)(int, char**)) +void Engine::register_default(int (*code)(int, char**)) { SIMIX_function_register_default(code); } -void Engine::loadDeployment(const char* deploy) +void Engine::load_deployment(const char* deploy) { SIMIX_launch_application(deploy); } /** @brief Returns the amount of hosts in the platform */ -size_t Engine::getHostCount() +size_t Engine::get_host_count() { return pimpl->hosts_.size(); } @@ -92,15 +92,15 @@ size_t Engine::getHostCount() * @deprecated Please prefer Engine::getAllHosts() */ void XBT_ATTRIB_DEPRECATED_v322( - "Engine::getHostList() is deprecated in favor of Engine::getAllHosts(). Please switch before v3.22") - Engine::getHostList(std::vector* list) + "Engine::getHostList() is deprecated in favor of Engine::get_all_hosts(). Please switch before v3.22") + Engine::get_host_list(std::vector* list) { for (auto const& kv : pimpl->hosts_) list->push_back(kv.second); } /** @brief Returns the list of all hosts found in the platform */ -std::vector Engine::getAllHosts() +std::vector Engine::get_all_hosts() { std::vector res; for (auto const& kv : pimpl->hosts_) @@ -108,22 +108,22 @@ std::vector Engine::getAllHosts() return res; } -void Engine::addHost(std::string name, simgrid::s4u::Host* host) +void Engine::add_host(std::string name, simgrid::s4u::Host* host) { pimpl->hosts_[name] = host; } -void Engine::delHost(std::string name) +void Engine::del_host(std::string name) { pimpl->hosts_.erase(name); } -simgrid::s4u::Host* Engine::hostByName(std::string name) +simgrid::s4u::Host* Engine::host_by_name(std::string name) { return pimpl->hosts_.at(name); // Will raise a std::out_of_range if the host does not exist } -simgrid::s4u::Host* Engine::hostByNameOrNull(std::string name) +simgrid::s4u::Host* Engine::host_by_name_or_null(std::string name) { auto host = pimpl->hosts_.find(name); return host == pimpl->hosts_.end() ? nullptr : host->second; @@ -138,23 +138,23 @@ std::vector Engine::getAllStorages() return res; } -simgrid::s4u::Storage* Engine::storageByName(std::string name) +simgrid::s4u::Storage* Engine::storage_by_name(std::string name) { return pimpl->storages_.at(name); // Will raise a std::out_of_range if the host does not exist } -simgrid::s4u::Storage* Engine::storageByNameOrNull(std::string name) +simgrid::s4u::Storage* Engine::storage_by_name_or_null(std::string name) { auto storage = pimpl->storages_.find(name); return storage == pimpl->storages_.end() ? nullptr : storage->second; } -void Engine::addStorage(std::string name, simgrid::s4u::Storage* storage) +void Engine::add_storage(std::string name, simgrid::s4u::Storage* storage) { pimpl->storages_[name] = storage; } -void Engine::delStorage(std::string name) +void Engine::del_storage(std::string name) { pimpl->storages_.erase(name); } diff --git a/src/s4u/s4u_Host.cpp b/src/s4u/s4u_Host.cpp index f65d3f0986..7ab0c6f23d 100644 --- a/src/s4u/s4u_Host.cpp +++ b/src/s4u/s4u_Host.cpp @@ -30,7 +30,7 @@ simgrid::xbt::signal Host::onSpeedChange; Host::Host(const char* name) : name_(name) { xbt_assert(Host::by_name_or_null(name) == nullptr, "Refusing to create a second host named '%s'.", name); - Engine::getInstance()->addHost(std::string(name_), this); + Engine::getInstance()->add_host(std::string(name_), this); new simgrid::surf::HostImpl(this); } @@ -58,26 +58,26 @@ void Host::destroy() if (not currentlyDestroying_) { currentlyDestroying_ = true; onDestruction(*this); - Engine::getInstance()->delHost(std::string(name_)); + Engine::getInstance()->del_host(std::string(name_)); delete this; } } Host* Host::by_name(std::string name) { - return Engine::getInstance()->hostByName(name); + return Engine::getInstance()->host_by_name(name); } Host* Host::by_name(const char* name) { - return Engine::getInstance()->hostByName(std::string(name)); + return Engine::getInstance()->host_by_name(std::string(name)); } Host* Host::by_name_or_null(const char* name) { - return Engine::getInstance()->hostByNameOrNull(std::string(name)); + return Engine::getInstance()->host_by_name_or_null(std::string(name)); } Host* Host::by_name_or_null(std::string name) { - return Engine::getInstance()->hostByNameOrNull(name); + return Engine::getInstance()->host_by_name_or_null(name); } Host* Host::current() diff --git a/src/s4u/s4u_Storage.cpp b/src/s4u/s4u_Storage.cpp index 4179d0cf87..c26d4a556c 100644 --- a/src/s4u/s4u_Storage.cpp +++ b/src/s4u/s4u_Storage.cpp @@ -29,12 +29,12 @@ void XBT_ATTRIB_DEPRECATED_v322( Storage::Storage(std::string name, surf::StorageImpl* pimpl) : pimpl_(pimpl), name_(name) { - simgrid::s4u::Engine::getInstance()->addStorage(name, this); + simgrid::s4u::Engine::getInstance()->add_storage(name, this); } Storage* Storage::byName(std::string name) { - return Engine::getInstance()->storageByNameOrNull(name); + return Engine::getInstance()->storage_by_name_or_null(name); } const std::string& Storage::get_name() const diff --git a/src/simdag/sd_dotloader.cpp b/src/simdag/sd_dotloader.cpp index db121d754a..ddea1a77d0 100644 --- a/src/simdag/sd_dotloader.cpp +++ b/src/simdag/sd_dotloader.cpp @@ -213,7 +213,7 @@ xbt_dynar_t SD_dotload_generic(const char* filename, bool sequential, bool sched if(schedule){ if (schedule_success) { - std::vector hosts = simgrid::s4u::Engine::getInstance()->getAllHosts(); + std::vector hosts = simgrid::s4u::Engine::getInstance()->get_all_hosts(); for (auto const& elm : computers) { SD_task_t previous_task = nullptr; diff --git a/src/simdag/sd_global.cpp b/src/simdag/sd_global.cpp index 81ed28ad34..81682d44d5 100644 --- a/src/simdag/sd_global.cpp +++ b/src/simdag/sd_global.cpp @@ -200,7 +200,7 @@ void SD_config(const char *key, const char *value){ */ void SD_create_environment(const char *platform_file) { - simgrid::s4u::Engine::getInstance()->loadPlatform(platform_file); + simgrid::s4u::Engine::getInstance()->load_platform(platform_file); XBT_DEBUG("Host number: %zu, link number: %d", sg_host_count(), sg_link_count()); #if SIMGRID_HAVE_JEDULE diff --git a/src/simgrid/host.cpp b/src/simgrid/host.cpp index f4a89018df..ad422c6b7a 100644 --- a/src/simgrid/host.cpp +++ b/src/simgrid/host.cpp @@ -21,7 +21,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sg_host, sd, "Logging specific to sg_hosts"); size_t sg_host_count() { - return simgrid::s4u::Engine::getInstance()->getHostCount(); + return simgrid::s4u::Engine::getInstance()->get_host_count(); } /** @brief Returns the host list * @@ -35,7 +35,7 @@ size_t sg_host_count() */ sg_host_t *sg_host_list() { xbt_assert(sg_host_count() > 0, "There is no host!"); - std::vector hosts = simgrid::s4u::Engine::getInstance()->getAllHosts(); + std::vector hosts = simgrid::s4u::Engine::getInstance()->get_all_hosts(); sg_host_t* res = (sg_host_t*)malloc(sizeof(sg_host_t) * hosts.size()); memcpy(res, hosts.data(), sizeof(sg_host_t) * hosts.size()); @@ -73,7 +73,7 @@ xbt_dynar_t sg_hosts_as_dynar() { xbt_dynar_t res = xbt_dynar_new(sizeof(sg_host_t),nullptr); - std::vector list = simgrid::s4u::Engine::getInstance()->getAllHosts(); + std::vector list = simgrid::s4u::Engine::getInstance()->get_all_hosts(); for (auto const& host : list) { if (host && host->pimpl_netpoint && host->pimpl_netpoint->is_host()) diff --git a/src/simix/smx_deployment.cpp b/src/simix/smx_deployment.cpp index d2ff0f1765..8e11f4aad8 100644 --- a/src/simix/smx_deployment.cpp +++ b/src/simix/smx_deployment.cpp @@ -146,7 +146,7 @@ void SIMIX_process_set_function(const char* process_host, const char* process_fu namespace simgrid { namespace simix { -void registerFunction(const char* name, ActorCodeFactory factory) +void register_function(const char* name, ActorCodeFactory factory) { simix_global->registered_functions[name] = std::move(factory); } diff --git a/src/smpi/internals/smpi_deployment.cpp b/src/smpi/internals/smpi_deployment.cpp index 4e05a95ef0..a3dbcef96e 100644 --- a/src/smpi/internals/smpi_deployment.cpp +++ b/src/smpi/internals/smpi_deployment.cpp @@ -58,7 +58,7 @@ void SMPI_app_instance_register(const char *name, xbt_main_func_t code, int num_ static int already_called = 0; if (not already_called) { already_called = 1; - std::vector list = simgrid::s4u::Engine::getInstance()->getAllHosts(); + std::vector list = simgrid::s4u::Engine::getInstance()->get_all_hosts(); for (auto const& host : list) { host->extension_set(new simgrid::smpi::SmpiHost(host)); } diff --git a/src/surf/plugins/host_energy.cpp b/src/surf/plugins/host_energy.cpp index 0b3ca1d3b5..7bf554eee9 100644 --- a/src/surf/plugins/host_energy.cpp +++ b/src/surf/plugins/host_energy.cpp @@ -424,7 +424,7 @@ static void onHostDestruction(simgrid::s4u::Host& host) static void onSimulationEnd() { - std::vector hosts = simgrid::s4u::Engine::getInstance()->getAllHosts(); + std::vector hosts = simgrid::s4u::Engine::getInstance()->get_all_hosts(); double total_energy = 0.0; // Total energy consumption (whole platform) double used_hosts_energy = 0.0; // Energy consumed by hosts that computed something @@ -474,7 +474,7 @@ void sg_host_energy_plugin_init() void sg_host_energy_update_all() { simgrid::simix::kernelImmediate([]() { - std::vector list = simgrid::s4u::Engine::getInstance()->getAllHosts(); + std::vector list = simgrid::s4u::Engine::getInstance()->get_all_hosts(); for (auto const& host : list) if (dynamic_cast(host) == nullptr) // Ignore virtual machines host->extension()->update(); diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index 3f290e77be..fae502ce36 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -391,7 +391,7 @@ void sg_platf_new_mount(simgrid::kernel::routing::MountCreationArgs* mount) if (mount_list.empty()) XBT_DEBUG("Create a Mount list for %s", A_surfxml_host_id); - mount_list.insert({mount->name, simgrid::s4u::Engine::getInstance()->storageByName(mount->storageId)->getImpl()}); + mount_list.insert({mount->name, simgrid::s4u::Engine::getInstance()->storage_by_name(mount->storageId)->getImpl()}); } void sg_platf_new_route(simgrid::kernel::routing::RouteCreationArgs* route) @@ -414,7 +414,7 @@ void sg_platf_new_actor(simgrid::kernel::routing::ActorCreationArgs* actor) std::string msg = std::string("Cannot create actor '") + actor->function + "': host '" + actor->host + "' does not exist\nExisting hosts: '"; - std::vector list = simgrid::s4u::Engine::getInstance()->getAllHosts(); + std::vector list = simgrid::s4u::Engine::getInstance()->get_all_hosts(); for (auto const& host : list) { msg += host->get_name(); diff --git a/src/surf/xml/simgrid.dtd b/src/surf/xml/simgrid.dtd index c28d7619c0..05de4d72e1 100644 --- a/src/surf/xml/simgrid.dtd +++ b/src/surf/xml/simgrid.dtd @@ -201,21 +201,21 @@ To upgrade your files, use the tool simgrid_update_xml - + - + - + diff --git a/teshsuite/s4u/actor/actor.cpp b/teshsuite/s4u/actor/actor.cpp index 9b47529641..c30560219b 100644 --- a/teshsuite/s4u/actor/actor.cpp +++ b/teshsuite/s4u/actor/actor.cpp @@ -55,7 +55,7 @@ static void master() int main(int argc, char* argv[]) { simgrid::s4u::Engine e(&argc, argv); - e.loadPlatform(argv[1]); + e.load_platform(argv[1]); simgrid::s4u::Actor::create("master", simgrid::s4u::Host::by_name("Tremblay"), master); simgrid::s4u::Actor::create("worker", simgrid::s4u::Host::by_name("Tremblay"), worker); diff --git a/teshsuite/s4u/cloud-interrupt-migration/cloud-interrupt-migration.cpp b/teshsuite/s4u/cloud-interrupt-migration/cloud-interrupt-migration.cpp index 746e06ed75..94deef21fd 100644 --- a/teshsuite/s4u/cloud-interrupt-migration/cloud-interrupt-migration.cpp +++ b/teshsuite/s4u/cloud-interrupt-migration/cloud-interrupt-migration.cpp @@ -59,7 +59,7 @@ int main(int argc, char* argv[]) sg_vm_live_migration_plugin_init(); /* load the platform file */ - e.loadPlatform(argv[1]); + e.load_platform(argv[1]); simgrid::s4u::Actor::create("master_", simgrid::s4u::Host::by_name("Fafard"), master_main); diff --git a/teshsuite/s4u/comm-pt2pt/comm-pt2pt.cpp b/teshsuite/s4u/comm-pt2pt/comm-pt2pt.cpp index 275712cc6a..c953820fb5 100644 --- a/teshsuite/s4u/comm-pt2pt/comm-pt2pt.cpp +++ b/teshsuite/s4u/comm-pt2pt/comm-pt2pt.cpp @@ -170,7 +170,7 @@ int main(int argc, char* argv[]) if (argc < 2) usage(argv[0], specSend.c_str(), specRecv.c_str()); - e.loadPlatform(argv[1]); + e.load_platform(argv[1]); if (argc >= 3) { argSend.clear(); diff --git a/teshsuite/s4u/concurrent_rw/concurrent_rw.cpp b/teshsuite/s4u/concurrent_rw/concurrent_rw.cpp index 8378e8e84d..772c705fef 100644 --- a/teshsuite/s4u/concurrent_rw/concurrent_rw.cpp +++ b/teshsuite/s4u/concurrent_rw/concurrent_rw.cpp @@ -30,7 +30,7 @@ static void host() int main(int argc, char** argv) { simgrid::s4u::Engine e(&argc, argv); - e.loadPlatform(argv[1]); + e.load_platform(argv[1]); for (int i = 0; i < 5; i++) simgrid::s4u::Actor::create("host", simgrid::s4u::Host::by_name("bob"), host); diff --git a/teshsuite/s4u/host_on_off_wait/host_on_off_wait.cpp b/teshsuite/s4u/host_on_off_wait/host_on_off_wait.cpp index 4d3e71e255..0c8df3916d 100644 --- a/teshsuite/s4u/host_on_off_wait/host_on_off_wait.cpp +++ b/teshsuite/s4u/host_on_off_wait/host_on_off_wait.cpp @@ -29,7 +29,7 @@ static void worker() int main(int argc, char* argv[]) { simgrid::s4u::Engine e(&argc, argv); - e.loadPlatform(argv[1]); + e.load_platform(argv[1]); simgrid::s4u::Actor::create("master", simgrid::s4u::Host::by_name("Tremblay"), master); simgrid::s4u::Actor::create("worker", simgrid::s4u::Host::by_name("Jupiter"), worker); diff --git a/teshsuite/s4u/listen_async/listen_async.cpp b/teshsuite/s4u/listen_async/listen_async.cpp index acca8f83fa..c9ca453b1f 100644 --- a/teshsuite/s4u/listen_async/listen_async.cpp +++ b/teshsuite/s4u/listen_async/listen_async.cpp @@ -46,7 +46,7 @@ static void server() int main(int argc, char* argv[]) { simgrid::s4u::Engine e(&argc, argv); - e.loadPlatform(argv[1]); + e.load_platform(argv[1]); simgrid::s4u::Actor::create("test", simgrid::s4u::Host::by_name("Tremblay"), server); diff --git a/teshsuite/s4u/pid/pid.cpp b/teshsuite/s4u/pid/pid.cpp index 07b0f6179a..b50bdbc4e2 100644 --- a/teshsuite/s4u/pid/pid.cpp +++ b/teshsuite/s4u/pid/pid.cpp @@ -40,7 +40,7 @@ static void killall() int main(int argc, char* argv[]) { simgrid::s4u::Engine e(&argc, argv); - e.loadPlatform(argv[1]); + e.load_platform(argv[1]); simgrid::s4u::Actor::kill_all(); diff --git a/teshsuite/s4u/storage_client_server/storage_client_server.cpp b/teshsuite/s4u/storage_client_server/storage_client_server.cpp index 4a876018ae..b70d087ee5 100644 --- a/teshsuite/s4u/storage_client_server/storage_client_server.cpp +++ b/teshsuite/s4u/storage_client_server/storage_client_server.cpp @@ -157,7 +157,7 @@ int main(int argc, char* argv[]) simgrid::s4u::Engine e(&argc, argv); sg_storage_file_system_init(); xbt_assert(argc == 2, "Usage: %s platform_file\n", argv[0]); - e.loadPlatform(argv[1]); + e.load_platform(argv[1]); simgrid::s4u::Actor::create("server", simgrid::s4u::Host::by_name("alice"), server); simgrid::s4u::Actor::create("client", simgrid::s4u::Host::by_name("bob"), client); -- 2.20.1