Skip to content

Commit 626bc70

Browse files
github-actions[bot]greenc-FNAL
authored andcommitted
Apply clang-format fixes
1 parent 53f2a74 commit 626bc70

File tree

5 files changed

+61
-50
lines changed

5 files changed

+61
-50
lines changed

phlex/core/declared_fold.hpp

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -90,28 +90,29 @@ namespace phlex::experimental {
9090
}},
9191
join_{make_join_or_none<num_inputs>(
9292
g, full_name(), layers())}, // FIXME: This should change to include result product!
93-
fold_{
94-
g, concurrency, [this, ft = alg.release_algorithm()](messages_t<num_inputs> const& messages, auto&) {
95-
// N.B. The assumption is that a fold will *never* need to cache
96-
// the product store it creates. Any flush messages *do not* need
97-
// to be propagated to downstream nodes.
98-
auto const& msg = most_derived(messages);
99-
auto const& index = msg.store->index();
93+
fold_{g,
94+
concurrency,
95+
[this, ft = alg.release_algorithm()](messages_t<num_inputs> const& messages, auto&) {
96+
// N.B. The assumption is that a fold will *never* need to cache
97+
// the product store it creates. Any flush messages *do not* need
98+
// to be propagated to downstream nodes.
99+
auto const& msg = most_derived(messages);
100+
auto const& index = msg.store->index();
100101

101-
auto fold_index = index->parent(partition_);
102-
if (not fold_index) {
103-
return;
104-
}
102+
auto fold_index = index->parent(partition_);
103+
if (not fold_index) {
104+
return;
105+
}
105106

106-
auto const& index_hash_for_counter = fold_index->hash();
107+
auto const& index_hash_for_counter = fold_index->hash();
107108

108-
call(ft, messages, std::make_index_sequence<num_inputs>{});
109-
++calls_;
109+
call(ft, messages, std::make_index_sequence<num_inputs>{});
110+
++calls_;
110111

111-
counter_for(index_hash_for_counter).increment(index->layer_hash());
112+
counter_for(index_hash_for_counter).increment(index->layer_hash());
112113

113-
emit_and_evict_if_done(fold_index);
114-
}}
114+
emit_and_evict_if_done(fold_index);
115+
}}
115116
{
116117
if constexpr (num_inputs > 1ull) {
117118
make_edge(join_, fold_);
@@ -145,7 +146,9 @@ namespace phlex::experimental {
145146
product_specifications const& output() const override { return output_; }
146147

147148
template <std::size_t... Is>
148-
void call(function_t const& ft, messages_t<num_inputs> const& messages, std::index_sequence<Is...>)
149+
void call(function_t const& ft,
150+
messages_t<num_inputs> const& messages,
151+
std::index_sequence<Is...>)
149152
{
150153
auto const parent_index = most_derived(messages).store->index()->parent(partition_);
151154

phlex/core/declared_observer.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ namespace phlex::experimental {
8787
}
8888

8989
template <std::size_t... Is>
90-
void call(function_t const& ft, messages_t<num_inputs> const& messages, std::index_sequence<Is...>)
90+
void call(function_t const& ft,
91+
messages_t<num_inputs> const& messages,
92+
std::index_sequence<Is...>)
9193
{
9294
if constexpr (num_inputs == 1ull) {
9395
std::invoke(ft, std::get<Is>(input_).retrieve(messages)...);

phlex/core/declared_predicate.hpp

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,17 @@ namespace phlex::experimental {
6565
product_queries input_products) :
6666
declared_predicate{std::move(name), std::move(predicates), std::move(input_products)},
6767
join_{make_join_or_none<num_inputs>(g, full_name(), layers())},
68-
predicate_{
69-
g,
70-
concurrency,
71-
[this, ft = alg.release_algorithm()](messages_t<num_inputs> const& messages) -> predicate_result {
72-
auto const& msg = most_derived(messages);
73-
auto const& [store, message_id] = std::tie(msg.store, msg.id);
74-
75-
bool const rc = call(ft, messages, std::make_index_sequence<num_inputs>{});
76-
++calls_;
77-
return {message_id, rc};
78-
}}
68+
predicate_{g,
69+
concurrency,
70+
[this, ft = alg.release_algorithm()](
71+
messages_t<num_inputs> const& messages) -> predicate_result {
72+
auto const& msg = most_derived(messages);
73+
auto const& [store, message_id] = std::tie(msg.store, msg.id);
74+
75+
bool const rc = call(ft, messages, std::make_index_sequence<num_inputs>{});
76+
++calls_;
77+
return {message_id, rc};
78+
}}
7979
{
8080
if constexpr (num_inputs > 1ull) {
8181
make_edge(join_, predicate_);
@@ -95,7 +95,9 @@ namespace phlex::experimental {
9595
tbb::flow::sender<predicate_result>& sender() override { return predicate_; }
9696

9797
template <std::size_t... Is>
98-
bool call(function_t const& ft, messages_t<num_inputs> const& messages, std::index_sequence<Is...>)
98+
bool call(function_t const& ft,
99+
messages_t<num_inputs> const& messages,
100+
std::index_sequence<Is...>)
99101
{
100102
if constexpr (num_inputs == 1ull) {
101103
return std::invoke(ft, std::get<Is>(input_).retrieve(messages)...);

phlex/core/declared_transform.hpp

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -76,23 +76,24 @@ namespace phlex::experimental {
7676
output_{to_product_specifications(
7777
full_name(), std::move(output), make_output_type_ids<function_t>())},
7878
join_{make_join_or_none<num_inputs>(g, full_name(), layers())},
79-
transform_{g,
80-
concurrency,
81-
[this, ft = alg.release_algorithm()](messages_t<num_inputs> const& messages, auto& output) {
82-
auto const& msg = most_derived(messages);
83-
auto const& [store, message_id] = std::tie(msg.store, msg.id);
84-
85-
auto result = call(ft, messages, std::make_index_sequence<num_inputs>{});
86-
++calls_;
87-
++product_count_[store->index()->layer_hash()];
88-
89-
products new_products;
90-
new_products.add_all(output_, std::move(result));
91-
auto new_store = std::make_shared<product_store>(
92-
store->index(), this->full_name(), std::move(new_products));
93-
94-
std::get<0>(output).try_put({.store = std::move(new_store), .id = message_id});
95-
}}
79+
transform_{
80+
g,
81+
concurrency,
82+
[this, ft = alg.release_algorithm()](messages_t<num_inputs> const& messages, auto& output) {
83+
auto const& msg = most_derived(messages);
84+
auto const& [store, message_id] = std::tie(msg.store, msg.id);
85+
86+
auto result = call(ft, messages, std::make_index_sequence<num_inputs>{});
87+
++calls_;
88+
++product_count_[store->index()->layer_hash()];
89+
90+
products new_products;
91+
new_products.add_all(output_, std::move(result));
92+
auto new_store = std::make_shared<product_store>(
93+
store->index(), this->full_name(), std::move(new_products));
94+
95+
std::get<0>(output).try_put({.store = std::move(new_store), .id = message_id});
96+
}}
9697
{
9798
if constexpr (num_inputs > 1ull) {
9899
make_edge(join_, transform_);
@@ -117,7 +118,9 @@ namespace phlex::experimental {
117118
product_specifications const& output() const override { return output_; }
118119

119120
template <std::size_t... Is>
120-
auto call(function_t const& ft, messages_t<num_inputs> const& messages, std::index_sequence<Is...>)
121+
auto call(function_t const& ft,
122+
messages_t<num_inputs> const& messages,
123+
std::index_sequence<Is...>)
121124
{
122125
if constexpr (num_inputs == 1ull) {
123126
return std::invoke(ft, std::get<Is>(input_).retrieve(messages)...);

phlex/core/declared_unfold.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,8 @@ namespace phlex::experimental {
190190
input_retriever_types<input_args> input_{input_arguments<input_args>()};
191191
product_specifications output_;
192192
join_or_none_t<num_inputs> join_;
193-
tbb::flow::multifunction_node<messages_t<num_inputs>, std::tuple<message, data_cell_index_ptr>> unfold_;
193+
tbb::flow::multifunction_node<messages_t<num_inputs>, std::tuple<message, data_cell_index_ptr>>
194+
unfold_;
194195
flusher_t flusher_;
195196
std::atomic<std::size_t> msg_counter_{}; // Is this sufficient? Probably not.
196197
std::atomic<std::size_t> calls_{};

0 commit comments

Comments
 (0)