Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Sort the model tests a bit better
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Sun, 7 Feb 2021 18:05:47 +0000 (19:05 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Sun, 7 Feb 2021 20:26:17 +0000 (21:26 +0100)
MANIFEST.in
teshsuite/models/CMakeLists.txt [new file with mode: 0644]
teshsuite/models/cloud-sharing/cloud-sharing.cpp [moved from teshsuite/s4u/cloud-sharing/cloud-sharing.cpp with 86% similarity]
teshsuite/models/cloud-sharing/cloud-sharing.tesh [moved from teshsuite/s4u/cloud-sharing/cloud-sharing.tesh with 100% similarity]
teshsuite/models/wifi_usage/wifi_usage.cpp [moved from teshsuite/surf/wifi_usage/wifi_usage.cpp with 98% similarity]
teshsuite/models/wifi_usage/wifi_usage.tesh [moved from teshsuite/surf/wifi_usage/wifi_usage.tesh with 100% similarity]
teshsuite/models/wifi_usage_decay/wifi_usage_decay.cpp [moved from teshsuite/surf/wifi_usage_decay/wifi_usage_decay.cpp with 97% similarity]
teshsuite/models/wifi_usage_decay/wifi_usage_decay.tesh [moved from teshsuite/surf/wifi_usage_decay/wifi_usage_decay.tesh with 100% similarity]
teshsuite/s4u/CMakeLists.txt
teshsuite/surf/CMakeLists.txt
tools/cmake/DefinePackages.cmake

index 3eab48a..4c4ef04 100644 (file)
@@ -667,6 +667,12 @@ include teshsuite/mc/random-bug/random-bug-nocrash.tesh
 include teshsuite/mc/random-bug/random-bug-replay.tesh
 include teshsuite/mc/random-bug/random-bug.cpp
 include teshsuite/mc/random-bug/random-bug.tesh
+include teshsuite/models/cloud-sharing/cloud-sharing.cpp
+include teshsuite/models/cloud-sharing/cloud-sharing.tesh
+include teshsuite/models/wifi_usage/wifi_usage.cpp
+include teshsuite/models/wifi_usage/wifi_usage.tesh
+include teshsuite/models/wifi_usage_decay/wifi_usage_decay.cpp
+include teshsuite/models/wifi_usage_decay/wifi_usage_decay.tesh
 include teshsuite/msg/task_destroy_cancel/task_destroy_cancel.c
 include teshsuite/msg/task_destroy_cancel/task_destroy_cancel.tesh
 include teshsuite/python/borken-context/borken-context.py
@@ -693,8 +699,6 @@ include teshsuite/s4u/basic-link-test/basic-link-test.cpp
 include teshsuite/s4u/basic-link-test/basic-link-test.tesh
 include teshsuite/s4u/cloud-interrupt-migration/cloud-interrupt-migration.cpp
 include teshsuite/s4u/cloud-interrupt-migration/cloud-interrupt-migration.tesh
-include teshsuite/s4u/cloud-sharing/cloud-sharing.cpp
-include teshsuite/s4u/cloud-sharing/cloud-sharing.tesh
 include teshsuite/s4u/cloud-two-execs/cloud-two-execs.cpp
 include teshsuite/s4u/cloud-two-execs/cloud-two-execs.tesh
 include teshsuite/s4u/comm-get-sender/comm-get-sender.cpp
@@ -1707,10 +1711,6 @@ include teshsuite/surf/surf_usage/surf_usage.cpp
 include teshsuite/surf/surf_usage/surf_usage.tesh
 include teshsuite/surf/surf_usage2/surf_usage2.cpp
 include teshsuite/surf/surf_usage2/surf_usage2.tesh
-include teshsuite/surf/wifi_usage/wifi_usage.cpp
-include teshsuite/surf/wifi_usage/wifi_usage.tesh
-include teshsuite/surf/wifi_usage_decay/wifi_usage_decay.cpp
-include teshsuite/surf/wifi_usage_decay/wifi_usage_decay.tesh
 include teshsuite/xbt/cmdline/cmdline.c
 include teshsuite/xbt/cmdline/cmdline.tesh
 include teshsuite/xbt/log_large/log_large.c
@@ -2680,6 +2680,7 @@ include teshsuite/kernel/CMakeLists.txt
 include teshsuite/lua/CMakeLists.txt
 include teshsuite/lua/lua_platforms.tesh
 include teshsuite/mc/CMakeLists.txt
+include teshsuite/models/CMakeLists.txt
 include teshsuite/msg/CMakeLists.txt
 include teshsuite/python/CMakeLists.txt
 include teshsuite/s4u/CMakeLists.txt
diff --git a/teshsuite/models/CMakeLists.txt b/teshsuite/models/CMakeLists.txt
new file mode 100644 (file)
index 0000000..66b7b1a
--- /dev/null
@@ -0,0 +1,15 @@
+foreach(x cloud-sharing wifi_usage wifi_usage_decay)
+  add_executable       (${x}  EXCLUDE_FROM_ALL ${x}/${x}.cpp)
+  target_link_libraries(${x}  simgrid)
+  set_target_properties(${x}  PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
+  set_property(TARGET ${x} APPEND PROPERTY INCLUDE_DIRECTORIES "${INTERNAL_INCLUDES}") # wifi tests need it, at least
+  add_dependencies(tests ${x})
+
+  set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.cpp)
+  set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.tesh)
+
+  ADD_TESH(tesh-model-${x} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/models/${x} --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_BINARY_DIR}/teshsuite/models/${x} ${CMAKE_HOME_DIRECTORY}/teshsuite/models/${x}/${x}.tesh)
+endforeach()
+
+set(teshsuite_src ${teshsuite_src}  PARENT_SCOPE)
+set(tesh_files    ${tesh_files}     PARENT_SCOPE)
@@ -4,8 +4,8 @@
 /* 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. */
 
