From a762e713cb0c4552186a4e4a64da055f7f134e25 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sun, 10 Dec 2017 22:23:23 +0100 Subject: [PATCH 1/1] yet another msg examples thrown away --- examples/msg/CMakeLists.txt | 4 ++-- teshsuite/msg/CMakeLists.txt | 4 +++- .../msg/cloud-two-tasks/cloud-two-tasks.c | 20 +++++++++---------- .../msg/cloud-two-tasks/cloud-two-tasks.tesh | 0 4 files changed, 15 insertions(+), 13 deletions(-) rename {examples => teshsuite}/msg/cloud-two-tasks/cloud-two-tasks.c (78%) rename {examples => teshsuite}/msg/cloud-two-tasks/cloud-two-tasks.tesh (100%) diff --git a/examples/msg/CMakeLists.txt b/examples/msg/CMakeLists.txt index 824b75f186..a0450a8f1a 100644 --- a/examples/msg/CMakeLists.txt +++ b/examples/msg/CMakeLists.txt @@ -1,6 +1,6 @@ # C examples foreach(x app-masterworker app-token-ring - cloud-capping cloud-masterworker cloud-migration cloud-simple cloud-two-tasks + cloud-capping cloud-masterworker cloud-migration cloud-simple dht-pastry energy-consumption energy-onoff energy-vm platform-failures plugin-hostload process-create @@ -72,7 +72,7 @@ set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/app-masterworker/a foreach(x app-chainsend app-masterworker app-token-ring cloud-capping cloud-masterworker cloud-migration cloud-simple - cloud-two-tasks dht-pastry dht-kademlia platform-failures + dht-pastry dht-kademlia platform-failures energy-consumption energy-onoff energy-vm plugin-hostload process-create diff --git a/teshsuite/msg/CMakeLists.txt b/teshsuite/msg/CMakeLists.txt index 0db2486914..cfd3c57601 100644 --- a/teshsuite/msg/CMakeLists.txt +++ b/teshsuite/msg/CMakeLists.txt @@ -2,7 +2,8 @@ foreach(x actions-comm actions-storage app-pingpong async-wait async-waitall async-waitany - cloud-sharing get_sender host_on_off host_on_off_recv host_on_off_processes + cloud-sharing cloud-two-tasks + get_sender host_on_off host_on_off_recv host_on_off_processes process-daemon process-kill process-join process-lifetime process-migration process-suspend process-yield energy-ptask energy-pstate platform-properties io-file io-raw-storage io-file-remote @@ -77,6 +78,7 @@ foreach(x actions-comm actions-storage async-wait async-waitall async-waitany app-bittorrent app-pingpong + cloud-two-tasks energy-pstate host_on_off host_on_off_processes host_on_off_recv get_sender diff --git a/examples/msg/cloud-two-tasks/cloud-two-tasks.c b/teshsuite/msg/cloud-two-tasks/cloud-two-tasks.c similarity index 78% rename from examples/msg/cloud-two-tasks/cloud-two-tasks.c rename to teshsuite/msg/cloud-two-tasks/cloud-two-tasks.c index 746e5c8c2a..503eca7d81 100644 --- a/examples/msg/cloud-two-tasks/cloud-two-tasks.c +++ b/teshsuite/msg/cloud-two-tasks/cloud-two-tasks.c @@ -9,12 +9,12 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example") msg_task_t atask = NULL; -static int computation_fun(int argc, char *argv[]) +static int computation_fun(int argc, char* argv[]) { - const char *pr_name = MSG_process_get_name(MSG_process_self()); - const char *host_name = MSG_host_get_name(MSG_host_self()); - atask = MSG_task_create("Task1", 1e9, 1e9, NULL); - double clock_sta = MSG_get_clock(); + const char* pr_name = MSG_process_get_name(MSG_process_self()); + const char* host_name = MSG_host_get_name(MSG_host_self()); + atask = MSG_task_create("Task1", 1e9, 1e9, NULL); + double clock_sta = MSG_get_clock(); XBT_INFO("%s:%s task 1 created %g", host_name, pr_name, clock_sta); MSG_task_execute(atask); double clock_end = MSG_get_clock(); @@ -41,15 +41,15 @@ static int computation_fun(int argc, char *argv[]) return 0; } -static int master_main(int argc, char *argv[]) +static int master_main(int argc, char* argv[]) { msg_host_t pm0 = MSG_host_by_name("Fafard"); - msg_vm_t vm0 = MSG_vm_create_core(pm0, "VM0"); + msg_vm_t vm0 = MSG_vm_create_core(pm0, "VM0"); MSG_vm_start(vm0); MSG_process_create("compute", computation_fun, NULL, (msg_host_t)vm0); - while(MSG_get_clock()<100) { + while (MSG_get_clock() < 100) { if (atask != NULL) XBT_INFO("aTask remaining duration: %g", MSG_task_get_flops_amount(atask)); MSG_process_sleep(1); @@ -60,7 +60,8 @@ static int master_main(int argc, char *argv[]) return 1; } -int main(int argc, char *argv[]){ +int main(int argc, char* argv[]) +{ MSG_init(&argc, argv); xbt_assert(argc == 2); @@ -73,4 +74,3 @@ int main(int argc, char *argv[]){ return !(res == MSG_OK); } - diff --git a/examples/msg/cloud-two-tasks/cloud-two-tasks.tesh b/teshsuite/msg/cloud-two-tasks/cloud-two-tasks.tesh similarity index 100% rename from examples/msg/cloud-two-tasks/cloud-two-tasks.tesh rename to teshsuite/msg/cloud-two-tasks/cloud-two-tasks.tesh -- 2.20.1