From ee906bd1e3e926e97708364650a46a11e18ca8f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cezary=20Skrzy=C5=84ski?= Date: Fri, 29 Jan 2021 22:28:11 +0100 Subject: [PATCH] #1173: remove dummy worker --- src/vt/configs/debug/debug_masterconfig.h | 4 +- src/vt/worker/worker_dummy.h | 87 ----------------------- src/vt/worker/worker_group.h | 4 +- src/vt/worker/worker_headers.h | 8 ++- 4 files changed, 10 insertions(+), 93 deletions(-) delete mode 100644 src/vt/worker/worker_dummy.h diff --git a/src/vt/configs/debug/debug_masterconfig.h b/src/vt/configs/debug/debug_masterconfig.h index 3f382a5e66..3df7578d2b 100644 --- a/src/vt/configs/debug/debug_masterconfig.h +++ b/src/vt/configs/debug/debug_masterconfig.h @@ -106,7 +106,7 @@ using VTPrintConfig = Configuration< #define backend_no_threading \ !vt_check_enabled(openmp) && !vt_check_enabled(stdthread) -#define vt_no_threading \ - !vt_check_enabled(openmp) && !vt_check_enabled(stdthread) && !vt_check_enabled(fcontext) +#define vt_threading_enabled \ + vt_check_enabled(openmp) && vt_check_enabled(stdthread) && vt_check_enabled(fcontext) #endif /*INCLUDED_VT_CONFIGS_DEBUG_DEBUG_MASTERCONFIG_H*/ diff --git a/src/vt/worker/worker_dummy.h b/src/vt/worker/worker_dummy.h deleted file mode 100644 index 307b1cb92b..0000000000 --- a/src/vt/worker/worker_dummy.h +++ /dev/null @@ -1,87 +0,0 @@ -/* -//@HEADER -// ***************************************************************************** -// -// worker_dummy.h -// DARMA Toolkit v. 1.0.0 -// DARMA/vt => Virtual Transport -// -// Copyright 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 -*/ - -#if !defined INCLUDED_WORKER_WORKER_DUMMY_H -#define INCLUDED_WORKER_WORKER_DUMMY_H - -#include "vt/config.h" -#include "vt/utils/container/concurrent_deque.h" -#include "vt/worker/worker_common.h" -#include "vt/worker/worker_types.h" - -namespace vt { namespace worker { - -struct WorkerDummy { - using WorkerFunType = std::function; - using WorkUnitContainerType = util::container::ConcurrentDeque; - - WorkerDummy( - WorkerIDType const& /*in_worker_id_*/, WorkerCountType const& /*in_num_thds*/, - WorkerFinishedFnType /*finished_fn*/ - ) {} - WorkerDummy(WorkerDummy const&) = delete; - - void spawn() {} - void join() {} - void progress() {} - void dispatch(WorkerFunType fun) {} - void enqueue(WorkUnitType const& work_unit) {} -}; - -}} /* end namespace vt::worker */ - -#if vt_check_enabled(detector) - #include "vt/worker/worker_traits.h" - - namespace vt { namespace worker { - - static_assert( - WorkerTraits::is_worker, - "vt::worker::Worker must follow the Worker concept" - ); - - }} /* end namespace vt::worker */ -#endif /*vt_check_enabled(detector)*/ - -#endif /*INCLUDED_WORKER_WORKER_DUMMY_H*/ diff --git a/src/vt/worker/worker_group.h b/src/vt/worker/worker_group.h index 80fc91d47c..dd19084317 100644 --- a/src/vt/worker/worker_group.h +++ b/src/vt/worker/worker_group.h @@ -58,7 +58,7 @@ #elif vt_check_enabled(fcontext) #include "vt/worker/worker_seq.h" #else - #include "vt/worker/worker_dummy.h" + // #include "vt/worker/worker_dummy.h" #endif #include @@ -118,7 +118,7 @@ struct WorkerGroupAny #elif vt_check_enabled(fcontext) using WorkerGroupSeq = WorkerGroupAny; #else - using WorkerGroupDummy = WorkerGroupAny; + // using WorkerGroupDummy = WorkerGroupAny; #endif /*vt_check_enabled(stdthread)*/ }} /* end namespace vt::worker */ diff --git a/src/vt/worker/worker_headers.h b/src/vt/worker/worker_headers.h index 8985757a2e..9dbc808d14 100644 --- a/src/vt/worker/worker_headers.h +++ b/src/vt/worker/worker_headers.h @@ -45,6 +45,8 @@ #if !defined INCLUDED_WORKER_WORKER_HEADERS_H #define INCLUDED_WORKER_WORKER_HEADERS_H +#if vt_threading_enabled + #include "vt/worker/worker.h" #include "vt/worker/worker_group.h" #include "vt/worker/worker_types.h" @@ -64,7 +66,7 @@ namespace vt { namespace worker { #elif vt_check_enabled(fcontext) using WorkerGroupType = WorkerGroupSeq; #else - using WorkerGroupType = WorkerGroupDummy; + // using WorkerGroupType = WorkerGroupDummy; #endif #if vt_check_enabled(openmp) @@ -74,7 +76,7 @@ namespace vt { namespace worker { #elif vt_check_enabled(fcontext) using WorkerType = WorkerSeq; #else - using WorkerType = WorkerDummy; + // using WorkerType = WorkerDummy; #endif }} /* end namespace vt::worker */ @@ -85,4 +87,6 @@ extern worker::WorkerGroupType* theWorkerGrp(); } /* end namespace vt */ +#endif /* vt_threading_enabled */ + #endif /*INCLUDED_WORKER_WORKER_HEADERS_H*/