Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1376 improve lbargs for gossiplb #1422

Merged
merged 27 commits into from
May 28, 2021
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
ab7dced
#1376: gossiplb: move enums to a separate file
nlslatt May 3, 2021
0a2cc69
#1376: gossiplb: read enum lb args as strings
nlslatt May 3, 2021
24ca570
#1376: gossiplb: make lb arg names readable
nlslatt May 3, 2021
dea700a
#1376: gossiplb: added option for auto setting rounds and fanout
nlslatt May 3, 2021
6869f89
#1376: gossiplb: default to async informs
nlslatt May 3, 2021
f4b54ac
#1376: gossiplb: default to only one trial
nlslatt May 3, 2021
4fc9fb5
#1376: gossiplb: omit migrations from terse output
nlslatt May 3, 2021
a302101
#1376: gossiplb: use true bools for bool lb args
nlslatt May 3, 2021
bf8900f
#1376: gossiplb: improve error messages
nlslatt May 3, 2021
466957f
#1376: gossiplb: removes unused default values
nlslatt May 3, 2021
72d12b1
#1376: tests: update lb args for test
nlslatt May 3, 2021
513a772
#1376: gossiplb: add hash for enums
nlslatt May 3, 2021
1b07d35
#1376: gossiplb: fix for serial load balancing tests
nlslatt May 3, 2021
a3b34b6
#1376: gossiplb: define hash for criterion enum
nlslatt May 17, 2021
3f27cc5
#1376: gossiplb: stop polluting std namespace
nlslatt May 26, 2021
9138c9c
#1376: tests: clean up setting lb args
nlslatt May 26, 2021
521989d
#1376: tests: test enum converter
nlslatt May 26, 2021
21d861d
#1376: gossiplb: clean up types
nlslatt May 27, 2021
ca84c8a
#1376: gossiplb: document enum converter
nlslatt May 27, 2021
a2c9bcf
#1376: gossiplb: additional doxygen for enum converter
nlslatt May 27, 2021
c304a07
#1376: gossiplb: rename enum converter
nlslatt May 27, 2021
f759b60
#1376: gossiplb: move enum converter out of gossiplb
nlslatt May 27, 2021
b651487
#1376: tests: split off lb args enum converter tests
nlslatt May 27, 2021
e691572
#1376: tests: add spec-related to enum conversion
nlslatt May 27, 2021
47989b1
#1376: tests: add throw tests for enum conversion
nlslatt May 28, 2021
af88059
#1456: config: remove throw_on_abort from feature list
nlslatt May 28, 2021
feba7b7
#1376: balance: make data members private
nlslatt May 28, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/vt/configs/features/features_defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,5 @@
#define vt_feature_diagnostics_runtime 0 || vt_feature_cmake_diagnostics_runtime
#define vt_feature_libfort 0 || vt_feature_cmake_libfort
#define vt_feature_production_build 0 || vt_feature_cmake_production_build
#define vt_feature_throw_on_abort 0 || vt_feature_cmake_throw_on_abort

#endif /*INCLUDED_VT_CONFIGS_FEATURES_FEATURES_DEFINES_H*/
225 changes: 225 additions & 0 deletions src/vt/vrt/collection/balance/gossiplb/gossip_enums.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,225 @@
/*
//@HEADER
// *****************************************************************************
//
// gossip_enums.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 [email protected]
//
// *****************************************************************************
//@HEADER
*/

#if !defined INCLUDED_VT_VRT_COLLECTION_BALANCE_GOSSIPLB_GOSSIPLB_ENUMS_H
#define INCLUDED_VT_VRT_COLLECTION_BALANCE_GOSSIPLB_GOSSIPLB_ENUMS_H

#include "vt/config.h"
#include "vt/vrt/collection/balance/gossiplb/criterion.h"

