From bbea007dc079a40470fb6e0233d3a9fcc58a4bf4 Mon Sep 17 00:00:00 2001 From: Jacob Domagala Date: Wed, 5 Apr 2023 16:00:08 +0200 Subject: [PATCH] #2036: Tests: Remove collection_local_send.cc --- tests/perf/collection_local_send_prealloc.cc | 128 ------------------- 1 file changed, 128 deletions(-) delete mode 100644 tests/perf/collection_local_send_prealloc.cc diff --git a/tests/perf/collection_local_send_prealloc.cc b/tests/perf/collection_local_send_prealloc.cc deleted file mode 100644 index 32337253f8..0000000000 --- a/tests/perf/collection_local_send_prealloc.cc +++ /dev/null @@ -1,128 +0,0 @@ -/* -//@HEADER -// ***************************************************************************** -// -// collection_local_send_prealloc.cc -// DARMA/vt => Virtual Transport -// -// Copyright 2019-2021 National Technology & Engineering Solutions of Sandia, LLC -// (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. -// Government retains certain rights in this software. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact darma@sandia.gov -// -// ***************************************************************************** -//@HEADER -*/ -#include "common/test_harness.h" -#include - -#include - -using namespace vt; -using namespace vt::tests::perf::common; - -static constexpr int num_iters = 1000000; - -struct MyTest : PerfTestHarness { }; -struct MyMsg : vt::Message {}; - -struct NodeObj; -vt::objgroup::proxy::Proxy global_proxy; - -void dummyHandler(MyMsg*) {} - -struct TestCol : vt::Collection { - using ColMsg = vt::CollectionMessage; - void han(ColMsg* msg) {} -}; - -struct NodeObj { - struct ReduceMsg : vt::collective::ReduceNoneMsg { }; - - explicit NodeObj(MyTest* test_obj) : test_obj_(test_obj) { } - void initialize() { - proxy_ = global_proxy = vt::theObjGroup()->getProxy(this); - - auto range = vt::Index1D(8); - col_proxy = vt::makeCollection("test") - .bounds(range) - .bulkInsert() - .wait(); - // fmt::print("ptr={}\n", print_ptr(col_proxy.lm)); - } - - void complete() { - } - - - void perfMakeRunnablePreAllocate(MyMsg* in_msg) { - for (int i = 0; i < num_iters; i++) { - msgs.emplace_back(makeMessage()); - } - - theTerm()->disableTD(); - - test_obj_->StartTimer(fmt::format("colSend {}", num_iters)); - perfRunBenchmark(); - test_obj_->StopTimer(fmt::format("colSend {}", num_iters)); - - theTerm()->enableTD(); - } - void perfRunBenchmark() { - for (int i = 0; i < num_iters; i++) { - auto m = msgs[i]; - col_proxy[0].template sendMsg<&TestCol::han>(m); - vt::theSched()->runSchedulerOnceImpl(); - } - } - -private: - std::vector> msgs; - HandlerType han; - MyTest* test_obj_ = nullptr; - vt::objgroup::proxy::Proxy proxy_ = {}; - vt::CollectionProxy col_proxy; - int reduce_counter_ = -1; - int i = 0; -}; - -VT_PERF_TEST(MyTest, test_collection_local_send_preallocate) { - auto grp_proxy = vt::theObjGroup()->makeCollective( - "test_collection_local_send_preallocate", this - ); - - grp_proxy[my_node_].invoke<&NodeObj::initialize>(); - - if (theContext()->getNode() == 0) { - grp_proxy[my_node_].send(); - } -} - -VT_PERF_TEST_MAIN()