From 0102f0bd149351aaea44dfe8b70fc77e3c074eae Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sun, 10 Sep 2017 18:10:30 +0200 Subject: [PATCH] remove a teshsuite example that is superseeded by a proper example --- teshsuite/s4u/CMakeLists.txt | 3 +- teshsuite/s4u/comm-waitany/comm-waitany.cpp | 70 --------------------- 2 files changed, 1 insertion(+), 72 deletions(-) delete mode 100644 teshsuite/s4u/comm-waitany/comm-waitany.cpp diff --git a/teshsuite/s4u/CMakeLists.txt b/teshsuite/s4u/CMakeLists.txt index 27538f6e24..a1ed94a19a 100644 --- a/teshsuite/s4u/CMakeLists.txt +++ b/teshsuite/s4u/CMakeLists.txt @@ -1,4 +1,4 @@ -foreach(x actor comm-pt2pt comm-waitany concurrent_rw host_on_off_wait listen_async pid storage_client_server) +foreach(x actor comm-pt2pt concurrent_rw host_on_off_wait listen_async pid storage_client_server) add_executable (${x} ${x}/${x}.cpp) target_link_libraries(${x} simgrid) set_target_properties(${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x}) @@ -20,7 +20,6 @@ endforeach() # The output is not relevant ADD_TEST(tesh-s4u-comm-pt2pt ${CMAKE_BINARY_DIR}/teshsuite/s4u/comm-pt2pt/comm-pt2pt ${CMAKE_HOME_DIRECTORY}/examples/platforms/cluster.xml) -ADD_TEST(tesh-s4u-comm-waitany ${CMAKE_BINARY_DIR}/teshsuite/s4u/comm-waitany/comm-waitany ${CMAKE_HOME_DIRECTORY}/examples/platforms/two_hosts.xml) diff --git a/teshsuite/s4u/comm-waitany/comm-waitany.cpp b/teshsuite/s4u/comm-waitany/comm-waitany.cpp deleted file mode 100644 index ce34e61671..0000000000 --- a/teshsuite/s4u/comm-waitany/comm-waitany.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/* Copyright (c) 2017. 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 -#include -#include -#include - -#define NUM_COMMS 1 - -XBT_LOG_NEW_DEFAULT_CATEGORY(mwe, "Minimum Working Example"); - -static void receiver() -{ - simgrid::s4u::MailboxPtr mymailbox = simgrid::s4u::Mailbox::byName("receiver_mailbox"); - - std::vector pending_comms; - - XBT_INFO("Placing %d asynchronous recv requests", NUM_COMMS); - void* data; - for (int i = 0; i < NUM_COMMS; i++) { - simgrid::s4u::CommPtr comm = mymailbox->get_async(&data); - pending_comms.push_back(comm); - } - - for (int i = 0; i < NUM_COMMS; i++) { - XBT_INFO("Sleeping for 3 seconds (for the %dth time)...", i + 1); - simgrid::s4u::this_actor::sleep_for(3.0); - XBT_INFO("Calling wait_any() for %zu pending comms", pending_comms.size()); - int changed_pos = simgrid::s4u::Comm::wait_any(&pending_comms); - XBT_INFO("Counting the number of completed comms..."); - - pending_comms.erase(pending_comms.begin() + changed_pos); - } -} - -static void sender() -{ - simgrid::s4u::MailboxPtr theirmailbox = simgrid::s4u::Mailbox::byName("receiver_mailbox"); - - void* data = (void*)"data"; - - for (int i = 0; i < NUM_COMMS; i++) { - XBT_INFO("Sending a message to the receiver"); - theirmailbox->put(&data, 4); - XBT_INFO("Sleeping for 1000 seconds"); - simgrid::s4u::this_actor::sleep_for(1000.0); - } -} - -int main(int argc, char** argv) -{ - - simgrid::s4u::Engine* engine = new simgrid::s4u::Engine(&argc, argv); - - xbt_assert(argc >= 2, "Usage: %s ", argv[0]); - - engine->loadPlatform(argv[1]); - simgrid::s4u::Host** hosts = sg_host_list(); - simgrid::s4u::Actor::createActor("Receiver", hosts[0], receiver); - simgrid::s4u::Actor::createActor("Sender", hosts[1], sender); - xbt_free(hosts); - - engine->run(); - - delete engine; - return 0; -} -- 2.20.1