-#include "simgrid/s4u.hpp"
 #include "simgrid/plugins/energy.h"
+#include "simgrid/s4u.hpp"
 #include "simgrid/s4u/VirtualMachine.hpp"
 #include <cmath>
 
@@ -13,7 +13,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "Messages specific for this msg example")
 
 const int FAIL_ON_ERROR = 0;
 const int flop_amount   = 100000000; // 100Mf, so that computing this on a 1Gf core takes exactly 0.1s
-int failed_test = 0;
+int failed_test         = 0;
 
 double energy = 0;
 
@@ -26,14 +26,14 @@ static int computation_fun(std::vector<std::string> argv)
   double end = simgrid::s4u::Engine::get_clock();
 
   if (0.1 - (end - begin) > 0.001) {
-    xbt_assert(! FAIL_ON_ERROR, "%s with %.4g load (%dflops) took %.4fs instead of 0.1s",
-        simgrid::s4u::this_actor::get_name().c_str(), ((double)size/flop_amount),size, (end-begin));
+    xbt_assert(!FAIL_ON_ERROR, "%s with %.4g load (%dflops) took %.4fs instead of 0.1s",
+               simgrid::s4u::this_actor::get_name().c_str(), ((double)size / flop_amount), size, (end - begin));
     XBT_INFO("FAILED TEST: %s with %.4g load (%dflops) took %.4fs instead of 0.1s",
-        simgrid::s4u::this_actor::get_name().c_str(),((double)size/flop_amount), size, (end-begin));
-    failed_test ++;
+             simgrid::s4u::this_actor::get_name().c_str(), ((double)size / flop_amount), size, (end - begin));
+    failed_test++;
   } else {
-    XBT_INFO("Passed: %s with %.4g load (%dflops) took 0.1s as expected",
-        simgrid::s4u::this_actor::get_name().c_str(), ((double)size/flop_amount), size);
+    XBT_INFO("Passed: %s with %.4g load (%dflops) took 0.1s as expected", simgrid::s4u::this_actor::get_name().c_str(),
+             ((double)size / flop_amount), size);
   }
 
   return 0;
