diff --git a/form/form_module.cpp b/form/form_module.cpp index f18a5c077..9f4ff8d03 100644 --- a/form/form_module.cpp +++ b/form/form_module.cpp @@ -76,15 +76,15 @@ namespace { products.reserve(store.size()); // Iterate through all products in the store - for (auto const& [product_name, product_ptr] : store) { - // product_name: "tracks" (from the map key) + for (auto const& [product_spec, product_ptr] : store) { + // product_spec: "tracks" (from the map key) // product_ptr: pointer to the actual product data assert(product_ptr && "store should not contain null product_ptr"); - std::cout << " Product: " << product_name.full() << "\n"; + std::cout << " Product: " << product_spec.full() << "\n"; // Create FORM product with metadata - products.emplace_back(product_name.name().trans_get_string(), // label, from map key + products.emplace_back(product_spec.suffix().trans_get_string(), // label, from map key product_ptr->address(), // data, from phlex product_base &product_ptr->type() // type, from phlex product_base ); diff --git a/phlex/core/declared_fold.hpp b/phlex/core/declared_fold.hpp index 4a6415324..d17e99d56 100644 --- a/phlex/core/declared_fold.hpp +++ b/phlex/core/declared_fold.hpp @@ -69,10 +69,10 @@ namespace phlex::experimental { tbb::flow::graph& g, AlgorithmBits alg, InitTuple initializer, - product_queries product_labels, + product_queries input_products, std::vector output, std::string partition) : - declared_fold{std::move(name), std::move(predicates), std::move(product_labels)}, + declared_fold{std::move(name), std::move(predicates), std::move(input_products)}, initializer_{std::move(initializer)}, output_{ to_product_specifications(full_name(), std::move(output), make_type_ids())}, @@ -132,9 +132,9 @@ namespace phlex::experimental { } } - tbb::flow::receiver& port_for(product_query const& product_label) override + tbb::flow::receiver& port_for(product_query const& input_product) override { - return receiver_for(join_, input(), product_label, fold_); + return receiver_for(join_, input(), input_product, fold_); } std::vector*> ports() override diff --git a/phlex/core/declared_observer.hpp b/phlex/core/declared_observer.hpp index d1bea85e8..14b3bf78b 100644 --- a/phlex/core/declared_observer.hpp +++ b/phlex/core/declared_observer.hpp @@ -76,9 +76,9 @@ namespace phlex::experimental { } private: - tbb::flow::receiver& port_for(product_query const& product_label) override + tbb::flow::receiver& port_for(product_query const& input_product) override { - return receiver_for(join_, input(), product_label, observer_); + return receiver_for(join_, input(), input_product, observer_); } std::vector*> ports() override diff --git a/phlex/core/declared_predicate.hpp b/phlex/core/declared_predicate.hpp index 72643c7da..7f0f5bd84 100644 --- a/phlex/core/declared_predicate.hpp +++ b/phlex/core/declared_predicate.hpp @@ -83,9 +83,9 @@ namespace phlex::experimental { } private: - tbb::flow::receiver& port_for(product_query const& product_label) override + tbb::flow::receiver& port_for(product_query const& input_product) override { - return receiver_for(join_, input(), product_label, predicate_); + return receiver_for(join_, input(), input_product, predicate_); } std::vector*> ports() override diff --git a/phlex/core/declared_transform.hpp b/phlex/core/declared_transform.hpp index 34358cd8d..80b63ba90 100644 --- a/phlex/core/declared_transform.hpp +++ b/phlex/core/declared_transform.hpp @@ -101,9 +101,9 @@ namespace phlex::experimental { } private: - tbb::flow::receiver& port_for(product_query const& product_label) override + tbb::flow::receiver& port_for(product_query const& input_product) override { - return receiver_for(join_, input(), product_label, transform_); + return receiver_for(join_, input(), input_product, transform_); } std::vector*> ports() override diff --git a/phlex/core/declared_unfold.cpp b/phlex/core/declared_unfold.cpp index 07bc82976..640a92433 100644 --- a/phlex/core/declared_unfold.cpp +++ b/phlex/core/declared_unfold.cpp @@ -18,7 +18,7 @@ namespace phlex::experimental { product_store_const_ptr generator::make_child(std::size_t const i, products new_products) { - auto child_index = parent_->index()->make_child(i, child_layer_name_); + auto child_index = parent_->index()->make_child(child_layer_name_, i); ++child_counts_[child_index->layer_hash()]; return std::make_shared(child_index, node_name_, std::move(new_products)); } diff --git a/phlex/core/declared_unfold.hpp b/phlex/core/declared_unfold.hpp index 8d5010cf5..0a01087b7 100644 --- a/phlex/core/declared_unfold.hpp +++ b/phlex/core/declared_unfold.hpp @@ -91,15 +91,15 @@ namespace phlex::experimental { tbb::flow::graph& g, Predicate&& predicate, Unfold&& unfold, - product_queries product_labels, - std::vector output_products, + product_queries input_products, + std::vector output_product_suffixes, std::string child_layer_name) : declared_unfold{std::move(name), std::move(predicates), - std::move(product_labels), + std::move(input_products), std::move(child_layer_name)}, output_{to_product_specifications(full_name(), - std::move(output_products), + std::move(output_product_suffixes), make_type_ids>>())}, join_{make_join_or_none(g, full_name(), layers())}, unfold_{g, @@ -125,9 +125,9 @@ namespace phlex::experimental { } private: - tbb::flow::receiver& port_for(product_query const& product_label) override + tbb::flow::receiver& port_for(product_query const& input_product) override { - return receiver_for(join_, input(), product_label, unfold_); + return receiver_for(join_, input(), input_product, unfold_); } std::vector*> ports() override { @@ -165,7 +165,7 @@ namespace phlex::experimental { auto running_value = obj.initial_value(); while (std::invoke(predicate, obj, running_value)) { products new_products; - auto new_id = unfolded_id->make_child(counter, child_layer()); + auto new_id = unfolded_id->make_child(child_layer(), counter); if constexpr (requires { std::invoke(unfold, obj, running_value, *new_id); }) { auto [next_value, prods] = std::invoke(unfold, obj, running_value, *new_id); new_products.add_all(output_, std::move(prods)); diff --git a/phlex/core/detail/filter_impl.cpp b/phlex/core/detail/filter_impl.cpp index 416356cea..5a7cf673f 100644 --- a/phlex/core/detail/filter_impl.cpp +++ b/phlex/core/detail/filter_impl.cpp @@ -51,8 +51,8 @@ namespace phlex::experimental { void decision_map::erase(accessor& a) { results_.erase(a); } - data_map::data_map(product_queries const& product_names) : - product_names_{&product_names}, nargs_{product_names.size()} + data_map::data_map(product_queries const& input_products) : + input_products_{&input_products}, nargs_{input_products.size()} { assert(nargs_ > 0); } @@ -76,7 +76,7 @@ namespace phlex::experimental { // Fill slots in the order of the input arguments to the downstream node. for (std::size_t i = 0; i != nargs_; ++i) { - if (elem[i] or not resolve_in_store((*product_names_)[i], *store)) { + if (elem[i] or not resolve_in_store((*input_products_)[i], *store)) { continue; } elem[i] = store; diff --git a/phlex/core/detail/filter_impl.hpp b/phlex/core/detail/filter_impl.hpp index 4d6dcd2de..9ca591608 100644 --- a/phlex/core/detail/filter_impl.hpp +++ b/phlex/core/detail/filter_impl.hpp @@ -64,7 +64,7 @@ namespace phlex::experimental { private: stores_t stores_; - std::vector const* product_names_; + std::vector const* input_products_; std::size_t nargs_; }; } diff --git a/phlex/core/edge_creation_policy.hpp b/phlex/core/edge_creation_policy.hpp index b6f0783e7..98e5e4262 100644 --- a/phlex/core/edge_creation_policy.hpp +++ b/phlex/core/edge_creation_policy.hpp @@ -13,7 +13,7 @@ #include namespace phlex::experimental { - using product_name_t = identifier; + using product_suffix_t = identifier; class edge_creation_policy { public: @@ -31,25 +31,25 @@ namespace phlex::experimental { private: template - static std::multimap producing_nodes(T& nodes); + static std::multimap producing_nodes(T& nodes); - std::multimap producers_; + std::multimap producers_; }; // ============================================================================= // Implementation template - std::multimap + std::multimap edge_creation_policy::producing_nodes(T& nodes) { - std::multimap result; + std::multimap result; for (auto const& [node_name, node] : nodes) { - for (auto const& product_name : node->output()) { - if (product_name.name().empty()) + for (auto const& product_spec : node->output()) { + if (product_spec.suffix().empty()) continue; - result.emplace(product_name.name(), - named_output_port{node_name, &node->output_port(), product_name.type()}); + result.emplace(product_spec.suffix(), + named_output_port{node_name, &node->output_port(), product_spec.type()}); } } return result; diff --git a/phlex/core/edge_maker.cpp b/phlex/core/edge_maker.cpp index 504f6935b..961ec2cf4 100644 --- a/phlex/core/edge_maker.cpp +++ b/phlex/core/edge_maker.cpp @@ -5,6 +5,8 @@ #include +using namespace std::string_literals; + namespace phlex::experimental { index_router::provider_input_ports_t make_provider_edges(index_router::head_ports_t head_ports, declared_providers& providers) @@ -19,14 +21,14 @@ namespace phlex::experimental { bool found_match = false; for (auto const& [_, p] : providers) { auto& provider = *p; - if (port.product_label.match(provider.output_product())) { + if (port.input_product.match(provider.output_product())) { if (!result.contains(provider.full_name())) { - result.try_emplace(provider.full_name(), port.product_label, provider.input_port()); + result.try_emplace(provider.full_name(), port.input_product, provider.input_port()); } spdlog::debug("Connecting provider {} to node {} (product: {})", provider.full_name(), node_name, - port.product_label.to_string()); + port.input_product.to_string()); make_edge(provider.output_port(), *(port.port)); found_match = true; break; @@ -34,7 +36,7 @@ namespace phlex::experimental { } if (!found_match) { throw std::runtime_error("No provider found for product: "s + - port.product_label.to_string()); + port.input_product.to_string()); } } } diff --git a/phlex/core/edge_maker.hpp b/phlex/core/edge_maker.hpp index fb4bf3289..c64d8b79b 100644 --- a/phlex/core/edge_maker.hpp +++ b/phlex/core/edge_maker.hpp @@ -21,9 +21,6 @@ #include namespace phlex::experimental { - using namespace std::string_literals; - - using product_name_t = identifier; index_router::provider_input_ports_t make_provider_edges(index_router::head_ports_t head_ports, declared_providers& providers); diff --git a/phlex/core/index_router.hpp b/phlex/core/index_router.hpp index b15065eb4..b1b9e6752 100644 --- a/phlex/core/index_router.hpp +++ b/phlex/core/index_router.hpp @@ -77,7 +77,7 @@ namespace phlex::experimental { class index_router { public: struct named_input_port { - product_query product_label; + product_query input_product; tbb::flow::receiver* port; }; using named_input_ports_t = std::vector; @@ -86,7 +86,7 @@ namespace phlex::experimental { using head_ports_t = std::map; struct provider_input_port_t { - product_query product_label; + product_query input_product; tbb::flow::receiver* port; }; using provider_input_ports_t = std::map; diff --git a/phlex/core/message.cpp b/phlex/core/message.cpp index f0124c953..bb2ec32f1 100644 --- a/phlex/core/message.cpp +++ b/phlex/core/message.cpp @@ -22,14 +22,14 @@ namespace phlex::experimental { return b; } - std::size_t port_index_for(product_queries const& product_labels, - product_query const& product_label) + std::size_t port_index_for(product_queries const& input_products, + product_query const& input_product) { - auto const [b, e] = std::tuple{cbegin(product_labels), cend(product_labels)}; - auto it = std::find(b, e, product_label); + auto const [b, e] = std::tuple{cbegin(input_products), cend(input_products)}; + auto it = std::find(b, e, input_product); if (it == e) { throw std::runtime_error( - fmt::format("Algorithm does not accept product '{}'.", product_label)); + fmt::format("Algorithm does not accept product '{}'.", input_product)); } return std::distance(b, it); } diff --git a/phlex/core/message.hpp b/phlex/core/message.hpp index bea2af04a..9b9d6c809 100644 --- a/phlex/core/message.hpp +++ b/phlex/core/message.hpp @@ -67,8 +67,8 @@ namespace phlex::experimental { // Non-template overload for single message case inline message const& most_derived(message const& msg) { return msg; } - std::size_t port_index_for(product_queries const& product_labels, - product_query const& product_label); + std::size_t port_index_for(product_queries const& input_products, + product_query const& input_product); } #endif // PHLEX_CORE_MESSAGE_HPP diff --git a/phlex/core/multilayer_join_node.hpp b/phlex/core/multilayer_join_node.hpp index b1743de44..025138e61 100644 --- a/phlex/core/multilayer_join_node.hpp +++ b/phlex/core/multilayer_join_node.hpp @@ -187,15 +187,15 @@ namespace phlex::experimental { }(std::make_index_sequence{}); } - // Looks up the port index for the given product label, then returns a reference to + // Looks up the port index for the given input product query, then returns a reference to // the corresponding input port of the join node. Only valid for N > 1. template tbb::flow::receiver& receiver_for(join_or_none_t& join, - product_queries const& product_labels, - product_query const& product_label) + product_queries const& input_products, + product_query const& input_product) { static_assert(N > 1ull, "receiver_for should not be called for N=1"); - auto const index = port_index_for(product_labels, product_label); + auto const index = port_index_for(input_products, input_product); return receiver_for<0ull, N>(join, index); } } @@ -212,19 +212,19 @@ namespace phlex::experimental { } } - // Returns the receiver for the input port that corresponds to the given product label. For - // N == 1 there is only one port so the node itself is returned; for N > 1 the port is looked - // up by label within the join. + // Returns the receiver for the input port that corresponds to the given input product query. + // For N == 1 there is only one port so the node itself is returned; for N > 1 the port is + // looked up by query within the join. template tbb::flow::receiver& receiver_for(join_or_none_t& join, - product_queries const& product_labels, - product_query const& product_label, + product_queries const& input_products, + product_query const& input_product, Node& node) { if constexpr (N == 1ull) { return node; } else { - return detail::receiver_for(join, product_labels, product_label); + return detail::receiver_for(join, input_products, input_product); } } } diff --git a/phlex/core/product_query.cpp b/phlex/core/product_query.cpp index bad04e96e..e91422f3e 100644 --- a/phlex/core/product_query.cpp +++ b/phlex/core/product_query.cpp @@ -37,7 +37,7 @@ namespace phlex { return false; } if (suffix) { - if (*suffix != spec.name()) { + if (*suffix != spec.suffix()) { return false; } } diff --git a/phlex/core/products_consumer.cpp b/phlex/core/products_consumer.cpp index ab1be59eb..6c9a920ff 100644 --- a/phlex/core/products_consumer.cpp +++ b/phlex/core/products_consumer.cpp @@ -27,9 +27,9 @@ namespace phlex::experimental { std::size_t products_consumer::num_inputs() const { return input().size(); } - tbb::flow::receiver& products_consumer::port(product_query const& product_label) + tbb::flow::receiver& products_consumer::port(product_query const& input_product) { - return port_for(product_label); + return port_for(input_product); } product_queries const& products_consumer::input() const noexcept { return input_products_; } diff --git a/phlex/core/products_consumer.hpp b/phlex/core/products_consumer.hpp index a88e7e7f1..585c2b429 100644 --- a/phlex/core/products_consumer.hpp +++ b/phlex/core/products_consumer.hpp @@ -27,7 +27,7 @@ namespace phlex::experimental { product_queries const& input() const noexcept; std::vector const& layers() const noexcept; - tbb::flow::receiver& port(product_query const& product_label); + tbb::flow::receiver& port(product_query const& input_product); virtual named_index_ports index_ports() = 0; virtual std::vector*> ports() = 0; @@ -41,7 +41,7 @@ namespace phlex::experimental { } private: - virtual tbb::flow::receiver& port_for(product_query const& product_label) = 0; + virtual tbb::flow::receiver& port_for(product_query const& input_product) = 0; product_queries input_products_; std::vector layers_; diff --git a/phlex/core/registrar.hpp b/phlex/core/registrar.hpp index d51fa32e6..3ac57efad 100644 --- a/phlex/core/registrar.hpp +++ b/phlex/core/registrar.hpp @@ -10,8 +10,8 @@ // .transform("name", &MyTransform::transform, concurrency{n}) // .input_family(...) // .when(...) -// .output_products(...); -// ^ Registration occurs at the completion of the full statement. +// .output_product_suffixes(...); +// ^ Registration occurs at the completion of the full statement. // // This is achieved by creating a registrar class object (internally during any of the // declare* calls), which is then passed along through each successive function call @@ -86,16 +86,16 @@ namespace phlex::experimental { predicates_ = std::move(predicates); } - void set_output_products(std::vector output_products) + void set_output_product_suffixes(std::vector output_product_suffixes) { - create_node(std::move(output_products)); + create_node(std::move(output_product_suffixes)); creator_ = nullptr; } ~registrar() noexcept(false) { if (creator_) { - create_node(std::move(output_products_)); + create_node(std::move(output_product_suffixes_)); } } @@ -105,10 +105,10 @@ namespace phlex::experimental { return std::move(predicates_).value_or(std::vector{}); } - void create_node(std::vector output_product_labels) + void create_node(std::vector output_product_suffixes) { assert(creator_); - auto ptr = creator_(release_predicates(), std::move(output_product_labels)); + auto ptr = creator_(release_predicates(), std::move(output_product_suffixes)); auto name = ptr->full_name(); auto [_, inserted] = nodes_->try_emplace(name, std::move(ptr)); if (not inserted) { @@ -120,7 +120,7 @@ namespace phlex::experimental { std::vector* errors_; node_creator creator_{}; std::optional> predicates_; - std::vector output_products_{}; + std::vector output_product_suffixes_{}; }; } diff --git a/phlex/core/registration_api.hpp b/phlex/core/registration_api.hpp index ce4d8e5b4..997592f28 100644 --- a/phlex/core/registration_api.hpp +++ b/phlex/core/registration_api.hpp @@ -55,25 +55,25 @@ namespace phlex::experimental { populate_types(input_args); if constexpr (num_outputs == 0ull) { - registrar_.set_creator( - [this, inputs = std::move(input_args)](auto predicates, auto /* output_products */) { - return std::make_unique(std::move(name_), - concurrency_.value, - std::move(predicates), - graph_, - std::move(alg_), - std::vector(inputs.begin(), inputs.end())); - }); + registrar_.set_creator([this, inputs = std::move(input_args)]( + auto predicates, auto /* output_product_suffixes */) { + return std::make_unique(std::move(name_), + concurrency_.value, + std::move(predicates), + graph_, + std::move(alg_), + std::vector(inputs.begin(), inputs.end())); + }); } else { registrar_.set_creator( - [this, inputs = std::move(input_args)](auto predicates, auto output_products) { + [this, inputs = std::move(input_args)](auto predicates, auto output_product_suffixes) { return std::make_unique(std::move(name_), concurrency_.value, std::move(predicates), graph_, std::move(alg_), std::vector(inputs.begin(), inputs.end()), - std::move(output_products)); + std::move(output_product_suffixes)); }); } return upstream_predicates{std::move(registrar_), config_}; @@ -138,11 +138,11 @@ namespace phlex::experimental { output.type = make_type_id(); - registrar_.set_creator( - [this, output = std::move(output)](auto /* predicates */, auto /* output_products */) { - return std::make_unique( - std::move(name_), concurrency_.value, graph_, std::move(alg_), std::move(output)); - }); + registrar_.set_creator([this, output = std::move(output)]( + auto /* predicates */, auto /* output_product_suffixes */) { + return std::make_unique( + std::move(name_), concurrency_.value, graph_, std::move(alg_), std::move(output)); + }); } private: @@ -191,7 +191,7 @@ namespace phlex::experimental { populate_types(input_args); registrar_.set_creator( - [this, inputs = std::move(input_args)](auto predicates, auto output_products) { + [this, inputs = std::move(input_args)](auto predicates, auto output_product_suffixes) { return std::make_unique>( std::move(name_), concurrency_.value, @@ -200,7 +200,7 @@ namespace phlex::experimental { std::move(alg_), std::move(init_), std::vector(inputs.begin(), inputs.end()), - std::move(output_products), + std::move(output_product_suffixes), std::move(partition_)); }); return upstream_predicates{std::move(registrar_), config_}; @@ -266,19 +266,19 @@ namespace phlex::experimental { { populate_types(input_args); - registrar_.set_creator( - [this, inputs = std::move(input_args)](auto upstream_predicates, auto output_products) { - return std::make_unique>( - std::move(name_), - concurrency_, - std::move(upstream_predicates), - graph_, - std::move(predicate_), - std::move(unfold_), - std::vector(inputs.begin(), inputs.end()), - std::move(output_products), - std::move(destination_layer_)); - }); + registrar_.set_creator([this, inputs = std::move(input_args)](auto upstream_predicates, + auto output_product_suffixes) { + return std::make_unique>( + std::move(name_), + concurrency_, + std::move(upstream_predicates), + graph_, + std::move(predicate_), + std::move(unfold_), + std::vector(inputs.begin(), inputs.end()), + std::move(output_product_suffixes), + std::move(destination_layer_)); + }); return upstream_predicates{std::move(registrar_), config_}; } diff --git a/phlex/core/upstream_predicates.hpp b/phlex/core/upstream_predicates.hpp index 78b080835..5fe283c45 100644 --- a/phlex/core/upstream_predicates.hpp +++ b/phlex/core/upstream_predicates.hpp @@ -38,19 +38,20 @@ namespace phlex::experimental { template requires(NumberOutputProducts > 0) - void output_products(std::array outputs) + void output_product_suffixes(std::array outputs) { static_assert( NumberOutputProducts == M, "The number of specified products is not the same as the number of returned output " "objects."); - registrar_.set_output_products(std::vector(outputs.begin(), outputs.end())); + registrar_.set_output_product_suffixes(std::vector(outputs.begin(), outputs.end())); } - void output_products(std::convertible_to auto&&... ts) + void output_product_suffixes(std::convertible_to auto&&... ts) { constexpr std::size_t num_products = sizeof...(ts); - output_products(std::array{std::forward(ts)...}); + output_product_suffixes( + std::array{std::forward(ts)...}); } private: diff --git a/phlex/model/data_cell_index.cpp b/phlex/model/data_cell_index.cpp index e3c0e31f8..a83e22df8 100644 --- a/phlex/model/data_cell_index.cpp +++ b/phlex/model/data_cell_index.cpp @@ -76,8 +76,8 @@ namespace phlex { std::size_t data_cell_index::depth() const noexcept { return depth_; } - data_cell_index_ptr data_cell_index::make_child(std::size_t const data_cell_number, - std::string child_layer_name) const + data_cell_index_ptr data_cell_index::make_child(std::string child_layer_name, + std::size_t const data_cell_number) const { return data_cell_index_ptr{new data_cell_index{ shared_from_this(), data_cell_number, experimental::identifier{std::move(child_layer_name)}}}; diff --git a/phlex/model/data_cell_index.hpp b/phlex/model/data_cell_index.hpp index d4bdc83ff..e96d4b7cb 100644 --- a/phlex/model/data_cell_index.hpp +++ b/phlex/model/data_cell_index.hpp @@ -20,7 +20,7 @@ namespace phlex { static data_cell_index_ptr base_ptr(); using hash_type = std::size_t; - data_cell_index_ptr make_child(std::size_t data_cell_number, std::string layer_name) const; + data_cell_index_ptr make_child(std::string layer_name, std::size_t data_cell_number) const; experimental::identifier const& layer_name() const noexcept; std::string layer_path() const; std::size_t depth() const noexcept; diff --git a/phlex/model/handle.hpp b/phlex/model/handle.hpp index c89191b86..8d25a7e54 100644 --- a/phlex/model/handle.hpp +++ b/phlex/model/handle.hpp @@ -64,7 +64,7 @@ namespace phlex { id_{&id}, creator_plugin_{key.plugin()}, creator_algorithm_{key.algorithm()}, - suffix_(key.name()) + suffix_(key.suffix()) { } diff --git a/phlex/model/product_specification.cpp b/phlex/model/product_specification.cpp index f386e1fde..6f018ce73 100644 --- a/phlex/model/product_specification.cpp +++ b/phlex/model/product_specification.cpp @@ -18,18 +18,18 @@ namespace phlex::experimental { product_specification::product_specification(std::string_view name) { *this = create(name); } product_specification::product_specification(algorithm_name qualifier, - identifier name, + identifier suffix, type_id type) : - qualifier_{std::move(qualifier)}, name_{std::move(name)}, type_id_{std::move(type)} + qualifier_{std::move(qualifier)}, suffix_{std::move(suffix)}, type_id_{std::move(type)} { } std::string product_specification::full() const { if (qualifier_.plugin().empty() && qualifier_.algorithm().empty()) { - return fmt::format("{}", name_); + return fmt::format("{}", suffix_); } - return fmt::format("{}/{}", qualifier_.full(), name_); + return fmt::format("{}/{}", qualifier_.full(), suffix_); } product_specification product_specification::create(char const* c) @@ -49,17 +49,17 @@ namespace phlex::experimental { } product_specifications to_product_specifications(std::string_view const name, - std::vector output_labels, + std::vector output_suffixes, std::vector output_types) { - assert(output_labels.size() == output_types.size()); + assert(output_suffixes.size() == output_types.size()); product_specifications outputs; - outputs.reserve(output_labels.size()); + outputs.reserve(output_suffixes.size()); // zip view isn't available until C++23 so we have to use a loop over the index - for (std::size_t i = 0; i < output_labels.size(); ++i) { + for (std::size_t i = 0; i < output_suffixes.size(); ++i) { outputs.emplace_back( - algorithm_name::create(name), identifier(output_labels[i]), output_types[i]); + algorithm_name::create(name), identifier(output_suffixes[i]), output_types[i]); } return outputs; } diff --git a/phlex/model/product_specification.hpp b/phlex/model/product_specification.hpp index 5167f4741..37f95ce9f 100644 --- a/phlex/model/product_specification.hpp +++ b/phlex/model/product_specification.hpp @@ -18,13 +18,13 @@ namespace phlex::experimental { product_specification(char const* name); product_specification(std::string const& name); product_specification(std::string_view name); - product_specification(algorithm_name qualifier, identifier name, type_id type); + product_specification(algorithm_name qualifier, identifier suffix, type_id type); std::string full() const; algorithm_name const& qualifier() const noexcept { return qualifier_; } identifier const& plugin() const noexcept { return qualifier_.plugin(); } identifier const& algorithm() const noexcept { return qualifier_.algorithm(); } - identifier const& name() const noexcept { return name_; } + identifier const& suffix() const noexcept { return suffix_; } type_id type() const noexcept { return type_id_; } void set_type(type_id&& type) { type_id_ = std::move(type); } @@ -38,14 +38,14 @@ namespace phlex::experimental { private: algorithm_name qualifier_; - identifier name_; + identifier suffix_; type_id type_id_{}; }; using product_specifications = std::vector; product_specifications to_product_specifications(std::string_view name, - std::vector output_labels, + std::vector output_suffixes, std::vector output_types); } @@ -55,7 +55,7 @@ struct std::hash { { std::size_t hash = spec.qualifier_.plugin().hash(); boost::hash_combine(hash, spec.qualifier_.algorithm().hash()); - boost::hash_combine(hash, spec.name_.hash()); + boost::hash_combine(hash, spec.suffix_.hash()); boost::hash_combine(hash, spec.type_id_); return hash; } diff --git a/plugins/layer_generator.cpp b/plugins/layer_generator.cpp index 1206bbf17..d81be9577 100644 --- a/plugins/layer_generator.cpp +++ b/plugins/layer_generator.cpp @@ -129,7 +129,7 @@ namespace phlex::experimental { bool const recurse = parent_to_children_.contains(full_child_path); auto const& [_, total_per_parent, starting_value] = layers_.at(full_child_path); for (unsigned int i : std::views::iota(starting_value, total_per_parent + starting_value)) { - execute(driver, index->make_child(i, child), recurse); + execute(driver, index->make_child(child, i), recurse); } } } diff --git a/plugins/python/src/modulewrap.cpp b/plugins/python/src/modulewrap.cpp index b5a5713ce..bdedef7e2 100644 --- a/plugins/python/src/modulewrap.cpp +++ b/plugins/python/src/modulewrap.cpp @@ -267,7 +267,7 @@ namespace { if (!output) return cargs; - PyObject* coll = PySequence_Fast(output, "output_products must be a sequence"); + PyObject* coll = PySequence_Fast(output, "output_product_suffixes must be a sequence"); if (!coll) return cargs; @@ -538,7 +538,7 @@ namespace { { mod->ph_module->transform(name, converter, concurrency::serial) .input_family(pq_in) - .output_products(output); + .output_product_suffixes(output); } } // unnamed namespace @@ -548,7 +548,7 @@ static PyObject* parse_args(PyObject* args, std::string& functor_name, std::vector& input_queries, std::vector& input_types, - std::vector& output_labels, + std::vector& output_suffixes, std::vector& output_types) { // Helper function to extract the common names and identifiers needed to insert @@ -556,7 +556,7 @@ static PyObject* parse_args(PyObject* args, // retrieved, not ignored, to issue an error message if an output is provided.) static char const* kwnames[] = { - "callable", "input_family", "output_products", "concurrency", "name", nullptr}; + "callable", "input_family", "output_product_suffixes", "concurrency", "name", nullptr}; PyObject *callable = 0, *input = 0, *output = 0, *concurrency = 0, *pyname = 0; if (!PyArg_ParseTupleAndKeywords( args, kwds, "OO|OOO", (char**)kwnames, &callable, &input, &output, &concurrency, &pyname)) { @@ -605,8 +605,8 @@ static PyObject* parse_args(PyObject* args, } // convert output declarations, to be able to pass them to Phlex - output_labels = validate_output(output); - if (output_labels.size() > 1) { + output_suffixes = validate_output(output); + if (output_suffixes.size() > 1) { PyErr_SetString(PyExc_TypeError, "only a single output supported"); return nullptr; } @@ -648,7 +648,7 @@ static PyObject* parse_args(PyObject* args, output_types.clear(); // if annotations were correct (and correctly parsed), there should be as many - // input types as input labels + // input types as input product queries if (input_types.size() != input_queries.size()) { PyErr_Format(PyExc_TypeError, "number of inputs (%d; %s) does not match number of annotation types (%d; %s)", @@ -741,9 +741,9 @@ static PyObject* md_transform(py_phlex_module* mod, PyObject* args, PyObject* kw std::string cname; std::vector input_queries; - std::vector input_types, output_labels, output_types; + std::vector input_types, output_suffixes, output_types; PyObject* callable = - parse_args(args, kwds, cname, input_queries, input_types, output_labels, output_types); + parse_args(args, kwds, cname, input_queries, input_types, output_suffixes, output_types); if (!callable) return nullptr; // error already set @@ -777,7 +777,7 @@ static PyObject* md_transform(py_phlex_module* mod, PyObject* args, PyObject* kw // onto a std::tuple otherwise, which is a typed object, thus complicating the // template instantiation std::string pyname = "py_" + cname; - std::string pyoutput = output_labels[0] + "_py"; + std::string pyoutput = output_suffixes[0] + "_py"; auto pq0 = input_queries[0]; std::string c0 = input_converter_name(cname, 0); @@ -790,7 +790,7 @@ static PyObject* md_transform(py_phlex_module* mod, PyObject* args, PyObject* kw mod->ph_module->transform(pyname, *pyc, concurrency::serial) .input_family( product_query{.creator = identifier(c0), .layer = pq0.layer, .suffix = identifier(suff0)}) - .output_products(pyoutput); + .output_product_suffixes(pyoutput); break; } case 2: { @@ -803,7 +803,7 @@ static PyObject* md_transform(py_phlex_module* mod, PyObject* args, PyObject* kw .input_family( product_query{.creator = identifier(c0), .layer = pq0.layer, .suffix = identifier(suff0)}, product_query{.creator = identifier(c1), .layer = pq1.layer, .suffix = identifier(suff1)}) - .output_products(pyoutput); + .output_product_suffixes(pyoutput); break; } case 3: { @@ -821,7 +821,7 @@ static PyObject* md_transform(py_phlex_module* mod, PyObject* args, PyObject* kw product_query{.creator = identifier(c0), .layer = pq0.layer, .suffix = identifier(suff0)}, product_query{.creator = identifier(c1), .layer = pq1.layer, .suffix = identifier(suff1)}, product_query{.creator = identifier(c2), .layer = pq2.layer, .suffix = identifier(suff2)}) - .output_products(pyoutput); + .output_product_suffixes(pyoutput); break; } default: { @@ -836,7 +836,7 @@ static PyObject* md_transform(py_phlex_module* mod, PyObject* args, PyObject* kw .layer = identifier(output_layer), .suffix = identifier(pyoutput)}; std::string out_type = output_types[0]; - std::string output = output_labels[0]; + std::string output = output_suffixes[0]; if (out_type == "bool") insert_converter(mod, cname, py_to_bool, out_pq, output); else if (out_type == "int32_t") @@ -886,9 +886,9 @@ static PyObject* md_observe(py_phlex_module* mod, PyObject* args, PyObject* kwds std::string cname; std::vector input_queries; - std::vector input_types, output_labels, output_types; + std::vector input_types, output_suffixes, output_types; PyObject* callable = - parse_args(args, kwds, cname, input_queries, input_types, output_labels, output_types); + parse_args(args, kwds, cname, input_queries, input_types, output_suffixes, output_types); if (!callable) return nullptr; // error already set diff --git a/test/benchmarks/last_index.cpp b/test/benchmarks/last_index.cpp index 515741327..e1f38bca5 100644 --- a/test/benchmarks/last_index.cpp +++ b/test/benchmarks/last_index.cpp @@ -11,5 +11,5 @@ PHLEX_REGISTER_ALGORITHMS(m, config) { m.transform("last_index", last_index, concurrency::unlimited) .input_family(product_query{.creator = "input", .layer = "event", .suffix = "id"}) - .output_products(config.get("produces", "a")); + .output_product_suffixes(config.get("produces", "a")); } diff --git a/test/benchmarks/plus_101.cpp b/test/benchmarks/plus_101.cpp index f70462e78..434b4e8c9 100644 --- a/test/benchmarks/plus_101.cpp +++ b/test/benchmarks/plus_101.cpp @@ -10,5 +10,5 @@ PHLEX_REGISTER_ALGORITHMS(m, config) { m.transform("plus_101", plus_101, concurrency::unlimited) .input_family(config.get("input")) - .output_products("c"); + .output_product_suffixes("c"); } diff --git a/test/benchmarks/plus_one.cpp b/test/benchmarks/plus_one.cpp index 6caf6797a..0433f181a 100644 --- a/test/benchmarks/plus_one.cpp +++ b/test/benchmarks/plus_one.cpp @@ -10,5 +10,5 @@ PHLEX_REGISTER_ALGORITHMS(m, config) { m.transform("plus_one", plus_one, concurrency::unlimited) .input_family(config.get("input")) - .output_products("b"); + .output_product_suffixes("b"); } diff --git a/test/cached_execution.cpp b/test/cached_execution.cpp index f4fba7830..9e779f282 100644 --- a/test/cached_execution.cpp +++ b/test/cached_execution.cpp @@ -69,27 +69,27 @@ TEST_CASE("Cached function calls", "[data model]") g.transform("A1", call_one, concurrency::unlimited) .input_family(product_query{.creator = "input", .layer = "run", .suffix = "number"}) - .output_products("one"); + .output_product_suffixes("one"); g.transform("A2", call_one, concurrency::unlimited) .input_family(product_query{.creator = "A1", .layer = "run", .suffix = "one"}) - .output_products("used_one"); + .output_product_suffixes("used_one"); g.transform("A3", call_one, concurrency::unlimited) .input_family(product_query{.creator = "A2", .layer = "run", .suffix = "used_one"}) - .output_products("done_one"); + .output_product_suffixes("done_one"); g.transform("B1", call_two, concurrency::unlimited) .input_family(product_query{.creator = "A1", .layer = "run", .suffix = "one"}, product_query{.creator = "input", .layer = "subrun", .suffix = "another"}) - .output_products("two"); + .output_product_suffixes("two"); g.transform("B2", call_two, concurrency::unlimited) .input_family(product_query{.creator = "A2", .layer = "run", .suffix = "used_one"}, product_query{.creator = "B1", .layer = "subrun", .suffix = "two"}) - .output_products("used_two"); + .output_product_suffixes("used_two"); g.transform("C", call_two, concurrency::unlimited) .input_family(product_query{.creator = "B2", .layer = "subrun", .suffix = "used_two"}, product_query{.creator = "input", .layer = "event", .suffix = "still"}) - .output_products("three"); + .output_product_suffixes("three"); g.execute(); diff --git a/test/class_registration.cpp b/test/class_registration.cpp index ce0691284..8fedbd54f 100644 --- a/test/class_registration.cpp +++ b/test/class_registration.cpp @@ -59,11 +59,11 @@ namespace { TEST_CASE("Call non-framework functions", "[programming model]") { - std::array const product_names{ + std::array const input_products{ product_query{.creator = "input", .layer = "job", .suffix = "number"}, product_query{.creator = "input", .layer = "job", .suffix = "temperature"}, product_query{.creator = "input", .layer = "job", .suffix = "name"}}; - std::array const oproduct_names{"onumber"s, "otemperature"s, "oname"s}; + std::array const product_suffixes{"onumber"s, "otemperature"s, "oname"s}; experimental::framework_graph g{data_cell_index::base_ptr()}; @@ -79,36 +79,36 @@ TEST_CASE("Call non-framework functions", "[programming model]") SECTION("No framework") { glueball.transform("no_framework", &A::no_framework, concurrency::unlimited) - .input_family(product_names) - .output_products(oproduct_names); + .input_family(input_products) + .output_product_suffixes(product_suffixes); } SECTION("No framework, all references") { glueball.transform("no_framework_all_refs", &A::no_framework_all_refs, concurrency::unlimited) - .input_family(product_names) - .output_products(oproduct_names); + .input_family(input_products) + .output_product_suffixes(product_suffixes); } SECTION("No framework, all pointers") { glueball.transform("no_framework_all_ptrs", &A::no_framework_all_ptrs, concurrency::unlimited) - .input_family(product_names) - .output_products(oproduct_names); + .input_family(input_products) + .output_product_suffixes(product_suffixes); } SECTION("One framework argument") { glueball.transform("one_framework_arg", &A::one_framework_arg, concurrency::unlimited) - .input_family(product_names) - .output_products(oproduct_names); + .input_family(input_products) + .output_product_suffixes(product_suffixes); } SECTION("All framework arguments") { glueball.transform("all_framework_args", &A::all_framework_args, concurrency::unlimited) - .input_family(product_names) - .output_products(oproduct_names); + .input_family(input_products) + .output_product_suffixes(product_suffixes); } // The following is invoked for *each* section above - g.observe("verify_results", verify_results, concurrency::unlimited).input_family(product_names); + g.observe("verify_results", verify_results).input_family(input_products); g.execute(); } diff --git a/test/data_cell_counting.cpp b/test/data_cell_counting.cpp index 486d4e1a8..662cf89d3 100644 --- a/test/data_cell_counting.cpp +++ b/test/data_cell_counting.cpp @@ -39,17 +39,17 @@ TEST_CASE("Data layer hierarchy with ambiguous layer names", "[data model]") h.increment_count(job_index); CHECK(h.count_for("/job") == 1); - auto spill_index = job_index->make_child(0, "spill"); + auto spill_index = job_index->make_child("spill", 0); h.increment_count(spill_index); - auto run_index = job_index->make_child(0, "run"); + auto run_index = job_index->make_child("run", 0); h.increment_count(run_index); CHECK(h.count_for("/job/run") == 1); CHECK(h.count_for("run") == 1); // Nested spill indices - h.increment_count(run_index->make_child(0, "spill")); - h.increment_count(run_index->make_child(1, "spill")); + h.increment_count(run_index->make_child("spill", 0)); + h.increment_count(run_index->make_child("spill", 1)); CHECK_THROWS(h.count_for("spill")); CHECK(h.count_for("/job/spill") == 1); @@ -85,13 +85,13 @@ TEST_CASE("Counter multiple layers deep", "[data model]") auto job_index = data_cell_index::base_ptr(); counters.update(job_index); for (std::size_t i = 0; i != nruns; ++i) { - auto run_index = job_index->make_child(i, "run"); + auto run_index = job_index->make_child("run", i); counters.update(run_index); for (std::size_t j = 0; j != nsubruns_per_run; ++j) { - auto subrun_index = run_index->make_child(j, "subrun"); + auto subrun_index = run_index->make_child("subrun", j); counters.update(subrun_index); for (std::size_t k = 0; k != nevents_per_subrun; ++k) { - auto event_index = subrun_index->make_child(k, "event"); + auto event_index = subrun_index->make_child("event", k); counters.update(event_index); ++processed_events; diff --git a/test/data_cell_index.cpp b/test/data_cell_index.cpp index 681367d50..07ed0f55c 100644 --- a/test/data_cell_index.cpp +++ b/test/data_cell_index.cpp @@ -13,14 +13,14 @@ TEST_CASE("Verify independent hashes", "[data model]") auto base = data_cell_index::base_ptr(); CHECK(base->hash() == 0ull); - auto run = base->make_child(0, "run"); - auto subrun_0 = run->make_child(0, "subrun"); - auto event_760 = subrun_0->make_child(760, "event"); + auto run = base->make_child("run", 0); + auto subrun_0 = run->make_child("subrun", 0); + auto event_760 = subrun_0->make_child("event", 760); - auto subrun_1 = run->make_child(1, "subrun"); + auto subrun_1 = run->make_child("subrun", 1); CHECK(subrun_0->hash() != subrun_1->hash()); - auto event_4999 = subrun_1->make_child(4999, "event"); + auto event_4999 = subrun_1->make_child("event", 4999); CHECK(event_760->hash() != event_4999->hash()); CHECK(event_760->layer_hash() == event_4999->layer_hash()); } @@ -28,8 +28,8 @@ TEST_CASE("Verify independent hashes", "[data model]") TEST_CASE("data_cell_index methods", "[data model]") { auto base = data_cell_index::base_ptr(); - auto run0 = base->make_child(0, "run"); - auto run1 = base->make_child(1, "run"); + auto run0 = base->make_child("run", 0); + auto run1 = base->make_child("run", 1); SECTION("Comparisons") { @@ -37,26 +37,26 @@ TEST_CASE("data_cell_index methods", "[data model]") CHECK_FALSE(*run1 < *run0); CHECK_FALSE(*run0 < *run0); - auto subrun0 = run0->make_child(0, "subrun"); - auto subrun1 = run0->make_child(1, "subrun"); + auto subrun0 = run0->make_child("subrun", 0); + auto subrun1 = run0->make_child("subrun", 1); CHECK(*subrun0 < *subrun1); CHECK(*run0 < *subrun0); } SECTION("to_string") { - auto subrun = run0->make_child(5, "subrun"); + auto subrun = run0->make_child("subrun", 5); CHECK(subrun->to_string() == "[run:0, subrun:5]"); CHECK(base->to_string() == "[]"); - auto nameless = base->make_child(10, ""); + auto nameless = base->make_child("", 10); CHECK(nameless->to_string() == "[10]"); } SECTION("Parent lookup") { - auto subrun = run0->make_child(5, "subrun"); - auto event = subrun->make_child(100, "event"); + auto subrun = run0->make_child("subrun", 5); + auto event = subrun->make_child("event", 100); CHECK(event->parent("subrun"_id) == subrun); CHECK(event->parent("run"_id) == run0); @@ -65,7 +65,7 @@ TEST_CASE("data_cell_index methods", "[data model]") SECTION("Layer path") { - auto subrun = run0->make_child(5, "subrun"); + auto subrun = run0->make_child("subrun", 5); CHECK(subrun->layer_path() == "/job/run/subrun"); } diff --git a/test/demo-giantdata/unfold_transform_fold.cpp b/test/demo-giantdata/unfold_transform_fold.cpp index 65634e7e5..1447a4dd2 100644 --- a/test/demo-giantdata/unfold_transform_fold.cpp +++ b/test/demo-giantdata/unfold_transform_fold.cpp @@ -72,7 +72,7 @@ TEST_CASE("Unfold-transform-fold pipeline", "[concurrency][unfold][fold]") concurrency::unlimited, "APA") .input_family(product_query{.creator = "input", .layer = "spill", .suffix = "wgen"}) - .output_products("waves_in_apa"); + .output_product_suffixes("waves_in_apa"); // Add the transform node to the graph auto wrapped_user_function = [](handle hwf) { @@ -82,7 +82,7 @@ TEST_CASE("Unfold-transform-fold pipeline", "[concurrency][unfold][fold]") g.transform("clamp_node", wrapped_user_function, concurrency::unlimited) .input_family( product_query{.creator = "WaveformGenerator", .layer = "APA", .suffix = "waves_in_apa"}) - .output_products("clamped_waves"); + .output_product_suffixes("clamped_waves"); // Add the fold node with instrumentation to detect pipelined execution g.fold( @@ -99,7 +99,7 @@ TEST_CASE("Unfold-transform-fold pipeline", "[concurrency][unfold][fold]") concurrency::unlimited, "spill") .input_family(product_query{.creator = "clamp_node", .layer = "APA", .suffix = "clamped_waves"}) - .output_products("summed_waveforms"); + .output_product_suffixes("summed_waveforms"); // Execute the graph g.execute(); diff --git a/test/different_hierarchies.cpp b/test/different_hierarchies.cpp index 0fa78058b..12ceb6009 100644 --- a/test/different_hierarchies.cpp +++ b/test/different_hierarchies.cpp @@ -70,10 +70,10 @@ TEST_CASE("Different hierarchies used with fold", "[graph]") g.fold("run_add", add, concurrency::unlimited, "run", 0u) .input_family(product_query{.creator = "input", .layer = "event", .suffix = "number"}) - .output_products("run_sum"); + .output_product_suffixes("run_sum"); g.fold("job_add", add, concurrency::unlimited) .input_family(product_query{.creator = "input", .layer = "event", .suffix = "number"}) - .output_products("job_sum"); + .output_product_suffixes("job_sum"); g.observe("verify_run_sum", [](unsigned int actual) { CHECK(actual == 10u); }) .input_family(product_query{.creator = "run_add", .layer = "run", .suffix = "run_sum"}); diff --git a/test/filter.cpp b/test/filter.cpp index 1950f88c7..36bfb9676 100644 --- a/test/filter.cpp +++ b/test/filter.cpp @@ -21,7 +21,7 @@ namespace { driver.yield(job_index); for (unsigned int i : std::views::iota(1u, max_ + 1)) { - auto index = job_index->make_child(i, "event"); + auto index = job_index->make_child("event", i); driver.yield(index); } } diff --git a/test/fold.cpp b/test/fold.cpp index d66ac21da..d9bc03012 100644 --- a/test/fold.cpp +++ b/test/fold.cpp @@ -57,14 +57,14 @@ TEST_CASE("Different data layers of fold", "[graph]") g.fold("run_add", add, concurrency::unlimited, "run") .input_family(product_query{.creator = "input", .layer = "event", .suffix = "number"}) - .output_products("run_sum"); + .output_product_suffixes("run_sum"); g.fold("job_add", add, concurrency::unlimited) .input_family(product_query{.creator = "input", .layer = "event", .suffix = "number"}) - .output_products("job_sum"); + .output_product_suffixes("job_sum"); g.fold("two_layer_job_add", add, concurrency::unlimited) .input_family(product_query{.creator = "run_add", .layer = "run", .suffix = "run_sum"}) - .output_products("two_layer_job_sum"); + .output_product_suffixes("two_layer_job_sum"); g.observe("verify_run_sum", [](unsigned int actual) { CHECK(actual == 10u); }) .input_family(product_query{.creator = "run_add", .layer = "run", .suffix = "run_sum"}); diff --git a/test/function_registration.cpp b/test/function_registration.cpp index 36aa4e9d9..93f038bdc 100644 --- a/test/function_registration.cpp +++ b/test/function_registration.cpp @@ -54,11 +54,11 @@ namespace { TEST_CASE("Call non-framework functions", "[programming model]") { - std::array const product_names{ + std::array const input_products{ product_query{.creator = "input", .layer = "job", .suffix = "number"}, product_query{.creator = "input", .layer = "job", .suffix = "temperature"}, product_query{.creator = "input", .layer = "job", .suffix = "name"}}; - std::array const oproduct_names = {"onumber"s, "otemperature"s, "oname"s}; + std::array const product_suffixes = {"onumber"s, "otemperature"s, "oname"s}; std::array const result{"result"s}; experimental::framework_graph g{data_cell_index::base_ptr()}; @@ -74,36 +74,36 @@ TEST_CASE("Call non-framework functions", "[programming model]") SECTION("No framework") { g.transform("no_framework", no_framework) - .input_family(product_names) - .output_products(oproduct_names); + .input_family(input_products) + .output_product_suffixes(product_suffixes); } SECTION("No framework, all references") { g.transform("no_framework_all_refs", no_framework_all_refs) - .input_family(product_names) - .output_products(oproduct_names); + .input_family(input_products) + .output_product_suffixes(product_suffixes); } SECTION("No framework, all pointers") { g.transform("no_framework_all_ptrs", no_framework_all_ptrs) - .input_family(product_names) - .output_products(oproduct_names); + .input_family(input_products) + .output_product_suffixes(product_suffixes); } SECTION("One framework argument") { g.transform("one_framework_arg", one_framework_arg) - .input_family(product_names) - .output_products(oproduct_names); + .input_family(input_products) + .output_product_suffixes(product_suffixes); } SECTION("All framework arguments") { g.transform("all_framework_args", all_framework_args) - .input_family(product_names) - .output_products(oproduct_names); + .input_family(input_products) + .output_product_suffixes(product_suffixes); } // The following is invoked for *each* section above - g.observe("verify_results", verify_results).input_family(product_names); + g.observe("verify_results", verify_results).input_family(input_products); g.execute(); } diff --git a/test/hierarchical_nodes.cpp b/test/hierarchical_nodes.cpp index fb8a72846..70f871479 100644 --- a/test/hierarchical_nodes.cpp +++ b/test/hierarchical_nodes.cpp @@ -102,19 +102,19 @@ TEST_CASE("Hierarchical nodes", "[graph]") g.transform("get_the_time", strtime, concurrency::unlimited) .input_family(product_query{.creator = "input", .layer = "run", .suffix = "time"}) .experimental_when() - .output_products("strtime"); + .output_product_suffixes("strtime"); g.transform("square", square, concurrency::unlimited) .input_family(product_query{.creator = "input", .layer = "event", .suffix = "number"}) - .output_products("squared_number"); + .output_product_suffixes("squared_number"); g.fold("add", add, concurrency::unlimited, "run", 15u) .input_family(product_query{.creator = "square", .layer = "event", .suffix = "squared_number"}) .experimental_when() - .output_products("added_data"); + .output_product_suffixes("added_data"); g.transform("scale", scale, concurrency::unlimited) .input_family(product_query{.creator = "add", .layer = "run", .suffix = "added_data"}) - .output_products("result"); + .output_product_suffixes("result"); g.observe("print_result", print_result, concurrency::unlimited) .input_family(product_query{.creator = "scale", .layer = "run", .suffix = "result"}, product_query{.creator = "get_the_time", .layer = "run", .suffix = "strtime"}); @@ -123,11 +123,7 @@ TEST_CASE("Hierarchical nodes", "[graph]") .output("save", &experimental::test::products_for_output::save) .experimental_when(); - try { - g.execute(); - } catch (std::exception const& e) { - spdlog::error(e.what()); - } + g.execute(); CHECK(g.execution_count("square") == index_limit * number_limit); CHECK(g.execution_count("add") == index_limit * number_limit); diff --git a/test/memory-checks/many_events.cpp b/test/memory-checks/many_events.cpp index 26315e95c..6831575ed 100644 --- a/test/memory-checks/many_events.cpp +++ b/test/memory-checks/many_events.cpp @@ -22,6 +22,6 @@ int main() .output_product(product_query{.creator = "input", .layer = "event", .suffix = "number"}); g.transform("pass_on", pass_on, concurrency::unlimited) .input_family(product_query{.creator = "input", .layer = "event", .suffix = "number"}) - .output_products("different"); + .output_product_suffixes("different"); g.execute(); } diff --git a/test/mock-workflow/algorithm.hpp b/test/mock-workflow/algorithm.hpp index 1318eddbf..fc12ad507 100644 --- a/test/mock-workflow/algorithm.hpp +++ b/test/mock-workflow/algorithm.hpp @@ -75,7 +75,7 @@ namespace phlex::experimental::test { c.get("duration_usec")) .transform("execute", &algorithm_t::execute, j) .input_family(c.get("inputs")) - .output_products(c.get("outputs")); + .output_product_suffixes(c.get("outputs")); } } diff --git a/test/multiple_function_registration.cpp b/test/multiple_function_registration.cpp index b356b88cb..a2e2de2bb 100644 --- a/test/multiple_function_registration.cpp +++ b/test/multiple_function_registration.cpp @@ -53,35 +53,35 @@ TEST_CASE("Call multiple functions", "[programming model]") { g.transform("square_numbers", square_numbers, concurrency::unlimited) .input_family(product_query{.creator = "input", .layer = "job", .suffix = "numbers"}) - .output_products("squared_numbers"); + .output_product_suffixes("squared_numbers"); g.transform("sum_numbers", sum_numbers, concurrency::unlimited) .input_family( product_query{.creator = "square_numbers", .layer = "job", .suffix = "squared_numbers"}) - .output_products("summed_numbers"); + .output_product_suffixes("summed_numbers"); g.transform("sqrt_sum", sqrt_sum_numbers, concurrency::unlimited) .input_family( product_query{.creator = "sum_numbers", .layer = "job", .suffix = "summed_numbers"}, product_query{.creator = "input", .layer = "job", .suffix = "offset"}) - .output_products("result"); + .output_product_suffixes("result"); } SECTION("Transforms, one from a class") { g.transform("square_numbers", square_numbers, concurrency::unlimited) .input_family(product_query{.creator = "input", .layer = "job", .suffix = "numbers"}) - .output_products("squared_numbers"); + .output_product_suffixes("squared_numbers"); g.transform("sum_numbers", sum_numbers, concurrency::unlimited) .input_family( product_query{.creator = "square_numbers", .layer = "job", .suffix = "squared_numbers"}) - .output_products("summed_numbers"); + .output_product_suffixes("summed_numbers"); g.make() .transform("sqrt_sum", &A::sqrt_sum, concurrency::unlimited) .input_family( product_query{.creator = "sum_numbers", .layer = "job", .suffix = "summed_numbers"}, product_query{.creator = "input", .layer = "job", .suffix = "offset"}) - .output_products("result"); + .output_product_suffixes("result"); } // The following is invoked for *each* section above diff --git a/test/output_products.cpp b/test/output_products.cpp index 517f5a321..40c301081 100644 --- a/test/output_products.cpp +++ b/test/output_products.cpp @@ -51,7 +51,7 @@ TEST_CASE("Output data products", "[graph]") concurrency::unlimited) .input_family( product_query{.creator = "input", .layer = "spill", .suffix = "number_from_provider"}) - .output_products("squared_number"); + .output_product_suffixes("squared_number"); std::set products_from_nodes; g.make(products_from_nodes) diff --git a/test/plugins/module.cpp b/test/plugins/module.cpp index a1e4383d0..b4dee4f99 100644 --- a/test/plugins/module.cpp +++ b/test/plugins/module.cpp @@ -10,7 +10,7 @@ PHLEX_REGISTER_ALGORITHMS(m) m.transform("add", test::add, concurrency::unlimited) .input_family(product_query{.creator = "input", .layer = "event", .suffix = "i"}, product_query{.creator = "input", .layer = "event", .suffix = "j"}) - .output_products("sum"); + .output_product_suffixes("sum"); m.observe( "verify", [](int actual) { assert(actual == 0); }, concurrency::unlimited) .input_family(product_query{.creator = "add", .layer = "event", .suffix = "sum"}); diff --git a/test/product_handle.cpp b/test/product_handle.cpp index 4e7e4dca6..11224a3a7 100644 --- a/test/product_handle.cpp +++ b/test/product_handle.cpp @@ -54,7 +54,7 @@ TEST_CASE("Handle copies and moves", "[data model]") spec_t four_spec{"four"}; auto job_data_cell = data_cell_index::base_ptr(); - auto subrun_6_data_cell = job_data_cell->make_child(6, "subrun"); + auto subrun_6_data_cell = job_data_cell->make_child("subrun", 6); handle h2{two, *job_data_cell, two_spec}; handle h4{four, *subrun_6_data_cell, four_spec}; @@ -87,7 +87,7 @@ TEST_CASE("Handle comparisons", "[data model]") CHECK(h17 == h17); CHECK(h17 != h18); - auto subrun_6_data_cell = data_cell_index::base_ptr()->make_child(6, "subrun"); + auto subrun_6_data_cell = data_cell_index::base_ptr()->make_child("subrun", 6); handle const h17sr{seventeen, *subrun_6_data_cell, seventeen_spec}; CHECK(*h17 == *h17sr); // Products are the same CHECK(h17.data_cell_index() != h17sr.data_cell_index()); // Data cells are not the same diff --git a/test/product_querying.cpp b/test/product_querying.cpp index ae40a3c72..9ad20ade5 100644 --- a/test/product_querying.cpp +++ b/test/product_querying.cpp @@ -48,13 +48,13 @@ TEST_CASE("Querying products in different ways", "[graph]") // Duplicate with transform g.transform("duplicate_temperature", [](double const& t) { return t; }) .input_family(product_query{.creator = "input", .layer = "event", .suffix = "temperature"}) - .output_products("temperature"); + .output_product_suffixes("temperature"); SECTION("All fields") { g.transform("all_fields", [](int const& i) { return i + 1; }) .input_family(product_query{.creator = "input", .layer = "job", .suffix = "number"}) - .output_products("job_number"); + .output_product_suffixes("job_number"); g.execute(); CHECK(g.execution_count("all_fields") == 1); } @@ -63,7 +63,7 @@ TEST_CASE("Querying products in different ways", "[graph]") { g.transform("creator_and_layer_by_creator", [](std::string const& str) { return str; }) .input_family(product_query{.creator = "give_name", .layer = "event"}) - .output_products("event_name"); + .output_product_suffixes("event_name"); g.observe( "verify_name", [](std::string const& str, int const& n) { CHECK(str == fmt::format("John the {}th", n)); }) @@ -77,7 +77,7 @@ TEST_CASE("Querying products in different ways", "[graph]") { g.transform("creator_and_layer_by_layer", [](double const& d) { return d; }) .input_family(product_query{.creator = "input", .layer = "event"}) - .output_products("event_temp"); + .output_product_suffixes("event_temp"); g.execute(); CHECK(g.execution_count("creator_and_layer_by_layer") == num_events); } @@ -86,7 +86,7 @@ TEST_CASE("Querying products in different ways", "[graph]") { g.transform("creator_and_layer_after_transform", [](double const& d) { return d; }) .input_family(product_query{.creator = "duplicate_temperature", .layer = "event"}) - .output_products("event_temp"); + .output_product_suffixes("event_temp"); g.execute(); CHECK(g.execution_count("creator_and_layer_after_transform") == num_events); } diff --git a/test/product_store.cpp b/test/product_store.cpp index 0ad77c904..e6917da8e 100644 --- a/test/product_store.cpp +++ b/test/product_store.cpp @@ -48,7 +48,7 @@ TEST_CASE("Product store derivation", "[data model]") } auto root = product_store::base(); - auto trunk = std::make_shared(root->index()->make_child(1, "trunk")); + auto trunk = std::make_shared(root->index()->make_child("trunk", 1)); SECTION("Compare different generations") { CHECK(trunk == more_derived(root, trunk)); @@ -56,15 +56,15 @@ TEST_CASE("Product store derivation", "[data model]") } SECTION("Compare siblings (right is always favored)") { - auto bole = std::make_shared(root->index()->make_child(2, "bole")); + auto bole = std::make_shared(root->index()->make_child("bole", 2)); CHECK(bole == more_derived(trunk, bole)); CHECK(trunk == more_derived(bole, trunk)); } - auto limb = std::make_shared(trunk->index()->make_child(2, "limb")); - auto branch = std::make_shared(limb->index()->make_child(3, "branch")); - auto twig = std::make_shared(branch->index()->make_child(4, "twig")); - auto leaf = std::make_shared(twig->index()->make_child(5, "leaf")); + auto limb = std::make_shared(trunk->index()->make_child("limb", 2)); + auto branch = std::make_shared(limb->index()->make_child("branch", 3)); + auto twig = std::make_shared(branch->index()->make_child("twig", 4)); + auto leaf = std::make_shared(twig->index()->make_child("leaf", 5)); auto order_a = std::make_tuple(root, trunk, limb, branch, twig, leaf); auto order_b = std::make_tuple(leaf, twig, branch, limb, trunk, root); diff --git a/test/provider_test.cpp b/test/provider_test.cpp index cdd02a0e8..fd02eeb75 100644 --- a/test/provider_test.cpp +++ b/test/provider_test.cpp @@ -44,7 +44,7 @@ TEST_CASE("provider_test") g.transform("passer", pass_on, concurrency::unlimited) .input_family(product_query{.creator = "input", .layer = "spill", .suffix = "happy_vertices"}) - .output_products("vertex_data"); + .output_product_suffixes("vertex_data"); g.execute(); CHECK(g.execution_count("passer") == max_events); diff --git a/test/python/adder.py b/test/python/adder.py index 9508636db..95920696e 100644 --- a/test/python/adder.py +++ b/test/python/adder.py @@ -55,4 +55,4 @@ def PHLEX_REGISTER_ALGORITHMS(m, config): None """ int_adder = Variant(add, {"i": int, "j": int, "return": int}, "iadd") - m.transform(int_adder, input_family=config["input"], output_products=config["output"]) + m.transform(int_adder, input_family=config["input"], output_product_suffixes=config["output"]) diff --git a/test/python/reducer.py b/test/python/reducer.py index 75b283e6d..b0353a211 100644 --- a/test/python/reducer.py +++ b/test/python/reducer.py @@ -66,7 +66,10 @@ def PHLEX_REGISTER_ALGORITHMS(m, config): # first receive the same input x4 but return "different" output for i in range(4): m.transform( - add, name="reduce%d" % i, input_family=config["input"], output_products=["sum%d" % i] + add, + name="reduce%d" % i, + input_family=config["input"], + output_product_suffixes=["sum%d" % i], ) # now reduce them pair-wise @@ -74,17 +77,23 @@ def PHLEX_REGISTER_ALGORITHMS(m, config): {"creator": "reduce0", "layer": "event", "suffix": "sum0"}, {"creator": "reduce1", "layer": "event", "suffix": "sum1"}, ] - m.transform(add_sum01, name="reduce01", input_family=input_family01, output_products=["sum01"]) + m.transform( + add_sum01, name="reduce01", input_family=input_family01, output_product_suffixes=["sum01"] + ) input_family01 = [ {"creator": "reduce2", "layer": "event", "suffix": "sum2"}, {"creator": "reduce3", "layer": "event", "suffix": "sum3"}, ] - m.transform(add_sum23, name="reduce23", input_family=input_family01, output_products=["sum23"]) + m.transform( + add_sum23, name="reduce23", input_family=input_family01, output_product_suffixes=["sum23"] + ) # once more (and the configuration will add a verifier) input_family_final = [ {"creator": "reduce01", "layer": "event", "suffix": "sum01"}, {"creator": "reduce23", "layer": "event", "suffix": "sum23"}, ] - m.transform(add_final, name="reduce", input_family=input_family_final, output_products=["sum"]) + m.transform( + add_final, name="reduce", input_family=input_family_final, output_product_suffixes=["sum"] + ) diff --git a/test/python/suffix.py b/test/python/suffix.py index 0cae6a317..6ff15a75d 100644 --- a/test/python/suffix.py +++ b/test/python/suffix.py @@ -72,7 +72,9 @@ def PHLEX_REGISTER_ALGORITHMS(m, config): {"creator": "input", "suffix": "i"}, ): try: - m.transform(constant_one, input_family=[input_query], output_products=["output_one"]) + m.transform( + constant_one, input_family=[input_query], output_product_suffixes=["output_one"] + ) assert not "supposed to be here" except TypeError as e: # test for the one generic part in all these errors @@ -84,21 +86,21 @@ def PHLEX_REGISTER_ALGORITHMS(m, config): input_family=[ {"creator": "input", "layer": "event", "suffix": "i"}, ], - output_products=["output_one"], + output_product_suffixes=["output_one"], ) m.transform( constant_two, input_family=[ {"creator": "input", "layer": "event", "suffix": "i"}, ], - output_products=["output_two"], + output_product_suffixes=["output_two"], ) m.transform( constant_three, input_family=[ {"creator": "input", "layer": "event", "suffix": "i"}, ], - output_products=["output_three"], + output_product_suffixes=["output_three"], ) # observers without suffix diff --git a/test/python/sumit.py b/test/python/sumit.py index ae43e5ffc..4cf33c66f 100644 --- a/test/python/sumit.py +++ b/test/python/sumit.py @@ -62,9 +62,9 @@ def PHLEX_REGISTER_ALGORITHMS(m, config): Returns: None """ - m.transform(collectify, input_family=config["input"], output_products=["my_pyarray"]) + m.transform(collectify, input_family=config["input"], output_product_suffixes=["my_pyarray"]) m.transform( sum_array, input_family=[{"creator": "collectify", "layer": "event", "suffix": "my_pyarray"}], - output_products=config["output"], + output_product_suffixes=config["output"], ) diff --git a/test/python/test_callbacks.py b/test/python/test_callbacks.py index b9e92c5c5..6d485a998 100644 --- a/test/python/test_callbacks.py +++ b/test/python/test_callbacks.py @@ -45,14 +45,26 @@ def PHLEX_REGISTER_ALGORITHMS(m, config): mode = "three_args" if mode == "three_args": - m.transform(sum_three, input_family=config["input"], output_products=config["output"]) + m.transform( + sum_three, input_family=config["input"], output_product_suffixes=config["output"] + ) elif mode == "exception": - m.transform(raise_error, input_family=config["input"], output_products=config["output"]) + m.transform( + raise_error, input_family=config["input"], output_product_suffixes=config["output"] + ) elif mode == "bad_bool": - m.transform(bad_bool, input_family=config["input"], output_products=config["output"]) + m.transform( + bad_bool, input_family=config["input"], output_product_suffixes=config["output"] + ) elif mode == "bad_long": - m.transform(bad_long, input_family=config["input"], output_products=config["output"]) + m.transform( + bad_long, input_family=config["input"], output_product_suffixes=config["output"] + ) elif mode == "bad_uint": - m.transform(bad_uint, input_family=config["input"], output_products=config["output"]) + m.transform( + bad_uint, input_family=config["input"], output_product_suffixes=config["output"] + ) elif mode == "mismatch": - m.transform(two_args, input_family=config["input"], output_products=config["output"]) + m.transform( + two_args, input_family=config["input"], output_product_suffixes=config["output"] + ) diff --git a/test/python/test_coverage.py b/test/python/test_coverage.py index 52c844d89..5f02e9377 100644 --- a/test/python/test_coverage.py +++ b/test/python/test_coverage.py @@ -53,4 +53,4 @@ def PHLEX_REGISTER_ALGORITHMS(m, config): for func, creator, suffix, output in tfs: input_family = [{"creator": creator, "layer": "event", "suffix": suffix}] - m.transform(func, input_family=input_family, output_products=[output]) + m.transform(func, input_family=input_family, output_product_suffixes=[output]) diff --git a/test/python/test_mismatch.py b/test/python/test_mismatch.py index 55eca0e7c..01f824f99 100644 --- a/test/python/test_mismatch.py +++ b/test/python/test_mismatch.py @@ -13,5 +13,5 @@ def PHLEX_REGISTER_ALGORITHMS(m, config): m.transform( mismatch_func, input_family=[{"creator": "input", "layer": "event", "suffix": "a"}], - output_products=["sum"], + output_product_suffixes=["sum"], ) diff --git a/test/python/test_types.py b/test/python/test_types.py index d2189a709..c87ad5aff 100644 --- a/test/python/test_types.py +++ b/test/python/test_types.py @@ -103,25 +103,35 @@ def PHLEX_REGISTER_ALGORITHMS(m, config): None """ m.transform( - add_float, input_family=config["input_float"], output_products=config["output_float"] + add_float, + input_family=config["input_float"], + output_product_suffixes=config["output_float"], ) m.transform( - add_double, input_family=config["input_double"], output_products=config["output_double"] + add_double, + input_family=config["input_double"], + output_product_suffixes=config["output_double"], ) m.transform( - add_unsigned, input_family=config["input_uint"], output_products=config["output_uint"] + add_unsigned, + input_family=config["input_uint"], + output_product_suffixes=config["output_uint"], ) - m.transform(and_bool, input_family=config["input_bool"], output_products=config["output_bool"]) + m.transform( + and_bool, input_family=config["input_bool"], output_product_suffixes=config["output_bool"] + ) m.transform( - collect_float, input_family=config["input_float"], output_products=config["output_vfloat"] + collect_float, + input_family=config["input_float"], + output_product_suffixes=config["output_vfloat"], ) m.transform( collect_double, input_family=config["input_double"], - output_products=config["output_vdouble"], + output_product_suffixes=config["output_vdouble"], ) diff --git a/test/python/vectypes.py b/test/python/vectypes.py index 18fa0369f..62865faa2 100644 --- a/test/python/vectypes.py +++ b/test/python/vectypes.py @@ -218,7 +218,7 @@ def PHLEX_REGISTER_ALGORITHMS(m, config): m.transform( list_collect if use_lists else arr_collect, input_family=config[in_key], - output_products=[arr_name], + output_product_suffixes=[arr_name], ) sum_kwargs = { @@ -229,7 +229,7 @@ def PHLEX_REGISTER_ALGORITHMS(m, config): "suffix": arr_name, } ], - "output_products": config[out_key], + "output_product_suffixes": config[out_key], } if sum_name: sum_kwargs["name"] = sum_name diff --git a/test/repeater_node_test.cpp b/test/repeater_node_test.cpp index bfe01d6b9..86cfde321 100644 --- a/test/repeater_node_test.cpp +++ b/test/repeater_node_test.cpp @@ -20,7 +20,7 @@ using namespace phlex::experimental; namespace { auto make_run_index(int run_number) { - return phlex::data_cell_index::base_ptr()->make_child(run_number, "run"); + return phlex::data_cell_index::base_ptr()->make_child("run", run_number); } auto make_run_with_product(int run_number, int value) diff --git a/test/type_distinction.cpp b/test/type_distinction.cpp index 7eece0ba8..c5bf4999a 100644 --- a/test/type_distinction.cpp +++ b/test/type_distinction.cpp @@ -48,7 +48,7 @@ TEST_CASE("Distinguish products with same name and different types", "[programmi auto job_index = data_cell_index::base_ptr(); driver.yield(job_index); for (int i : numbers) { - auto event_index = job_index->make_child(unsigned(i), "event"); + auto event_index = job_index->make_child("event", unsigned(i)); driver.yield(event_index); } }; @@ -67,36 +67,36 @@ TEST_CASE("Distinguish products with same name and different types", "[programmi .input_family(product_query{.creator = "input", .layer = "event", .suffix = "numbers"}); g.transform("triple_numbers", triple, concurrency::unlimited) .input_family(product_query{.creator = "input", .layer = "event", .suffix = "numbers"}) - .output_products("tripled"); + .output_product_suffixes("tripled"); spdlog::info("Registered tripled"); g.transform("expand_orig", expand, concurrency::unlimited) .input_family(product_query{.creator = "input", .layer = "event", .suffix = "numbers"}, product_query{.creator = "input", .layer = "event", .suffix = "length"}) - .output_products("expanded_one"); + .output_product_suffixes("expanded_one"); spdlog::info("Registered expanded_one"); g.transform("expand_triples", expand, concurrency::unlimited) .input_family( product_query{.creator = "triple_numbers", .layer = "event", .suffix = "tripled"}, product_query{.creator = "input", .layer = "event", .suffix = "length"}) - .output_products("expanded_three"); + .output_product_suffixes("expanded_three"); spdlog::info("Registered expanded_three"); g.transform("add_nums", add_numbers, concurrency::unlimited) .input_family( product_query{.creator = "input", .layer = "event", .suffix = "numbers"}, product_query{.creator = "triple_numbers", .layer = "event", .suffix = "tripled"}) - .output_products("sums"); + .output_product_suffixes("sums"); spdlog::info("Registered sums"); g.transform("add_vect", add_vectors, concurrency::unlimited) .input_family( product_query{.creator = "expand_orig", .layer = "event", .suffix = "expanded_one"}, product_query{.creator = "expand_triples", .layer = "event", .suffix = "expanded_three"}) - .output_products("sums"); + .output_product_suffixes("sums"); g.transform("extract_result", triple, concurrency::unlimited) .input_family(product_query{.creator = "add_nums", .layer = "event", .suffix = "sums"}) - .output_products("result"); + .output_product_suffixes("result"); spdlog::info("Registered result"); } @@ -104,11 +104,11 @@ TEST_CASE("Distinguish products with same name and different types", "[programmi { g.transform("square", square, concurrency::unlimited) .input_family(product_query{.creator = "input", .layer = "event", .suffix = "numbers"}) - .output_products("square_result", "square_result"); + .output_product_suffixes("square_result", "square_result"); g.transform("extract_result", id, concurrency::unlimited) .input_family(product_query{.creator = "square", .layer = "event", .suffix = "square_result"}) - .output_products("result"); + .output_product_suffixes("result"); } g.observe("print_result", [](int res) { spdlog::info("Result: {}", res); }) diff --git a/test/unfold.cpp b/test/unfold.cpp index bccbdbf10..dfbd7bd5b 100644 --- a/test/unfold.cpp +++ b/test/unfold.cpp @@ -103,10 +103,10 @@ TEST_CASE("Splitting the processing", "[graph]") g.unfold("iota", &iota::predicate, &iota::unfold, concurrency::unlimited, "lower1") .input_family(product_query{.creator = "input", .layer = "event", .suffix = "max_number"}) - .output_products("new_number"); + .output_product_suffixes("new_number"); g.fold("add", add, concurrency::unlimited, "event") .input_family(product_query{.creator = "iota", .layer = "lower1", .suffix = "new_number"}) - .output_products("sum1"); + .output_product_suffixes("sum1"); g.observe("check_sum", check_sum, concurrency::unlimited) .input_family(product_query{.creator = "add", .layer = "event", .suffix = "sum1"}); @@ -116,11 +116,11 @@ TEST_CASE("Splitting the processing", "[graph]") concurrency::unlimited, "lower2") .input_family(product_query{.creator = "input", .layer = "event", .suffix = "ten_numbers"}) - .output_products("each_number"); + .output_product_suffixes("each_number"); g.fold("add_numbers", add_numbers, concurrency::unlimited, "event") .input_family( product_query{.creator = "iterate_through", .layer = "lower2", .suffix = "each_number"}) - .output_products("sum2"); + .output_product_suffixes("sum2"); g.observe("check_sum_same", check_sum_same, concurrency::unlimited) .input_family(product_query{.creator = "add_numbers", .layer = "event", .suffix = "sum2"}); diff --git a/test/vector_of_abstract_types.cpp b/test/vector_of_abstract_types.cpp index 929cb1b80..21cac6aa8 100644 --- a/test/vector_of_abstract_types.cpp +++ b/test/vector_of_abstract_types.cpp @@ -47,7 +47,7 @@ TEST_CASE("Test vector of abstract types") .output_product(product_query{.creator = "dummy", .layer = "event", .suffix = "thing"}); g.transform("read_thing", read_abstract) .input_family(product_query{.creator = "dummy", .layer = "event", .suffix = "thing"}) - .output_products("sum"); + .output_product_suffixes("sum"); g.observe( "verify_sum", [](int sum) { CHECK(sum == 3); }, concurrency::serial) .input_family(product_query{.creator = "read_thing", .layer = "event", .suffix = "sum"}); diff --git a/test/yielding_driver.cpp b/test/yielding_driver.cpp index 6d3a30866..a88d32c73 100644 --- a/test/yielding_driver.cpp +++ b/test/yielding_driver.cpp @@ -19,13 +19,13 @@ void cells_to_process(experimental::async_driver& d) auto job_id = data_cell_index::base_ptr(); d.yield(job_id); for (unsigned int r : std::views::iota(0u, num_runs)) { - auto run_id = job_id->make_child(r, "run"); + auto run_id = job_id->make_child("run", r); d.yield(run_id); for (unsigned int sr : std::views::iota(0u, num_subruns)) { - auto subrun_id = run_id->make_child(sr, "subrun"); + auto subrun_id = run_id->make_child("subrun", sr); d.yield(subrun_id); for (unsigned int spill : std::views::iota(0u, num_spills)) { - d.yield(subrun_id->make_child(spill, "spill")); + d.yield(subrun_id->make_child("spill", spill)); } } }