diff --git a/src/vt/lb/balancers/centralized/impls/rotate.h b/src/vt/lb/balancers/centralized/impls/rotate.h deleted file mode 100644 index 8dbb4cf1b4..0000000000 --- a/src/vt/lb/balancers/centralized/impls/rotate.h +++ /dev/null @@ -1,59 +0,0 @@ -/* -//@HEADER -// ***************************************************************************** -// -// rotate.h -// DARMA Toolkit v. 1.0.0 -// DARMA/vt => Virtual Transport -// -// Copyright 2019 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_LB_BALANCERS_CENTRALIZED_IMPLS_ROTATE_H -#define INCLUDED_LB_BALANCERS_CENTRALIZED_IMPLS_ROTATE_H - -#include "vt/config.h" -#include "vt/lb/lb_types.h" -#include "vt/lb/balancers/centralized/lb_interface.h" - -namespace vt { namespace lb { namespace centralized { - -struct RotateLB : CentralLB { -}; - -}}} /* end namespace vt::lb::centralized */ - -#endif /*INCLUDED_LB_MIGRATION_MIGRATE_H*/ diff --git a/src/vt/lb/balancers/centralized/lb_default_migrate.cc b/src/vt/lb/balancers/centralized/lb_default_migrate.cc deleted file mode 100644 index 06437931d3..0000000000 --- a/src/vt/lb/balancers/centralized/lb_default_migrate.cc +++ /dev/null @@ -1,101 +0,0 @@ -/* -//@HEADER -// ***************************************************************************** -// -// lb_default_migrate.cc -// DARMA Toolkit v. 1.0.0 -// DARMA/vt => Virtual Transport -// -// Copyright 2019 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 "vt/config.h" -#include "vt/lb/lb_types.h" -#include "vt/lb/lb_types_internal.h" -#include "vt/lb/migration/migrate.h" -#include "vt/lb/instrumentation/entity.h" -#include "vt/lb/balancers/centralized/lb_interface.h" -#include "vt/lb/balancers/centralized/lb_default_migrate.h" -#include "vt/context/context.h" - -namespace vt { namespace lb { namespace centralized { - -/*virtual*/ void CentralMigrate::notifyMigration( - NodeType const& from, NodeType const& to, LBEntityType const& entity -) { - auto const& this_node = theContext()->getNode(); - if (this_node == from) { - migrate(to, entity); - } -} - -/*virtual*/ void CentralMigrate::notifyMigrationList( - MigrateInfoType const& migrate_info -) { - auto const& this_node = theContext()->getNode(); - for (auto&& elm : migrate_info.migrations_) { - if (elm.first == this_node) { - for (auto&& migrate_to_list : elm.second) { - for (auto&& entity : migrate_to_list.second) { - migrate(migrate_to_list.first, entity); - } - } - } - } -} - -/*virtual*/ void CentralMigrate::finishedMigrations() { - vt_debug_print( - lb, node, - "CentralMigrate::finishedMigrations: before sync\n" - ); - - sync(); - - vt_debug_print( - lb, node, - "CentralMigrate::finishedMigrations: after sync\n" - ); -} - -void CentralMigrate::migrate( - NodeType const& to_node, LBEntityType const& entity -) { - return instrumentation::Entity::notifyMigrate(to_node, entity); -} - -}}} /* end namespace vt::lb::centralized */ - diff --git a/src/vt/lb/balancers/centralized/lb_default_migrate.h b/src/vt/lb/balancers/centralized/lb_default_migrate.h deleted file mode 100644 index 08d4c1d09c..0000000000 --- a/src/vt/lb/balancers/centralized/lb_default_migrate.h +++ /dev/null @@ -1,74 +0,0 @@ -/* -//@HEADER -// ***************************************************************************** -// -// lb_default_migrate.h -// DARMA Toolkit v. 1.0.0 -// DARMA/vt => Virtual Transport -// -// Copyright 2019 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_LB_BALANCERS_CENTRALIZED_LB_DEFAULT_MIGRATE_H -#define INCLUDED_LB_BALANCERS_CENTRALIZED_LB_DEFAULT_MIGRATE_H - -#include "vt/config.h" -#include "vt/lb/lb_types.h" -#include "vt/lb/lb_types_internal.h" -#include "vt/lb/migration/migrate.h" -#include "vt/lb/balancers/centralized/lb_interface.h" - -namespace vt { namespace lb { namespace centralized { - -struct CentralMigrate : CentralLB { - - CentralMigrate(NodeType const& node, NodeType const& central_node) - : CentralLB(node, central_node) - { } - - virtual void notifyMigration( - NodeType const& from, NodeType const& to, LBEntityType const& entity - ) override; - virtual void notifyMigrationList(MigrateInfoType const& migrate_info) override; - virtual void finishedMigrations() override; - -protected: - void migrate(NodeType const& to_node, LBEntityType const& entity); -}; - -}}} /* end namespace vt::lb::centralized */ - -#endif /*INCLUDED_LB_BALANCERS_CENTRALIZED_LB_DEFAULT_MIGRATE_H*/ diff --git a/src/vt/lb/balancers/centralized/lb_interface.h b/src/vt/lb/balancers/centralized/lb_interface.h deleted file mode 100644 index c073856b6b..0000000000 --- a/src/vt/lb/balancers/centralized/lb_interface.h +++ /dev/null @@ -1,87 +0,0 @@ -/* -//@HEADER -// ***************************************************************************** -// -// lb_interface.h -// DARMA Toolkit v. 1.0.0 -// DARMA/vt => Virtual Transport -// -// Copyright 2019 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_LB_BALANCERS_CENTRALIZED_LB_INTERFACE_H -#define INCLUDED_LB_BALANCERS_CENTRALIZED_LB_INTERFACE_H - -#include "vt/config.h" -#include "vt/lb/lb_types.h" -#include "vt/lb/lb_types_internal.h" -#include "vt/lb/migration/migrate.h" - -#include -#include - -namespace vt { namespace lb { namespace centralized { - -struct CentralLB { - using LoadStatsType = ::vt::lb::ProcContainerType; - using MigrateInfoType = ::vt::lb::MigrateInfo; - - CentralLB(NodeType const& node, NodeType const& central_node) - : this_node_(node), central_node_(central_node) - { } - CentralLB(CentralLB const&) = delete; - CentralLB(CentralLB&&) = delete; - - virtual void loadStatistics(LoadStatsType const& stats) = 0; - virtual void sync() = 0; - virtual void runLB() = 0; - virtual void notifyMigration( - NodeType const& from, NodeType const& to, LBEntityType const& entity - ) = 0; - virtual void notifyMigrationList(MigrateInfoType const& migrate_info) = 0; - virtual void finishedMigrations() = 0; - - NodeType getCentralNode() const { return central_node_; } - NodeType getThisNode() const { return this_node_; } - -private: - NodeType const this_node_; - NodeType const central_node_; -}; - -}}} /* end namespace vt::lb::centralized */ - -#endif /*INCLUDED_LB_BALANCERS_CENTRALIZED_LB_INTERFACE_H*/ diff --git a/src/vt/lb/instrumentation/centralized/collect.cc b/src/vt/lb/instrumentation/centralized/collect.cc deleted file mode 100644 index 0d4168cf3e..0000000000 --- a/src/vt/lb/instrumentation/centralized/collect.cc +++ /dev/null @@ -1,167 +0,0 @@ -/* -//@HEADER -// ***************************************************************************** -// -// collect.cc -// DARMA Toolkit v. 1.0.0 -// DARMA/vt => Virtual Transport -// -// Copyright 2019 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 "vt/config.h" -#include "vt/lb/instrumentation/centralized/collect.h" -#include "vt/lb/instrumentation/centralized/collect_msg.h" -#include "vt/lb/lb_types.h" -#include "vt/lb/lb_types_internal.h" -#include "vt/lb/instrumentation/entity.h" -#include "vt/lb/instrumentation/database.h" -#include "vt/collective/collective_alg.h" - -#include -#include -#include - -namespace vt { namespace lb { namespace instrumentation { - -/*static*/ LBPhaseType CentralCollect::cur_lb_phase_ = fst_phase; -/*static*/ NodeType CentralCollect::collect_root_ = 0; - -/*static*/ void CentralCollect::combine(CollectMsg* msg1, CollectMsg* msg2) { - vtAssert(msg1->phase_ == msg2->phase_, "Phases must be identical"); - - // Runtime validity check to ensure that nodes are unique - #if vt_check_enabled(runtime_checks) || 1 - for (auto&& elm1 : msg1->entries_) { - for (auto&& elm2 : msg2->entries_) { - vtAssert( - elm1.first != elm2.first, - "CollectMsg combine must have unique entries" - ); - } - } - #endif - - msg1->entries_.insert(msg2->entries_.begin(), msg2->entries_.end()); -} - -/*static*/ void CentralCollect::collectFinished( - LBPhaseType const& phase, ProcContainerType const& entries -) { - vt_debug_print( - lb, node, - "collectFinished: phase={}, size={}\n", phase, entries.size() - ); -} - -/*static*/ void CentralCollect::centralizedCollect(CollectMsg* msg) { - if (msg->isRoot()) { - return collectFinished(msg->phase_, msg->entries_); - } else { - CollectMsg* fst_msg = msg; - CollectMsg* cur_msg = msg->getNext(); - while (cur_msg != nullptr) { - // Combine msgs - CentralCollect::combine(fst_msg, cur_msg); - cur_msg = cur_msg->getNext(); - } - } -} - -/*static*/ void CentralCollect::reduceCurrentPhase() { - auto const& phase = CentralCollect::currentPhase(); - CentralCollect::nextPhase(); - return startReduce(phase); -} - -/*static*/ MsgSharedPtr CentralCollect::collectStats( - LBPhaseType const& phase -) { - auto const& node = theContext()->getNode(); - auto msg = makeMessage(phase); - auto node_cont_iter = msg->entries_.find(node); - vtAssert( - node_cont_iter == msg->entries_.end(), - "Entries must not exist for this node" - ); - msg->entries_.emplace( - std::piecewise_construct, - std::forward_as_tuple(node), - std::forward_as_tuple(ContainerType{}) - ); - node_cont_iter = msg->entries_.find(node); - vtAssert( - node_cont_iter != msg->entries_.end(), - "Entries must exist here for this node" - ); - auto const& entity_list = Entity::entities_; - for (auto&& elm : entity_list) { - auto const& entity = elm.first; - auto const& db = elm.second; - auto phase_iter = db.phase_timings_.find(phase); - if (phase_iter != db.phase_timings_.end()) { - auto msg_entry_iter = node_cont_iter->second.find(entity); - if (msg_entry_iter == node_cont_iter->second.end()) { - node_cont_iter->second.emplace( - std::piecewise_construct, - std::forward_as_tuple(entity), - std::forward_as_tuple(EntryListType{}) - ); - } - msg_entry_iter->second = phase_iter->second; - } - } - return msg; -} - -/*static*/ void CentralCollect::startReduce(LBPhaseType const& phase) { - auto const& root = CentralCollect::collect_root_; - auto msg = CentralCollect::collectStats(phase); - theCollective()->global()-> - reduce( - root, msg.get() - ); -} - -/*static*/ LBPhaseType CentralCollect::currentPhase() { - return CentralCollect::cur_lb_phase_; -} - -/*static*/ void CentralCollect::nextPhase() { - CentralCollect::cur_lb_phase_++; -} - -}}} /* end namespace vt::lb::instrumentation */ diff --git a/src/vt/lb/instrumentation/centralized/collect.fwd.h b/src/vt/lb/instrumentation/centralized/collect.fwd.h deleted file mode 100644 index a2169295d5..0000000000 --- a/src/vt/lb/instrumentation/centralized/collect.fwd.h +++ /dev/null @@ -1,57 +0,0 @@ -/* -//@HEADER -// ***************************************************************************** -// -// collect.fwd.h -// DARMA Toolkit v. 1.0.0 -// DARMA/vt => Virtual Transport -// -// Copyright 2019 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_LB_INSTRUMENTATION_CENTRALIZED_COLLECT_FWD_H -#define INCLUDED_LB_INSTRUMENTATION_CENTRALIZED_COLLECT_FWD_H - -#include "vt/config.h" -#include "vt/lb/lb_types.h" - -namespace vt { namespace lb { namespace instrumentation { - -struct CentralCollect; - -}}} /* end namespace vt::lb::instrumentation */ - -#endif /*INCLUDED_LB_INSTRUMENTATION_CENTRALIZED_COLLECT_FWD_H*/ diff --git a/src/vt/lb/instrumentation/centralized/collect.h b/src/vt/lb/instrumentation/centralized/collect.h deleted file mode 100644 index 2f83a738f6..0000000000 --- a/src/vt/lb/instrumentation/centralized/collect.h +++ /dev/null @@ -1,77 +0,0 @@ -/* -//@HEADER -// ***************************************************************************** -// -// collect.h -// DARMA Toolkit v. 1.0.0 -// DARMA/vt => Virtual Transport -// -// Copyright 2019 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_LB_INSTRUMENTATION_CENTRALIZED_COLLECT_H -#define INCLUDED_LB_INSTRUMENTATION_CENTRALIZED_COLLECT_H - -#include "vt/config.h" -#include "vt/lb/lb_types.h" -#include "vt/lb/lb_types_internal.h" -#include "vt/lb/instrumentation/database.h" -#include "vt/lb/instrumentation/centralized/collect_msg.h" - -namespace vt { namespace lb { namespace instrumentation { - -struct CentralCollect { - static void startReduce(LBPhaseType const& phase); - static void reduceCurrentPhase(); - static MsgSharedPtr collectStats(LBPhaseType const& phase); - static void collectFinished( - LBPhaseType const& phase, ProcContainerType const& entries - ); - static LBPhaseType currentPhase(); - static void nextPhase(); - - // Active message handlers - static void centralizedCollect(CollectMsg* msg); - static void combine(CollectMsg* msg1, CollectMsg* msg2); - -private: - static NodeType collect_root_; - static LBPhaseType cur_lb_phase_; -}; - -}}} /* end namespace vt::lb::instrumentation */ - -#endif /*INCLUDED_LB_INSTRUMENTATION_CENTRALIZED_COLLECT_H*/ diff --git a/src/vt/lb/instrumentation/centralized/collect_msg.fwd.h b/src/vt/lb/instrumentation/centralized/collect_msg.fwd.h deleted file mode 100644 index 1a20e2a41e..0000000000 --- a/src/vt/lb/instrumentation/centralized/collect_msg.fwd.h +++ /dev/null @@ -1,57 +0,0 @@ -/* -//@HEADER -// ***************************************************************************** -// -// collect_msg.fwd.h -// DARMA Toolkit v. 1.0.0 -// DARMA/vt => Virtual Transport -// -// Copyright 2019 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_LB_INSTRUMENTATION_CENTRALIZED_COLLECT_MSG_FWD_H -#define INCLUDED_LB_INSTRUMENTATION_CENTRALIZED_COLLECT_MSG_FWD_H - -#include "vt/config.h" -#include "vt/lb/lb_types.h" - -namespace vt { namespace lb { namespace instrumentation { - -struct CollectMsg; - -}}} /* end namespace vt::lb::instrumentation */ - -#endif /*INCLUDED_LB_INSTRUMENTATION_CENTRALIZED_COLLECT_MSG_FWD_H*/ diff --git a/src/vt/lb/instrumentation/centralized/collect_msg.h b/src/vt/lb/instrumentation/centralized/collect_msg.h deleted file mode 100644 index 9cc8bc8b6b..0000000000 --- a/src/vt/lb/instrumentation/centralized/collect_msg.h +++ /dev/null @@ -1,88 +0,0 @@ -/* -//@HEADER -// ***************************************************************************** -// -// collect_msg.h -// DARMA Toolkit v. 1.0.0 -// DARMA/vt => Virtual Transport -// -// Copyright 2019 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_LB_INSTRUMENTATION_CENTRALIZED_COLLECT_MSG_H -#define INCLUDED_LB_INSTRUMENTATION_CENTRALIZED_COLLECT_MSG_H - -#include "vt/config.h" -#include "vt/lb/lb_types.h" -#include "vt/lb/lb_types_internal.h" -#include "vt/lb/instrumentation/entry.h" -#include "vt/collective/reduce/reduce.h" -#include "vt/messaging/message.h" - -#include -#include - -namespace vt { namespace lb { namespace instrumentation { - -struct CollectMsg : ::vt::collective::reduce::ReduceMsg { - using MessageParentType = ::vt::collective::reduce::ReduceMsg; - vt_msg_serialize_required(); // by entries_ - - CollectMsg() = default; - - CollectMsg( - LBPhaseType const& in_phase, ProcContainerType const& in_entries - ) : phase_(in_phase), entries_(in_entries) - { } - explicit CollectMsg(LBPhaseType const& in_phase) - : CollectMsg(in_phase, ProcContainerType{}) - { } - - template - void serialize(Serializer& s) { - MessageParentType::serialize(s); - s | entries_; - s | phase_; - } - -public: - LBPhaseType phase_ = no_phase; - ProcContainerType entries_; -}; - -}}} /* end namespace vt::lb::instrumentation */ - -#endif /*INCLUDED_LB_INSTRUMENTATION_CENTRALIZED_COLLECT_MSG_H*/ diff --git a/src/vt/lb/instrumentation/database.cc b/src/vt/lb/instrumentation/database.cc deleted file mode 100644 index 39cc768253..0000000000 --- a/src/vt/lb/instrumentation/database.cc +++ /dev/null @@ -1,66 +0,0 @@ -/* -//@HEADER -// ***************************************************************************** -// -// database.cc -// DARMA Toolkit v. 1.0.0 -// DARMA/vt => Virtual Transport -// -// Copyright 2019 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 "vt/config.h" -#include "vt/lb/lb_types.h" -#include "vt/lb/instrumentation/database.h" -#include "vt/lb/instrumentation/entry.h" - -namespace vt { namespace lb { namespace instrumentation { - -void Database::addEntry(EntryType&& entry) { - auto const& phase = cur_phase_; - auto phase_iter = phase_timings_.find(phase); - if (phase_iter != phase_timings_.end()) { - phase_timings_.emplace( - std::piecewise_construct, - std::forward_as_tuple(phase), - std::forward_as_tuple(EntryListType{std::move(entry)}) - ); - } else { - phase_iter->second.emplace_back(std::move(entry)); - } -} - -}}} /* end namespace vt::lb::instrumentation */ diff --git a/src/vt/lb/instrumentation/database.h b/src/vt/lb/instrumentation/database.h deleted file mode 100644 index 7267baf69e..0000000000 --- a/src/vt/lb/instrumentation/database.h +++ /dev/null @@ -1,86 +0,0 @@ -/* -//@HEADER -// ***************************************************************************** -// -// database.h -// DARMA Toolkit v. 1.0.0 -// DARMA/vt => Virtual Transport -// -// Copyright 2019 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_LB_INSTRUMENTATION_DATABASE_H -#define INCLUDED_LB_INSTRUMENTATION_DATABASE_H - -#include "vt/config.h" -#include "vt/lb/lb_types.h" -#include "vt/lb/instrumentation/entry.h" -#include "vt/lb/instrumentation/centralized/collect_msg.fwd.h" -#include "vt/lb/instrumentation/centralized/collect.fwd.h" - -#include -#include - -namespace vt { namespace lb { namespace instrumentation { - -struct Database { - using EntryType = Entry; - using EntryListType = std::vector; - - Database() = default; - - void addEntry(EntryType&& entry); - - template - void serialize(Serializer& s) { - s | phase_timings_; - s | cur_phase_; - } - - friend struct CollectMsg; - friend struct CentralCollect; - -private: - // Past timings ordered by time ascending - std::unordered_map phase_timings_; - - // Current/next phase for database entry - LBPhaseType cur_phase_ = 0; -}; - -}}} /* end namespace vt::lb::instrumentation */ - -#endif /*INCLUDED_LB_INSTRUMENTATION_DATABASE_H*/ diff --git a/src/vt/lb/instrumentation/entity.cc b/src/vt/lb/instrumentation/entity.cc deleted file mode 100644 index d5df02bb47..0000000000 --- a/src/vt/lb/instrumentation/entity.cc +++ /dev/null @@ -1,119 +0,0 @@ -/* -//@HEADER -// ***************************************************************************** -// -// entity.cc -// DARMA Toolkit v. 1.0.0 -// DARMA/vt => Virtual Transport -// -// Copyright 2019 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 "vt/config.h" -#include "vt/context/context.h" -#include "vt/lb/instrumentation/entity.h" - -#include - -namespace vt { namespace lb { namespace instrumentation { - -/*static*/ LBEntityType Entity::cur_entity_id = 0; -/*static*/ std::unordered_map Entity::events_; -/*static*/ std::unordered_map Entity::entities_; -/*static*/ std::unordered_map Entity::migratables_; - -/*static*/ LBEntityType Entity::registerEntity() { - auto const& node = theContext()->getNode(); - auto const& next_id = cur_entity_id++; - return next_id | (static_cast(node) << 48); -} - -/*static*/ LBEntityType Entity::registerMigratableEntity(MigratableType* mig) { - auto const& entity = registerEntity(); - migratables_.emplace( - std::piecewise_construct, - std::forward_as_tuple(entity), - std::forward_as_tuple(mig) - ); - return entity; -} - -/*static*/ void Entity::notifyMigrate( - NodeType const& to_node, LBEntityType const& entity -) { - auto iter = migratables_.find(entity); - vtAssert( - iter != migratables_.end(), "Entity must exist in migratables to migrate" - ); - auto const& elm = iter->second; - elm->migrate(to_node); - migratables_.erase(iter); -} - -/*static*/ void Entity::beginExecution(LBEntityType const& entity) { - auto const& current_time = timing::Timing::getCurrentTime(); - auto event_iter = events_.find(entity); - if (event_iter == events_.end()) { - events_.emplace( - std::piecewise_construct, - std::forward_as_tuple(entity), - std::forward_as_tuple(current_time) - ); - } else { - event_iter->second = current_time; - } -} - -/*static*/ void Entity::endExecution(LBEntityType const& entity) { - auto entity_iter = entities_.find(entity); - if (entity_iter == entities_.end()) { - entities_.emplace( - std::piecewise_construct, - std::forward_as_tuple(entity), - std::forward_as_tuple(DatabaseType{}) - ); - entity_iter = entities_.find(entity); - } - auto const& event_iter = events_.find(entity); - vtAssert( - event_iter != events_.end(), "Must have begin" - ); - auto const& begin_time = event_iter->second; - auto const& end_time = timing::Timing::getCurrentTime(); - entity_iter->second.addEntry(Entry{begin_time,end_time}); -} - -}}} /* end namespace vt::lb::instrumentation */ diff --git a/src/vt/lb/instrumentation/entity.h b/src/vt/lb/instrumentation/entity.h deleted file mode 100644 index a55d87e80b..0000000000 --- a/src/vt/lb/instrumentation/entity.h +++ /dev/null @@ -1,81 +0,0 @@ -/* -//@HEADER -// ***************************************************************************** -// -// entity.h -// DARMA Toolkit v. 1.0.0 -// DARMA/vt => Virtual Transport -// -// Copyright 2019 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_LB_INSTRUMENTATION_ENTITY_H -#define INCLUDED_LB_INSTRUMENTATION_ENTITY_H - -#include "vt/config.h" -#include "vt/lb/instrumentation/database.h" -#include "vt/lb/lb_types.h" -#include "vt/lb/migration/lb_migratable.h" - -#include - -namespace vt { namespace lb { namespace instrumentation { - -struct Entity { - using MigratableType = ::vt::HasMigrate; - using DatabaseType = Database; - - Entity() = default; - - static LBEntityType registerEntity(); - static LBEntityType registerMigratableEntity(MigratableType* mig); - - static void beginExecution(LBEntityType const& entity); - static void endExecution(LBEntityType const& entity); - static void notifyMigrate(NodeType const& node, LBEntityType const& entity); - -public: - static std::unordered_map events_; - static std::unordered_map entities_; - -private: - static std::unordered_map migratables_; - static LBEntityType cur_entity_id; -}; - -}}} /* end namespace vt::lb::instrumentation */ - -#endif /*INCLUDED_LB_INSTRUMENTATION_ENTITY_H*/ diff --git a/src/vt/lb/instrumentation/entry.h b/src/vt/lb/instrumentation/entry.h deleted file mode 100644 index 5973f20349..0000000000 --- a/src/vt/lb/instrumentation/entry.h +++ /dev/null @@ -1,75 +0,0 @@ -/* -//@HEADER -// ***************************************************************************** -// -// entry.h -// DARMA Toolkit v. 1.0.0 -// DARMA/vt => Virtual Transport -// -// Copyright 2019 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_LB_INSTRUMENTATION_ENTRY_H -#define INCLUDED_LB_INSTRUMENTATION_ENTRY_H - -#include "vt/config.h" -#include "vt/lb/lb_types.h" -#include "vt/timing/timing.h" -#include "vt/timing/timing_type.h" - -namespace vt { namespace lb { namespace instrumentation { - -struct Entry { - Entry() = default; - Entry(TimeType const& in_begin, TimeType const& in_end) - : begin_(in_begin), end_(in_end) - { } - Entry(Entry const&) = default; - Entry(Entry&&) = default; - Entry& operator=(Entry const&) = default; - - TimeType begin_ = 0.0; - TimeType end_ = 0.0; - - template - void serialize(Serializer& s) { - s | begin_ | end_; - } -}; - -}}} /* end namespace vt::lb::instrumentation */ - -#endif /*INCLUDED_LB_INSTRUMENTATION_ENTRY_H*/ diff --git a/src/vt/lb/lb_headers.h b/src/vt/lb/lb_headers.h deleted file mode 100644 index 749cfc6c89..0000000000 --- a/src/vt/lb/lb_headers.h +++ /dev/null @@ -1,50 +0,0 @@ -/* -//@HEADER -// ***************************************************************************** -// -// lb_headers.h -// DARMA Toolkit v. 1.0.0 -// DARMA/vt => Virtual Transport -// -// Copyright 2019 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_LB_LB_HEADERS_H -#define INCLUDED_LB_LB_HEADERS_H - -#include "vt/lb/instrumentation/entity.h" - -#endif /*INCLUDED_LB_LB_HEADERS_H*/ diff --git a/src/vt/lb/lb_types.h b/src/vt/lb/lb_types.h deleted file mode 100644 index 6246a372a9..0000000000 --- a/src/vt/lb/lb_types.h +++ /dev/null @@ -1,61 +0,0 @@ -/* -//@HEADER -// ***************************************************************************** -// -// lb_types.h -// DARMA Toolkit v. 1.0.0 -// DARMA/vt => Virtual Transport -// -// Copyright 2019 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_LB_LB_TYPES_H -#define INCLUDED_LB_LB_TYPES_H - -#include -#include - -namespace vt { - -using LBEntityType = uint64_t; -using LBPhaseType = int64_t; - -static constexpr LBPhaseType const fst_phase = 0; -static constexpr LBPhaseType const no_phase = -1; - -} /* end namespace vt */ - -#endif /*INCLUDED_LB_LB_TYPES_H*/ diff --git a/src/vt/lb/lb_types_internal.h b/src/vt/lb/lb_types_internal.h deleted file mode 100644 index 89a1d22e0d..0000000000 --- a/src/vt/lb/lb_types_internal.h +++ /dev/null @@ -1,64 +0,0 @@ -/* -//@HEADER -// ***************************************************************************** -// -// lb_types_internal.h -// DARMA Toolkit v. 1.0.0 -// DARMA/vt => Virtual Transport -// -// Copyright 2019 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_LB_LB_TYPES_INTERNAL_H -#define INCLUDED_LB_LB_TYPES_INTERNAL_H - -#include "vt/config.h" -#include "vt/lb/lb_types.h" -#include "vt/lb/instrumentation/entry.h" - -#include -#include - -namespace vt { namespace lb { - -using EntryType = instrumentation::Entry; -using EntryListType = std::vector; -using ContainerType = std::unordered_map; -using ProcContainerType = std::unordered_map; - -}} /* end namespace lb */ - -#endif /*INCLUDED_LB_LB_TYPES_INTERNAL_H*/ diff --git a/src/vt/lb/migration/migrate.h b/src/vt/lb/migration/migrate.h deleted file mode 100644 index d6badb2fb5..0000000000 --- a/src/vt/lb/migration/migrate.h +++ /dev/null @@ -1,78 +0,0 @@ -/* -//@HEADER -// ***************************************************************************** -// -// migrate.h -// DARMA Toolkit v. 1.0.0 -// DARMA/vt => Virtual Transport -// -// Copyright 2019 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_LB_MIGRATION_MIGRATE_H -#define INCLUDED_LB_MIGRATION_MIGRATE_H - -#include "vt/config.h" -#include "vt/lb/lb_types.h" - -#include -#include - -namespace vt { namespace lb { - -struct MigrateInfo { - using MigrateToType = NodeType; - using MigrateFromType = NodeType; - using MigrateListType = std::vector; - using MigrateToListType = std::unordered_map; - using MigrateFromListType = std::unordered_map; - - MigrateInfo() = default; - explicit MigrateInfo(MigrateFromListType const& in_migrations) - : migrations_(in_migrations) - { } - - template - void serialize(Serializer& s) { - s | migrations_; - } - - MigrateFromListType migrations_; -}; - -}} /* end namespace vt::lb */ - -#endif /*INCLUDED_LB_MIGRATION_MIGRATE_H*/