@@ -48,19 +48,20 @@ static void run_test_process(const std::string& name, simgrid::s4u::Host* locati
 static void test_energy_consumption(const std::string& name, int nb_cores)
 {
   double new_energy = 0;
-  
-  for (simgrid::s4u::Host *pm : simgrid::s4u::Engine::get_instance()->get_all_hosts() ){
-    if(!dynamic_cast<simgrid::s4u::VirtualMachine *>(pm))
+
+  for (simgrid::s4u::Host* pm : simgrid::s4u::Engine::get_instance()->get_all_hosts()) {
+    if (!dynamic_cast<simgrid::s4u::VirtualMachine*>(pm))
       new_energy += sg_host_get_consumed_energy(pm);
   }
 
   double expected_consumption = 0.1 * nb_cores;
-  double actual_consumption = new_energy - energy;
+  double actual_consumption   = new_energy - energy;
 
   energy = new_energy;
 
   if (std::abs(expected_consumption - actual_consumption) > 0.001) {
-    XBT_INFO("FAILED TEST: %s consumed %f instead of %f J (i.e. %i cores should have been used)", name.c_str(), actual_consumption, expected_consumption, nb_cores );
+    XBT_INFO("FAILED TEST: %s consumed %f instead of %f J (i.e. %i cores should have been used)", name.c_str(),
+             actual_consumption, expected_consumption, nb_cores);
     failed_test++;
   } else {
     XBT_INFO("Passed: %s consumed %f J (i.e. %i cores used) ", name.c_str(), actual_consumption, nb_cores);
@@ -69,12 +70,12 @@ static void test_energy_consumption(const std::string& name, int nb_cores)
 
 static void run_test(const std::string& chooser)
 {
-  simgrid::s4u::Host *pm0 = simgrid::s4u::Host::by_name("node-0.1core.org");
-  simgrid::s4u::Host *pm1 = simgrid::s4u::Host::by_name("node-1.1core.org");
-  simgrid::s4u::Host *pm2 = simgrid::s4u::Host::by_name("node-0.2cores.org"); // 2 cores
-  simgrid::s4u::Host *pm4 = simgrid::s4u::Host::by_name("node-0.4cores.org");
+  simgrid::s4u::Hostpm0 = simgrid::s4u::Host::by_name("node-0.1core.org");
+  simgrid::s4u::Hostpm1 = simgrid::s4u::Host::by_name("node-1.1core.org");
+  simgrid::s4u::Hostpm2 = simgrid::s4u::Host::by_name("node-0.2cores.org"); // 2 cores
+  simgrid::s4u::Hostpm4 = simgrid::s4u::Host::by_name("node-0.4cores.org");
 
-  simgrid::s4u::VirtualMachine *vm0;
+  simgrid::s4u::VirtualMachinevm0;
   xbt_assert(pm0, "Host node-0.1core.org does not seem to exist");
   xbt_assert(pm2, "Host node-0.2cores.org does not seem to exist");
   xbt_assert(pm4, "Host node-0.4cores.org does not seem to exist");
@@ -84,83 +85,83 @@ static void run_test(const std::string& chooser)
   // "(  [  ]2  )4" means a VM with 2 cores, on a PM with 4 cores.
   // "o" means another process is there
   // "X" means the process which holds this name
+
   if (chooser == "(o)1") {
     XBT_INFO("### Test '%s'. A task on a regular PM", chooser.c_str());
     run_test_process("(X)1", pm0, flop_amount);
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,1);
+    test_energy_consumption(chooser, 1);
 
   } else if (chooser == "(oo)1") {
     XBT_INFO("### Test '%s'. 2 tasks on a regular PM", chooser.c_str());
     run_test_process("(Xo)1", pm0, flop_amount / 2);
     run_test_process("(oX)1", pm0, flop_amount / 2);
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,1);
+    test_energy_consumption(chooser, 1);
 
   } else if (chooser == "(o)1 (o)1") {
     XBT_INFO("### Test '%s'. 2 regular PMs, with a task each.", chooser.c_str());
     run_test_process("(X)1 (o)1", pm0, flop_amount);
     run_test_process("(o)1 (X)1", pm1, flop_amount);
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,2);
+    test_energy_consumption(chooser, 2);
 
   } else if (chooser == "( [o]1 )1") {
     XBT_INFO("### Test '%s'. A task in a VM on a PM.", chooser.c_str());
-    vm0 = new simgrid::s4u::VirtualMachine("VM0",pm0,1);
+    vm0 = new simgrid::s4u::VirtualMachine("VM0", pm0, 1);
     run_test_process("( [X]1 )1", vm0, flop_amount);
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,1);
+    test_energy_consumption(chooser, 1);
     vm0->destroy();
 
   } else if (chooser == "( [oo]1 )1") {
     XBT_INFO("### Test '%s'. 2 tasks co-located in a VM on a PM.", chooser.c_str());
-    vm0 = new simgrid::s4u::VirtualMachine("VM0",pm0,1);
+    vm0 = new simgrid::s4u::VirtualMachine("VM0", pm0, 1);
     run_test_process("( [Xo]1 )1", vm0, flop_amount / 2);
     run_test_process("( [oX]1 )1", vm0, flop_amount / 2);
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,1);
+    test_energy_consumption(chooser, 1);
     vm0->destroy();
 
   } else if (chooser == "( [ ]1 o )1") {
     XBT_INFO("### Test '%s'. 1 task collocated with an empty VM", chooser.c_str());
-    vm0 = new simgrid::s4u::VirtualMachine("VM0",pm0,1);
+    vm0 = new simgrid::s4u::VirtualMachine("VM0", pm0, 1);
     run_test_process("( [ ]1 X )1", pm0, flop_amount);
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,1);
+    test_energy_consumption(chooser, 1);
     vm0->destroy();