namespace vt { namespace vrt { namespace collection { namespace lb {

/// Enum for gossiping approach
enum struct InformTypeEnum : uint8_t {
/**
* \brief Synchronous sharing of underloaded processor loads
*
* The round number is defined at the processor level. This approach
* propagates known loads after all messages for a round are received,
* maximizing the amount of information propagated per round, but has a
* synchronization cost.
*/
SyncInform = 0,
/**
* \brief Asynchronous sharing of underloaded processor loads
*
* The round number is defined at the message level. This approach
* propagates known loads when the first message for a round is received,
* avoiding the synchronization cost but delaying the propagation of some
* information until the following round.
*/
AsyncInform = 1
};

/// Enum for the order in which local objects are considered for transfer
enum struct ObjectOrderEnum : uint8_t {
Arbitrary = 0, //< Arbitrary order: iterate as defined by the unordered_map
/**
* \brief By element ID
*
* Sort ascending by the ID member of ElementIDStruct.
*/
ElmID = 1,
/**
* \brief Order for the fewest migrations
*
* Order starting with the object with the smallest load that can be
* transferred to drop the processor load below the average, then by
* descending load for objects with smaller loads, and finally by ascending
* load for objects with larger loads.
*/
FewestMigrations = 2,
/**
* \brief Order for migrating the objects with the smallest loads
*
* Find the object with the smallest load where the sum of its own load and
* all smaller loads meets or exceeds the amount by which this processor's
* load exceeds the target load. Order starting with that object, then by
* descending load for objects with smaller loads, and finally by ascending
* load for objects with larger loads.
*/
SmallObjects = 3,
/**
* \brief Order by descending load
*/
LargestObjects = 4
};

/// Enum for how the CMF is computed
enum struct CMFTypeEnum : uint8_t {
/**
* \brief Original approach
*
* Remove processors from the CMF as soon as they exceed the target (e.g.,
* processor-avg) load. Use a CMF factor of 1.0/x, where x is the target load.
*/
Original = 0,
/**
* \brief Compute the CMF factor using the largest processor load in the CMF
*
* Do not remove processors from the CMF that exceed the target load until the
* next iteration. Use a CMF factor of 1.0/x, where x is the greater of the
* target load and the load of the most loaded processor in the CMF.
*/
NormByMax = 1,
/**
* \brief Compute the CMF factor using the load of this processor
*
* Do not remove processors from the CMF that exceed the target load until the
* next iteration. Use a CMF factor of 1.0/x, where x is the load of the
* processor that is computing the CMF.
*/
NormBySelf = 2,
/**
* \brief Narrow the CMF to only include processors that can accommodate the
* transfer
*
* Use a CMF factor of 1.0/x, where x is the greater of the target load and
* the load of the most loaded processor in the CMF. Only include processors
* in the CMF that will pass the chosen Criterion for the object being
* considered for transfer.
*/
NormByMaxExcludeIneligible = 3,
};

/// Enum for determining fanout and rounds
enum struct KnowledgeEnum : uint8_t {
/**
* \brief User defined values of fanout and rounds
*
* The fanout and rounds must be set explicitly
*/
UserDefined = 0,
/**
* \brief Full information
*
* The fanout will be as large as possible, with only one round
*/
Complete = 1,
/**
* \brief Choose rounds and/or fanout based on log rule
*
* The relationship between rounds and fanout will be approximately
* rounds = log(num_ranks)/log(fanout).
*/
Log = 2
};

}}}} /* end namespace vt::vrt::collection::lb */

namespace std {

template <>
struct hash<::vt::vrt::collection::lb::CriterionEnum> {
size_t operator()(::vt::vrt::collection::lb::CriterionEnum const& in) const {
using under = std::underlying_type<
::vt::vrt::collection::lb::CriterionEnum
>::type;
return std::hash<under>()(static_cast<under>(in));
}
};

template <>
struct hash<::vt::vrt::collection::lb::InformTypeEnum> {
size_t operator()(::vt::vrt::collection::lb::InformTypeEnum const& in) const {
using under = std::underlying_type<
::vt::vrt::collection::lb::InformTypeEnum
>::type;
return std::hash<under>()(static_cast<under>(in));
}
};

template <>
struct hash<::vt::vrt::collection::lb::ObjectOrderEnum> {
size_t operator()(::vt::vrt::collection::lb::ObjectOrderEnum const& in) const {
using under = std::underlying_type<
::vt::vrt::collection::lb::ObjectOrderEnum
>::type;
return std::hash<under>()(static_cast<under>(in));
}
};

template <>
struct hash<::vt::vrt::collection::lb::CMFTypeEnum> {
size_t operator()(::vt::vrt::collection::lb::CMFTypeEnum const& in) const {
using under = std::underlying_type<
::vt::vrt::collection::lb::CMFTypeEnum
>::type;
return std::hash<under>()(static_cast<under>(in));
}
};

template <>
struct hash<::vt::vrt::collection::lb::KnowledgeEnum> {
size_t operator()(::vt::vrt::collection::lb::KnowledgeEnum const& in) const {
using under = std::underlying_type<
::vt::vrt::collection::lb::KnowledgeEnum
>::type;
return std::hash<under>()(static_cast<under>(in));
}
};

} /* end namespace std */

#endif /*INCLUDED_VT_VRT_COLLECTION_BALANCE_GOSSIPLB_GOSSIPLB_ENUMS_H*/
Loading