From 6e3ecca7db4638defb553e96d8de4ee818248640 Mon Sep 17 00:00:00 2001 From: Frederic Suter Date: Sun, 8 Mar 2020 13:58:23 +0100 Subject: [PATCH] remove test superseded by exec-async and exec-ptask --- MANIFEST.in | 2 - teshsuite/msg/CMakeLists.txt | 29 ++--- teshsuite/msg/task_progress/task_progress.cpp | 110 ------------------ .../msg/task_progress/task_progress.tesh | 18 --- 4 files changed, 10 insertions(+), 149 deletions(-) delete mode 100644 teshsuite/msg/task_progress/task_progress.cpp delete mode 100644 teshsuite/msg/task_progress/task_progress.tesh diff --git a/MANIFEST.in b/MANIFEST.in index cd749cee51..d40e5d3e1d 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -682,8 +682,6 @@ include teshsuite/msg/task_destroy_cancel/task_destroy_cancel.c include teshsuite/msg/task_destroy_cancel/task_destroy_cancel.tesh include teshsuite/msg/task_listen_from/task_listen_from.c include teshsuite/msg/task_listen_from/task_listen_from.tesh -include teshsuite/msg/task_progress/task_progress.cpp -include teshsuite/msg/task_progress/task_progress.tesh include teshsuite/python/borken-context/borken-context.py include teshsuite/python/borken-context/borken-context.tesh include teshsuite/python/borken-context/borken-context_d.xml diff --git a/teshsuite/msg/CMakeLists.txt b/teshsuite/msg/CMakeLists.txt index 93d1d57b08..57d935db51 100644 --- a/teshsuite/msg/CMakeLists.txt +++ b/teshsuite/msg/CMakeLists.txt @@ -12,7 +12,7 @@ foreach(x cloud-two-tasks get_sender platform-properties io-file task_listen_fro endforeach() # CPP examples -foreach(x task_progress host_on_off_processes) +foreach(x host_on_off_processes) if(enable_msg) add_executable (${x} EXCLUDE_FROM_ALL ${x}/${x}.cpp) target_link_libraries(${x} simgrid) @@ -35,30 +35,21 @@ foreach (file bittorrent connection bittorrent-messages bittorrent-peer tracker) endforeach() set(teshsuite_src ${teshsuite_src} PARENT_SCOPE) -set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/app-bittorrent/app-bittorrent.tesh - PARENT_SCOPE) -set(bin_files ${bin_files} ${CMAKE_CURRENT_SOURCE_DIR}/app-bittorrent/generate.py PARENT_SCOPE) +set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/app-bittorrent/app-bittorrent.tesh PARENT_SCOPE) +set(bin_files ${bin_files} ${CMAKE_CURRENT_SOURCE_DIR}/app-bittorrent/generate.py PARENT_SCOPE) set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/app-bittorrent/app-bittorrent_d.xml ${CMAKE_CURRENT_SOURCE_DIR}/platform-properties/platform-properties_d.xml PARENT_SCOPE) if(enable_msg) - foreach(x - app-bittorrent - cloud-two-tasks - host_on_off_processes - get_sender - task_destroy_cancel task_listen_from task_progress - io-file - platform-properties) - - ADD_TESH_FACTORIES(tesh-msg-${x} "raw" - --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms - --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/msg/${x} - --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/${x} - ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/${x}/${x}.tesh) - endforeach() + foreach(x app-bittorrent cloud-two-tasks host_on_off_processes get_sender task_destroy_cancel task_listen_from + io-file platform-properties) + ADD_TESH_FACTORIES(tesh-msg-${x} "raw" --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms + --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/msg/${x} + --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/${x} + ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/${x}/${x}.tesh) + endforeach() ADD_TESH_FACTORIES(tesh-app-bittorrent-parallel "raw" --cfg contexts/nthreads:4 ${CONTEXTS_SYNCHRO} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/msg/app-bittorrent --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/app-bittorrent app-bittorrent.tesh) endif() diff --git a/teshsuite/msg/task_progress/task_progress.cpp b/teshsuite/msg/task_progress/task_progress.cpp deleted file mode 100644 index 77be8b420a..0000000000 --- a/teshsuite/msg/task_progress/task_progress.cpp +++ /dev/null @@ -1,110 +0,0 @@ -/* Copyright (c) 2010-2020. The SimGrid Team. All rights reserved. */ - -/* 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/Exception.hpp" -#include "simgrid/msg.h" - -XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example"); - -static std::vector tasks = std::vector(); - -static int seq_task(int /*argc*/, char* /*argv*/ []) -{ - double task_comp_size = 5E7; - double task_comm_size = 1E6; - double progress; - - msg_task_t task = MSG_task_create("simple", task_comp_size, task_comm_size, NULL); - tasks.push_back(task); - - XBT_INFO("get the progress of %s before the task starts", MSG_task_get_name(task)); - progress = MSG_task_get_remaining_work_ratio(task); - xbt_assert(progress == 1.0, "Progress should be 1.0 not %f", progress); - - XBT_INFO("Executing task: \"%s\"", MSG_task_get_name(task)); - MSG_task_execute(task); - - XBT_INFO("get the progress of %s after the task finishes", MSG_task_get_name(task)); - progress = MSG_task_get_remaining_work_ratio(task); - xbt_assert(progress == 0.0, "Progress should be equal to 0.0 not %f", progress); - - MSG_task_destroy(task); - XBT_INFO("Goodbye now!"); - return 0; -} - -static int par_task(int /*argc*/, char* /*argv*/ []) -{ - double * computation_amount = new double[2] {10E7, 10E7}; - double * communication_amount = new double[4] {1E6, 1E6, 1E6, 1E6}; - double progress; - - std::vector hosts_to_use = std::vector(); - hosts_to_use.push_back(MSG_get_host_by_name("Tremblay")); - hosts_to_use.push_back(MSG_get_host_by_name("Jupiter")); - - msg_task_t task = MSG_parallel_task_create("ptask", 2, hosts_to_use.data(), computation_amount, communication_amount, NULL); - tasks.push_back(task); - - XBT_INFO("get the progress of %s before the task starts", MSG_task_get_name(task)); - progress = MSG_task_get_remaining_work_ratio(task); - xbt_assert(progress == 1.0, "Progress should be 1.0 not %f", progress); - - XBT_INFO("Executing task: \"%s\"", MSG_task_get_name(task)); - MSG_parallel_task_execute(task); - - XBT_INFO("get the progress of %s after the task finishes", MSG_task_get_name(task)); - progress = MSG_task_get_remaining_work_ratio(task); - xbt_assert(progress == 0.0, "Progress should be equal to 0.0 not %f", progress); - - MSG_task_destroy(task); - delete[] computation_amount; - delete[] communication_amount; - - XBT_INFO("Goodbye now!"); - return 0; -} - -static int get_progress(int /*argc*/, char* /*argv*/ []) -{ - while (tasks.empty()) { - MSG_process_sleep(0.5); - } - double progress; - for(auto const& task: tasks) { - double progress_prev = 1; - for (int i = 0; i < 3; i++) { - MSG_process_sleep(0.2); - progress = MSG_task_get_remaining_work_ratio(task); - xbt_assert(progress >= 0 and progress < 1, "Progress should be in [0, 1[, and not %f", progress); - xbt_assert(progress < progress_prev, "Progress should decrease, not increase"); - XBT_INFO("Progress of \"%s\": %f", MSG_task_get_name(task), progress); - progress_prev = progress; - } - } - return 0; -} - -int main(int argc, char *argv[]) -{ - MSG_init(&argc, argv); - MSG_config("host/model", "ptask_L07"); - xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s ../examples/platforms/two_hosts.xml\n", argv[0], argv[0]); - - MSG_create_environment(argv[1]); - - MSG_process_create("sequential", seq_task, NULL, MSG_get_host_by_name("Tremblay")); - - MSG_process_create("parallel", par_task, NULL, MSG_get_host_by_name("Tremblay")); - - // Create a process to test in progress task - MSG_process_create("get_progress", get_progress, NULL, MSG_get_host_by_name("Tremblay")); - - msg_error_t res = MSG_main(); - - XBT_INFO("Simulation time %g", MSG_get_clock()); - - return res != MSG_OK; -} diff --git a/teshsuite/msg/task_progress/task_progress.tesh b/teshsuite/msg/task_progress/task_progress.tesh deleted file mode 100644 index 1ef358b0ea..0000000000 --- a/teshsuite/msg/task_progress/task_progress.tesh +++ /dev/null @@ -1,18 +0,0 @@ -$ ${bindir}/task_progress ${platfdir}/small_platform.xml -> [0.000000] [xbt_cfg/INFO] Switching to the L07 model to handle parallel tasks. -> [Tremblay:sequential:(1) 0.000000] [msg_test/INFO] get the progress of simple before the task starts -> [Tremblay:sequential:(1) 0.000000] [msg_test/INFO] Executing task: "simple" -> [Tremblay:parallel:(2) 0.000000] [msg_test/INFO] get the progress of ptask before the task starts -> [Tremblay:parallel:(2) 0.000000] [msg_test/INFO] Executing task: "ptask" -> [Tremblay:get_progress:(3) 0.200000] [msg_test/INFO] Progress of "simple": 0.802376 -> [Tremblay:get_progress:(3) 0.400000] [msg_test/INFO] Progress of "simple": 0.606186 -> [Tremblay:get_progress:(3) 0.600000] [msg_test/INFO] Progress of "simple": 0.409996 -> [Tremblay:get_progress:(3) 0.800000] [msg_test/INFO] Progress of "ptask": 0.608337 -> [Tremblay:get_progress:(3) 1.000000] [msg_test/INFO] Progress of "ptask": 0.510242 -> [Tremblay:sequential:(1) 1.017958] [msg_test/INFO] get the progress of simple after the task finishes -> [Tremblay:sequential:(1) 1.017958] [msg_test/INFO] Goodbye now! -> [Tremblay:get_progress:(3) 1.200000] [msg_test/INFO] Progress of "ptask": 0.362543 -> [Tremblay:parallel:(2) 1.675180] [msg_test/INFO] get the progress of ptask after the task finishes -> [Tremblay:parallel:(2) 1.675180] [msg_test/INFO] Goodbye now! -> [1.675180] [msg_test/INFO] Simulation time 1.67518 - -- 2.20.1