-    
+
   } else if (chooser == "( [o]1 o )1") {
     XBT_INFO("### Test '%s'. A task in a VM, plus a task", chooser.c_str());
-    vm0 = new simgrid::s4u::VirtualMachine("VM0",pm0,1);
+    vm0 = new simgrid::s4u::VirtualMachine("VM0", pm0, 1);
     run_test_process("( [X]1 o )1", vm0, flop_amount / 2);
     run_test_process("( [o]1 X )1", pm0, flop_amount / 2);
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,1);
+    test_energy_consumption(chooser, 1);
     vm0->destroy();
 
   } else if (chooser == "( [oo]1 o )1") {
     XBT_INFO("### Test '%s'. 2 tasks in a VM, plus a task", chooser.c_str());
-    vm0 = new simgrid::s4u::VirtualMachine("VM0",pm0,1);
+    vm0 = new simgrid::s4u::VirtualMachine("VM0", pm0, 1);
     run_test_process("( [Xo]1 o )1", vm0, flop_amount / 4);
     run_test_process("( [oX]1 o )1", vm0, flop_amount / 4);
     run_test_process("( [oo]1 X )1", pm0, flop_amount / 2);
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,1);
+    test_energy_consumption(chooser, 1);
     vm0->destroy();
 
   } else if (chooser == "( o )2") {
     XBT_INFO("### Test '%s'. A task on bicore PM", chooser.c_str());
     run_test_process("(X)2", pm2, flop_amount);
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,1);
+    test_energy_consumption(chooser, 1);
 
   } else if (chooser == "( oo )2") {
     XBT_INFO("### Test '%s'. 2 tasks on a bicore PM", chooser.c_str());
     run_test_process("(Xx)2", pm2, flop_amount);
     run_test_process("(xX)2", pm2, flop_amount);
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,2);
+    test_energy_consumption(chooser, 2);
 
   } else if (chooser == "( ooo )2") {
     XBT_INFO("### Test '%s'. 3 tasks on a bicore PM", chooser.c_str());
@@ -168,40 +169,40 @@ static void run_test(const std::string& chooser)
     run_test_process("(xXx)2", pm2, flop_amount * 2 / 3);
     run_test_process("(xxX)2", pm2, flop_amount * 2 / 3);
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,2);
+    test_energy_consumption(chooser, 2);
 
   } else if (chooser == "( [o]1 )2") {
     XBT_INFO("### Test '%s'. A task in a VM on a bicore PM", chooser.c_str());
-    vm0 = new simgrid::s4u::VirtualMachine("VM0",pm2,1);
+    vm0 = new simgrid::s4u::VirtualMachine("VM0", pm2, 1);
     run_test_process("( [X]1 )2", vm0, flop_amount);
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,1);
+    test_energy_consumption(chooser, 1);
     vm0->destroy();
 
   } else if (chooser == "( [oo]1 )2") {
     XBT_INFO("### Test '%s'. 2 tasks in a VM on a bicore PM", chooser.c_str());
-    vm0 = new simgrid::s4u::VirtualMachine("VM0",pm2,1);
+    vm0 = new simgrid::s4u::VirtualMachine("VM0", pm2, 1);
     run_test_process("( [Xx]1 )2", vm0, flop_amount / 2);
     run_test_process("( [xX]1 )2", vm0, flop_amount / 2);
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,1);
+    test_energy_consumption(chooser, 1);
     vm0->destroy();
 
   } else if (chooser == "( [ ]1 o )2") {
     XBT_INFO("### Put a VM on a PM, and put a task to the PM");
-    vm0 = new simgrid::s4u::VirtualMachine("VM0", pm2,1);
+    vm0 = new simgrid::s4u::VirtualMachine("VM0", pm2, 1);
     run_test_process("( [ ]1 X )2", pm2, flop_amount);
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,1);
+    test_energy_consumption(chooser, 1);
     vm0->destroy();
 
   } else if (chooser == "( [o]1 o )2") {
     XBT_INFO("### Put a VM on a PM, put a task to the PM and a task to the VM");
-    vm0 = new simgrid::s4u::VirtualMachine("VM0", pm2,1);
+    vm0 = new simgrid::s4u::VirtualMachine("VM0", pm2, 1);
     run_test_process("( [X]1 x )2", vm0, flop_amount);
     run_test_process("( [x]1 X )2", pm2, flop_amount);
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,2);
+    test_energy_consumption(chooser, 2);
     vm0->destroy();
 
   } else if (chooser == "( [o]1 [ ]1 )2") {
@@ -210,7 +211,7 @@ static void run_test(const std::string& chooser)
     auto* vm1 = new simgrid::s4u::VirtualMachine("VM1", pm2, 1);
     run_test_process("( [X]1 [ ]1 )2", vm0, flop_amount);
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,1);
+    test_energy_consumption(chooser, 1);
     vm0->destroy();
     vm1->destroy();
 
