Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
end of reorganizing cloud examples
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Mon, 4 Apr 2016 21:48:26 +0000 (23:48 +0200)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Mon, 4 Apr 2016 21:48:26 +0000 (23:48 +0200)
 + and finally test some of them
 + redesign scale test to avoid timers

.gitignore
examples/msg/CMakeLists.txt
examples/msg/cloud-scale/cloud-scale.c [moved from examples/msg/cloud/scale.c with 72% similarity]
examples/msg/cloud-scale/cloud-scale.tesh [new file with mode: 0644]
examples/msg/cloud-simple/cloud-simple.c [moved from examples/msg/cloud/simple_vm.c with 100% similarity]
examples/msg/cloud-simple/cloud-simple.tesh [moved from examples/msg/cloud/simple_vm.tesh with 98% similarity]
examples/msg/cloud-two-tasks/cloud-two-tasks.c [moved from examples/msg/cloud/two_tasks_vm.c with 100% similarity]
examples/msg/cloud-two-tasks/cloud-two-tasks.tesh [moved from examples/msg/cloud/two_tasks_vm.tesh with 98% similarity]
examples/msg/cloud/CMakeLists.txt [deleted file]
tools/cmake/DefinePackages.cmake

index f998fdb..99d820d 100644 (file)
@@ -128,9 +128,9 @@ examples/msg/cloud-capping/cloud-capping
 examples/msg/cloud-masterworker/cloud-masterworker
 examples/msg/cloud-migration/cloud-migration
 examples/msg/cloud-multicore/cloud-multicore
-examples/msg/cloud/scale
-examples/msg/cloud/simple_vm
-examples/msg/cloud/two_tasks_vm
+examples/msg/cloud-scale/cloud-scale
+examples/msg/cloud-simple/cloud-simple
+examples/msg/cloud-two-tasks/cloud-two-tasks
 examples/msg/dht-chord/dht-chord
 examples/msg/dht-kademlia/dht-kademlia
 examples/msg/dht-pastry/dht-pastry
