Line data Source code
1 0 : // Distributed under the MIT License. 2 : // See LICENSE.txt for details. 3 : 4 : #pragma once 5 : 6 : #include <cstddef> 7 : #include <memory> 8 : #include <optional> 9 : 10 : #include "DataStructures/DataBox/Tag.hpp" 11 : #include "Domain/Domain.hpp" 12 : #include "Domain/ElementDistribution.hpp" 13 : #include "Options/Auto.hpp" 14 : #include "Options/String.hpp" 15 : #include "Parallel/Tags/Parallelization.hpp" 16 : #include "Utilities/TMPL.hpp" 17 : 18 : namespace domain { 19 : namespace OptionTags { 20 : /// \ingroup OptionTagsGroup 21 : /// \ingroup ComputationalDomainGroup 22 0 : struct ElementDistribution { 23 0 : struct RoundRobin {}; 24 0 : using type = Options::Auto<ElementWeight, RoundRobin>; 25 0 : static constexpr Options::String help = { 26 : "Weighting pattern to use for ZCurve element distribution. Specify " 27 : "RoundRobin to just place each element on the next core."}; 28 0 : using group = Parallel::OptionTags::Parallelization; 29 : }; 30 : } // namespace OptionTags 31 : 32 : namespace Tags { 33 : /// \ingroup DataBoxTagsGroup 34 : /// \ingroup ComputationalDomainGroup 35 : /// Tag that holds method for how to distribute the elements on the given 36 : /// resources. 37 1 : struct ElementDistribution : db::SimpleTag { 38 0 : using type = std::optional<ElementWeight>; 39 0 : using option_tags = tmpl::list<OptionTags::ElementDistribution>; 40 : 41 0 : static constexpr bool pass_metavariables = false; 42 0 : static type create_from_options(const type& element_distribution) { 43 : return element_distribution; 44 : } 45 : }; 46 : } // namespace Tags 47 : } // namespace domain