@@ -221,7 +222,7 @@ static void run_test(const std::string& chooser)
     run_test_process("( [X]1 [x]1 )2", vm0, flop_amount);
     run_test_process("( [x]1 [X]1 )2", vm1, flop_amount);
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,2);
+    test_energy_consumption(chooser, 2);
     vm0->destroy();
     vm1->destroy();
 
@@ -233,7 +234,7 @@ static void run_test(const std::string& chooser)
     run_test_process("( [X]1 [x]1 [ ]1 )2", vm0, flop_amount);
     run_test_process("( [x]1 [X]1 [ ]1 )2", vm1, flop_amount);
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,2);
+    test_energy_consumption(chooser, 2);
     vm0->destroy();
     vm1->destroy();
     vm2->destroy();
@@ -247,7 +248,7 @@ static void run_test(const std::string& chooser)
     run_test_process("( [o]1 [X]1 [o]1 )2", vm1, flop_amount * 2 / 3);
     run_test_process("( [o]1 [o]1 [X]1 )2", vm2, flop_amount * 2 / 3);
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,2);
+    test_energy_consumption(chooser, 2);
     vm0->destroy();
     vm1->destroy();
     vm2->destroy();
@@ -257,7 +258,7 @@ static void run_test(const std::string& chooser)
     vm0 = new simgrid::s4u::VirtualMachine("VM0", pm2, 2);
     run_test_process("( [X]2 )2", vm0, flop_amount);
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,1);
+    test_energy_consumption(chooser, 1);
     vm0->destroy();
 
   } else if (chooser == "( [oo]2 )2") {
@@ -266,7 +267,7 @@ static void run_test(const std::string& chooser)
     run_test_process("( [Xo]2 )2", vm0, flop_amount);
     run_test_process("( [oX]2 )2", vm0, flop_amount);
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,2);
+    test_energy_consumption(chooser, 2);
     vm0->destroy();
 
   } else if (chooser == "( [ooo]2 )2") {
@@ -276,7 +277,7 @@ static void run_test(const std::string& chooser)
     run_test_process("( [oXo]2 )2", vm0, flop_amount * 2 / 3);
     run_test_process("( [ooX]2 )2", vm0, flop_amount * 2 / 3);
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,2);
+    test_energy_consumption(chooser, 2);
     vm0->destroy();
 
   } else if (chooser == "( [ ]2 o )2") {
@@ -284,7 +285,7 @@ static void run_test(const std::string& chooser)
     vm0 = new simgrid::s4u::VirtualMachine("VM0", pm2, 2);
     run_test_process("( [ ]2 X )2", pm2, flop_amount);
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,1);
+    test_energy_consumption(chooser, 1);
     vm0->destroy();
 
   } else if (chooser == "( [o]2 o )2") {
@@ -293,7 +294,7 @@ static void run_test(const std::string& chooser)
     run_test_process("( [o]2 X )2", pm2, flop_amount);
     run_test_process("( [X]2 o )2", vm0, flop_amount);
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,2);
+    test_energy_consumption(chooser, 2);
     vm0->destroy();
 
   } else if (chooser == "( [oo]2 o )2") {
@@ -303,7 +304,7 @@ static void run_test(const std::string& chooser)
     run_test_process("( [Xo]2 o )2", vm0, flop_amount * 2 / 3);
     run_test_process("( [oX]2 o )2", vm0, flop_amount * 2 / 3);
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,2);
+    test_energy_consumption(chooser, 2);
     vm0->destroy();
 
   } else if (chooser == "( [ooo]2 o )2") {
@@ -314,7 +315,7 @@ static void run_test(const std::string& chooser)
     run_test_process("( [oXo]2 o )2", vm0, (flop_amount * 4 / 3) / 3); // VM_share/3
     run_test_process("( [ooX]2 o )2", vm0, (flop_amount * 4 / 3) / 3); // VM_share/3
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,2);
+    test_energy_consumption(chooser, 2);
     vm0->destroy();
 
   } else if (chooser == "( [ ]2 oo )2") {
@@ -323,7 +324,7 @@ static void run_test(const std::string& chooser)
     run_test_process("( [ ]2 Xo )2", pm2, flop_amount);
     run_test_process("( [ ]2 oX )2", pm2, flop_amount);
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,2);
+    test_energy_consumption(chooser, 2);
     vm0->destroy();
 
   } else if (chooser == "( [o]2 oo )2") {
@@ -333,7 +334,7 @@ static void run_test(const std::string& chooser)
     run_test_process("( [o]2 oX )2", pm2, flop_amount * 2 / 3);
     run_test_process("( [X]2 oo )2", vm0, flop_amount * 2 / 3);
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,2);
+    test_energy_consumption(chooser, 2);
     vm0->destroy();
 
   } else if (chooser == "( [oo]2 oo )2") {
@@ -344,7 +345,7 @@ static void run_test(const std::string& chooser)
     run_test_process("( [Xo]2 oo )2", vm0, flop_amount / 2);
     run_test_process("( [oX]2 oo )2", vm0, flop_amount / 2);
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,2);
+    test_energy_consumption(chooser, 2);
     vm0->destroy();
 
   } else if (chooser == "( [ooo]2 oo )2") {
@@ -356,7 +357,7 @@ static void run_test(const std::string& chooser)
     run_test_process("( [oXo]2 oo )2", vm0, flop_amount / 3);
     run_test_process("( [ooX]2 oo )2", vm0, flop_amount / 3);
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,2);
+    test_energy_consumption(chooser, 2);
     vm0->destroy();
 
   } else if (chooser == "( [o]2 )4") {
@@ -364,7 +365,7 @@ static void run_test(const std::string& chooser)
     vm0 = new simgrid::s4u::VirtualMachine("VM0", pm4, 2);
     run_test_process("( [X]2 )4", vm0, flop_amount);
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,1);
+    test_energy_consumption(chooser, 1);
     vm0->destroy();
 
   } else if (chooser == "( [oo]2 )4") {
@@ -373,7 +374,7 @@ static void run_test(const std::string& chooser)
     run_test_process("( [Xo]2 )4", vm0, flop_amount);
     run_test_process("( [oX]2 )4", vm0, flop_amount);
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,2);
+    test_energy_consumption(chooser, 2);
     vm0->destroy();
 
   } else if (chooser == "( [ooo]2 )4") {
@@ -383,7 +384,7 @@ static void run_test(const std::string& chooser)
     run_test_process("( [oXo]2 )4", vm0, flop_amount * 2 / 3);
     run_test_process("( [ooX]2 )4", vm0, flop_amount * 2 / 3);
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,2);
+    test_energy_consumption(chooser, 2);
     vm0->destroy();
 
   } else if (chooser == "( [ ]2 o )4") {
@@ -391,7 +392,7 @@ static void run_test(const std::string& chooser)
     vm0 = new simgrid::s4u::VirtualMachine("VM0", pm4, 2);
     run_test_process("( [ ]2 X )4", pm4, flop_amount);
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,1);
+    test_energy_consumption(chooser, 1);
     vm0->destroy();
 
   } else if (chooser == "( [ ]2 oo )4") {
@@ -400,7 +401,7 @@ static void run_test(const std::string& chooser)
     run_test_process("( [ ]2 Xo )4", pm4, flop_amount);
     run_test_process("( [ ]2 oX )4", pm4, flop_amount);
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,2);
+    test_energy_consumption(chooser, 2);
     vm0->destroy();
 
   } else if (chooser == "( [ ]2 ooo )4") {
@@ -410,7 +411,7 @@ static void run_test(const std::string& chooser)
     run_test_process("( [ ]2 oXo )4", pm4, flop_amount);
     run_test_process("( [ ]2 ooX )4", pm4, flop_amount);
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,3);
+    test_energy_consumption(chooser, 3);
     vm0->destroy();
 
   } else if (chooser == "( [ ]2 oooo )4") {
@@ -421,7 +422,7 @@ static void run_test(const std::string& chooser)
     run_test_process("( [ ]2 ooXo )4", pm4, flop_amount);
     run_test_process("( [ ]2 oooX )4", pm4, flop_amount);
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,4);
+    test_energy_consumption(chooser, 4);
     vm0->destroy();
 
   } else if (chooser == "( [o]2 o )4") {
@@ -430,7 +431,7 @@ static void run_test(const std::string& chooser)
     run_test_process("( [X]2 o )4", vm0, flop_amount);
     run_test_process("( [o]2 X )4", pm4, flop_amount);
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,2);
+    test_energy_consumption(chooser, 2);
     vm0->destroy();
 
   } else if (chooser == "( [o]2 oo )4") {
@@ -440,7 +441,7 @@ static void run_test(const std::string& chooser)
     run_test_process("( [o]2 Xo )4", pm4, flop_amount);
     run_test_process("( [o]2 oX )4", pm4, flop_amount);
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,3);
+    test_energy_consumption(chooser, 3);
     vm0->destroy();
 
   } else if (chooser == "( [oo]2 oo )4") {
@@ -451,7 +452,7 @@ static void run_test(const std::string& chooser)
     run_test_process("( [oo]2 Xo )4", pm4, flop_amount);
     run_test_process("( [oo]2 oX )4", pm4, flop_amount);
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,4);
+    test_energy_consumption(chooser, 4);
     vm0->destroy();
 
   } else if (chooser == "( [o]2 ooo )4") {
@@ -462,7 +463,7 @@ static void run_test(const std::string& chooser)
     run_test_process("( [o]2 oXo )4", pm4, flop_amount);
     run_test_process("( [o]2 ooX )4", pm4, flop_amount);
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,4);
+    test_energy_consumption(chooser, 4);
     vm0->destroy();
 
   } else if (chooser == "( [oo]2 ooo )4") {
@@ -474,7 +475,7 @@ static void run_test(const std::string& chooser)
     run_test_process("( [oo]2 oXo )4", pm4, flop_amount * 4 / 5);
     run_test_process("( [oo]2 ooX )4", pm4, flop_amount * 4 / 5);
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,4);
+    test_energy_consumption(chooser, 4);
     vm0->destroy();
 
   } else if (chooser == "( [ooo]2 ooo )4") {
@@ -488,7 +489,7 @@ static void run_test(const std::string& chooser)
     run_test_process("( [ooo]2 oXo )4", pm4, flop_amount * 4 / 5);
     run_test_process("( [ooo]2 ooX )4", pm4, flop_amount * 4 / 5);
     simgrid::s4u::this_actor::sleep_for(2);
-    test_energy_consumption(chooser,4);
+    test_energy_consumption(chooser, 4);
     vm0->destroy();
 
   } else {
@@ -588,11 +589,11 @@ int main(int argc, char* argv[])
     platform = argv[1];
   e.load_platform(platform);
 
-  simgrid::s4u::Host *pm0 = simgrid::s4u::Host::by_name("node-0.1core.org");
+  simgrid::s4u::Hostpm0 = simgrid::s4u::Host::by_name("node-0.1core.org");
   xbt_assert(pm0, "Host 'node-0.1core.org' not found");
   simgrid::s4u::Actor::create("master", pm0, master_main);
-  
-  e.run(); 
+
+  e.run();
 
   return failed_test;
 }