index 3304d35..99fd79d 100644 (file)
@@ -1,5 +1,5 @@
-foreach(x actions-mpi actions-storage async-wait async-waitall async-waitany 
-          cloud-capping cloud-masterworker cloud-migration cloud-multicore dht-chord dht-pastry exception 
+foreach(x actions-mpi actions-storage async-wait async-waitall async-waitany cloud-capping cloud-masterworker 
+          cloud-migration cloud-multicore cloud-scale cloud-simple cloud-two-tasks dht-chord dht-pastry exception 
           energy-consumption energy-onoff energy-pstate energy-ptask energy-vm failures io-file io-file-unlink io-remote
           io-storage masterworker masterworker-mailbox pmm task-priority process-kill process-migration process-suspend 
           properties sendrecv set-maestro process-startkilltime synchro token_ring trace-categories 
@@ -83,8 +83,8 @@ set(xml_files    ${xml_files}     ${CMAKE_CURRENT_SOURCE_DIR}/actions-mpi/action
                                   ${CMAKE_CURRENT_SOURCE_DIR}/process-startkilltime/start_d.xml
                                   ${CMAKE_CURRENT_SOURCE_DIR}/process-startkilltime/start_kill_d.xml       PARENT_SCOPE)
 
-foreach(x actions-mpi actions-storage async-wait async-waitall async-waitany bittorrent chainsend 
-        cloud-capping cloud-masterworker cloud-migration dht-chord dht-kademlia
+foreach(x actions-mpi actions-storage async-wait async-waitall async-waitany bittorrent chainsend cloud-capping 
+        cloud-masterworker cloud-migration cloud-scale cloud-simple cloud-two-tasks dht-chord dht-kademlia
         failures io-file io-file-unlink io-remote io-storage masterworker masterworker-mailbox task-priority process-kill 
         process-migration process-suspend properties sendrecv synchro process-startkilltime token_ring)
   ADD_TESH_FACTORIES(msg-${x} "thread;ucontext;raw;boost" --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/${x} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/${x} ${x}.tesh)
similarity index 72%
rename from examples/msg/cloud/scale.c
rename to examples/msg/cloud-scale/cloud-scale.c
index 9cc1153..32a32c4 100644 (file)
@@ -9,33 +9,12 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
 
-/*
- * Usage:
- * ./examples/msg/cloud/scale ../examples/platforms/g5k.xml
- *
- * 1. valgrind --tool=callgrind ./examples/msg/cloud/scale ../examples/platforms/g5k.xml
- * 2. kcachegrind
- **/
-
-static double time_precise(void) {
-  struct timeval tv;
-  int ret = gettimeofday(&tv, NULL);
-  xbt_assert(ret >= 0, "gettimeofday");
-  return (double) tv.tv_sec + tv.tv_usec * 0.001 * 0.001;
-}
-
+static int task_count=0;
 static int computation_fun(int argc, char *argv[]) {
-  for (;;) {
-    // double clock_sta = time_precise();
-
-    msg_task_t task = MSG_task_create("Task", 10000000, 0, NULL);
-    MSG_task_execute(task);
-    MSG_task_destroy(task);
-
-    // double clock_end = time_precise();
-
-    // XBT_INFO("%f", clock_end - clock_sta);
-  }
+  msg_task_t task = MSG_task_create("Task", 2210000, 0, NULL);
+  MSG_task_execute(task);
+  task_count++;
+  MSG_task_destroy(task);
   return 0;
 }
 
@@ -58,6 +37,7 @@ static int master_main(int argc, char *argv[])
     pm[i] = xbt_dynar_get_as(hosts_dynar, i, msg_host_t);
   }
 
+  XBT_INFO("## Test (start)");
   for (i = 0; i < nvm; i++) {
     int pm_index = i % npm;
     char *vm_name = bprintf("vm%d", i);
@@ -69,13 +49,9 @@ static int master_main(int argc, char *argv[])
     xbt_free(vm_name);
   }
 
-  XBT_INFO("## Test (start)");
-
   for (i = 0; i < 10; i++) {
-    double clock_sta = time_precise();
     MSG_process_sleep(1);
-    double clock_end = time_precise();
-    XBT_INFO("duration %f", clock_end - clock_sta);
+    XBT_INFO("Completed tasks: %d", task_count);
   }
 
   for (i = 0; i < nvm; i++) {
diff --git a/examples/msg/cloud-scale/cloud-scale.tesh b/examples/msg/cloud-scale/cloud-scale.tesh
new file mode 100644 (file)
index 0000000..4e90756
--- /dev/null
@@ -0,0 +1,16 @@
+#! ./tesh
+
+$ $SG_TEST_EXENV ${bindir:=.}/cloud-scale$EXEEXT ${srcdir:=.}/platform.xml
+> [Jacquelin:master_:(1) 0.000000] [msg_test/INFO] ## Test (start)
+> [Jacquelin:master_:(1) 1.000000] [msg_test/INFO] Completed tasks: 0
+> [Jacquelin:master_:(1) 2.000000] [msg_test/INFO] Completed tasks: 600
+> [Jacquelin:master_:(1) 3.000000] [msg_test/INFO] Completed tasks: 900
+> [Jacquelin:master_:(1) 4.000000] [msg_test/INFO] Completed tasks: 900
+> [Jacquelin:master_:(1) 5.000000] [msg_test/INFO] Completed tasks: 900
+> [Jacquelin:master_:(1) 6.000000] [msg_test/INFO] Completed tasks: 900
+> [Jacquelin:master_:(1) 7.000000] [msg_test/INFO] Completed tasks: 900
+> [Jacquelin:master_:(1) 8.000000] [msg_test/INFO] Completed tasks: 900
+> [Jacquelin:master_:(1) 9.000000] [msg_test/INFO] Completed tasks: 900
+> [Jacquelin:master_:(1) 10.000000] [msg_test/INFO] Completed tasks: 1000
+> [Jacquelin:master_:(1) 10.000000] [msg_test/INFO] ## Test (ended)
+> [10.000000] [msg_test/INFO] Bye (simulation time 10)
similarity index 98%
rename from examples/msg/cloud/simple_vm.tesh
rename to examples/msg/cloud-simple/cloud-simple.tesh
index e60b2c0..aacc78f 100644 (file)
@@ -2,7 +2,7 @@
 
 p Testing a vm with two successive tasks
 
-$ $SG_TEST_EXENV ${bindir:=.}/simple_vm$EXEEXT --log=no_loc ${srcdir:=.}/../../platforms/small_platform.xml
+$ $SG_TEST_EXENV ${bindir:=.}/cloud-simple$EXEEXT --log=no_loc ${srcdir:=.}/small_platform.xml
 > [Fafard:master_:(1) 0.000000] [msg_test/INFO] ## Test 1 (started): check computation on normal PMs
 > [Fafard:master_:(1) 0.000000] [msg_test/INFO] ### Put a task on a PM
 > [Fafard:compute:(2) 0.013107] [msg_test/INFO] Fafard:compute task executed 0.0131068
similarity index 98%
rename from examples/msg/cloud/two_tasks_vm.tesh
rename to examples/msg/cloud-two-tasks/cloud-two-tasks.tesh
index c522d7b..cf9082f 100644 (file)
@@ -2,7 +2,7 @@
 
 p Testing a vm with two successive tasks
 
-$ $SG_TEST_EXENV ${bindir:=.}/two_tasks_vm$EXEEXT ${srcdir:=.}/../../platforms/small_platform.xml
+$ $SG_TEST_EXENV ${bindir:=.}/cloud-two-tasks$EXEEXT ${srcdir:=.}/small_platform.xml
 > [VM0:compute:(2) 0.000000] [msg_test/INFO] VM0:compute task 1 created 0
 > [Fafard:master_:(1) 0.000000] [msg_test/INFO] aTask remaining duration: 1e+09
 > [Fafard:master_:(1) 1.000000] [msg_test/INFO] aTask remaining duration: 9.23704e+08
diff --git a/examples/msg/cloud/CMakeLists.txt b/examples/msg/cloud/CMakeLists.txt
deleted file mode 100644 (file)
index bf9d37b..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-foreach (example simple_vm scale two_tasks_vm)
-  add_executable       (${example} ${example}.c)
-  target_link_libraries(${example} simgrid)
-  set(examples_src  ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/${example}.c)
-endforeach()
-
-ADD_TESH_FACTORIES(msg-cloud-two-tasks-vm      "thread;ucontext;raw;boost" --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/cloud/ --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/cloud/ --cd ${CMAKE_BINARY_DIR}/examples/msg/cloud/ ${CMAKE_HOME_DIRECTORY}/examples/msg/cloud/two_tasks_vm.tesh)
-ADD_TESH_FACTORIES(msg-cloud-simple-vm         "thread;ucontext;raw;boost" --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/cloud/ --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/cloud/ --cd ${CMAKE_BINARY_DIR}/examples/msg/cloud/ ${CMAKE_HOME_DIRECTORY}/examples/msg/cloud/simple_vm.tesh)
-
-set(examples_src  ${examples_src}                                                    PARENT_SCOPE)
-set(tesh_files    ${tesh_files}   ${CMAKE_CURRENT_SOURCE_DIR}/two_tasks_vm.tesh
-                                  ${CMAKE_CURRENT_SOURCE_DIR}/simple_vm.tesh         PARENT_SCOPE)
index e1c84d7..1208987 100644 (file)
@@ -926,7 +926,6 @@ set(txt_files
 set(CMAKEFILES_TXT
   examples/java/CMakeLists.txt
   examples/msg/CMakeLists.txt
-    examples/msg/cloud/CMakeLists.txt
     examples/msg/mc/CMakeLists.txt
   examples/s4u/CMakeLists.txt
   examples/simdag/CMakeLists.txt