From: Frederic Suter Date: Mon, 4 Apr 2016 21:48:26 +0000 (+0200) Subject: end of reorganizing cloud examples X-Git-Tag: v3_13~186 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/a6a990ed8927c312cdf6ca86256f768ee79d5e57 end of reorganizing cloud examples + and finally test some of them + redesign scale test to avoid timers --- diff --git a/.gitignore b/.gitignore index f998fdbe04..99d820d3b4 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/examples/msg/CMakeLists.txt b/examples/msg/CMakeLists.txt index 3304d35adb..99fd79d1e4 100644 --- a/examples/msg/CMakeLists.txt +++ b/examples/msg/CMakeLists.txt @@ -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) diff --git a/examples/msg/cloud/scale.c b/examples/msg/cloud-scale/cloud-scale.c similarity index 72% rename from examples/msg/cloud/scale.c rename to examples/msg/cloud-scale/cloud-scale.c index 9cc1153d86..32a32c438b 100644 --- a/examples/msg/cloud/scale.c +++ b/examples/msg/cloud-scale/cloud-scale.c @@ -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 index 0000000000..4e907561f4 --- /dev/null +++ b/examples/msg/cloud-scale/cloud-scale.tesh @@ -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) diff --git a/examples/msg/cloud/simple_vm.c b/examples/msg/cloud-simple/cloud-simple.c similarity index 100% rename from examples/msg/cloud/simple_vm.c rename to examples/msg/cloud-simple/cloud-simple.c diff --git a/examples/msg/cloud/simple_vm.tesh b/examples/msg/cloud-simple/cloud-simple.tesh similarity index 98% rename from examples/msg/cloud/simple_vm.tesh rename to examples/msg/cloud-simple/cloud-simple.tesh index e60b2c0c9b..aacc78fe5b 100644 --- a/examples/msg/cloud/simple_vm.tesh +++ b/examples/msg/cloud-simple/cloud-simple.tesh @@ -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 diff --git a/examples/msg/cloud/two_tasks_vm.c b/examples/msg/cloud-two-tasks/cloud-two-tasks.c similarity index 100% rename from examples/msg/cloud/two_tasks_vm.c rename to examples/msg/cloud-two-tasks/cloud-two-tasks.c diff --git a/examples/msg/cloud/two_tasks_vm.tesh b/examples/msg/cloud-two-tasks/cloud-two-tasks.tesh similarity index 98% rename from examples/msg/cloud/two_tasks_vm.tesh rename to examples/msg/cloud-two-tasks/cloud-two-tasks.tesh index c522d7b614..cf9082fba0 100644 --- a/examples/msg/cloud/two_tasks_vm.tesh +++ b/examples/msg/cloud-two-tasks/cloud-two-tasks.tesh @@ -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 index bf9d37bbd5..0000000000 --- a/examples/msg/cloud/CMakeLists.txt +++ /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) diff --git a/tools/cmake/DefinePackages.cmake b/tools/cmake/DefinePackages.cmake index e1c84d703a..1208987eb8 100644 --- a/tools/cmake/DefinePackages.cmake +++ b/tools/cmake/DefinePackages.cmake @@ -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