similarity index 98%
rename from teshsuite/surf/wifi_usage/wifi_usage.cpp
rename to teshsuite/models/wifi_usage/wifi_usage.cpp
index a2ffa54..619319f 100644 (file)
@@ -64,7 +64,7 @@ void run_ping_test(const char* src, const char* dest, int data_size)
   auto* mailbox = simgrid::s4u::Mailbox::by_name("Test");
 
   simgrid::s4u::Actor::create("sender", simgrid::s4u::Host::by_name(src), [mailbox, dest, data_size]() {
-    double start_time = simgrid::s4u::Engine::get_clock();
+    double start_time          = simgrid::s4u::Engine::get_clock();
     static std::string message = "message";
     mailbox->put(&message, data_size);
     double end_time = simgrid::s4u::Engine::get_clock();
@@ -68,7 +68,7 @@ void run_ping_test(const char* src, const char* dest, int data_size)
   auto* mailbox = simgrid::s4u::Mailbox::by_name("Test");
 
   simgrid::s4u::Actor::create("sender", simgrid::s4u::Host::by_name(src), [mailbox, dest, data_size]() {
-    double start_time = simgrid::s4u::Engine::get_clock();
+    double start_time          = simgrid::s4u::Engine::get_clock();
     static std::string message = "message";
     mailbox->put(&message, data_size);
     double end_time = simgrid::s4u::Engine::get_clock();
@@ -78,7 +78,7 @@ void run_ping_test(const char* src, const char* dest, int data_size)
   simgrid::s4u::Actor::create("receiver", simgrid::s4u::Host::by_name(dest),
                               [mailbox]() { mailbox->get<std::string>(); });
   auto* l = (simgrid::kernel::resource::NetworkWifiLink*)simgrid::s4u::Link::by_name("AP1")->get_impl();
-  if(!l->toggle_decay_model())
+  if (!l->toggle_decay_model())
     l->toggle_decay_model();
   l->set_host_rate(simgrid::s4u::Host::by_name("Station 1"), 0);
   l->set_host_rate(simgrid::s4u::Host::by_name("Station 2"), 0);
index 15f6ffe..4cbacee 100644 (file)
@@ -1,7 +1,7 @@
 foreach(x actor actor-autorestart actor-suspend
         activity-lifecycle
         comm-get-sender comm-pt2pt wait-any-for
-        cloud-interrupt-migration cloud-sharing cloud-two-execs
+        cloud-interrupt-migration cloud-two-execs
         concurrent_rw 
         host-on-off host-on-off-actors host-on-off-recv
         basic-link-test evaluate-get-route-time evaluate-parse-time is-router
@@ -33,7 +33,7 @@ foreach(x actor actor-autorestart actor-suspend
   ADD_TESH_FACTORIES(tesh-s4u-${x} "thread;ucontext;raw;boost" --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/s4u/${x} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/s4u/${x} --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_BINARY_DIR}/teshsuite/s4u/${x} ${CMAKE_HOME_DIRECTORY}/teshsuite/s4u/${x}/${x}.tesh)
 endforeach()
 
-foreach(x basic-link-test host-on-off host-on-off-actors host-on-off-recv is-router listen_async pid storage_client_server cloud-sharing trace-integration)
+foreach(x basic-link-test host-on-off host-on-off-actors host-on-off-recv is-router listen_async pid storage_client_server trace-integration)
   set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.tesh)
   ADD_TESH(tesh-s4u-${x} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/s4u/${x} --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_BINARY_DIR}/teshsuite/s4u/${x} ${CMAKE_HOME_DIRECTORY}/teshsuite/s4u/${x}/${x}.tesh)
 endforeach()
index 0952484..a9346ba 100644 (file)
@@ -1,4 +1,4 @@
-foreach(x lmm_usage surf_usage surf_usage2 wifi_usage wifi_usage_decay)
+foreach(x lmm_usage surf_usage surf_usage2)
   add_executable       (${x}  EXCLUDE_FROM_ALL ${x}/${x}.cpp)
   target_link_libraries(${x}  simgrid)
   set_target_properties(${x}  PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
index 1731015..3c5ac02 100644 (file)
@@ -1020,6 +1020,7 @@ set(CMAKEFILES_TXT
   teshsuite/kernel/CMakeLists.txt
   teshsuite/lua/CMakeLists.txt
   teshsuite/mc/CMakeLists.txt
+  teshsuite/models/CMakeLists.txt
   teshsuite/msg/CMakeLists.txt
   teshsuite/python/CMakeLists.txt
   teshsuite/s4u/CMakeLists.txt