Skip to content

Commit

Permalink
#1715 make label an optional argument for collection::constructMap()
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Strzebonski committed May 17, 2022
1 parent 45770a4 commit 386741b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
12 changes: 6 additions & 6 deletions src/vt/vrt/collection/manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,17 +173,17 @@ struct CollectionManager
* \brief Construct a new virtual context collection with an explicit,
* pre-registered map handler
*
* \param[in] label collection label
* \param[in] range index range for the collection
* \param[in] map pre-registered map handler
* \param[in] label collection label
*
* \return proxy to the new collection
*/
template <typename ColT>
CollectionProxyWrapType<ColT, typename ColT::IndexType>
constructMap(
std::string const& label, typename ColT::IndexType range,
HandlerType const map
typename ColT::IndexType range, HandlerType const map,
std::string const& label = {}
);

/**
Expand Down Expand Up @@ -314,17 +314,17 @@ struct CollectionManager
* will invoke that function for every index in the system based on the where
* each index is mapped with the registered map function.
*
* \param[in] label collection label
* \param[in] range index range for the collection
* \param[in] cons_fn construct function to create an element on each node
* \param[in] map_han the registered map function
* \param[in] label collection label
*
* \return proxy to new collection
*/
template <typename ColT>
CollectionProxyWrapType<ColT> constructCollectiveMap(
std::string const& label, typename ColT::IndexType range,
DistribConstructFn<ColT> cons_fn, HandlerType const map_han
typename ColT::IndexType range, DistribConstructFn<ColT> cons_fn,
HandlerType const map_hanm, std::string const& label = {}
);

/**
Expand Down
20 changes: 10 additions & 10 deletions src/vt/vrt/collection/manager.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1239,7 +1239,7 @@ CollectionManager::constructCollective(
) {
auto const map_han = getDefaultMap<ColT>();
auto cons_fn = [](typename ColT::IndexType) { return std::make_unique<ColT>(); };
return constructCollectiveMap<ColT>(label, range, cons_fn, map_han);
return constructCollectiveMap<ColT>(range, cons_fn, map_han, label);
}

template <typename ColT>
Expand All @@ -1249,7 +1249,7 @@ CollectionManager::constructCollective(
std::string const& label
) {
auto const map_han = getDefaultMap<ColT>();
return constructCollectiveMap<ColT>(label, range, cons_fn, map_han);
return constructCollectiveMap<ColT>(range, cons_fn, map_han, label);
}

template <
Expand All @@ -1262,7 +1262,7 @@ CollectionManager::constructCollective(
using IndexT = typename ColT::IndexType;
auto cons_fn = [](typename ColT::IndexType){return std::make_unique<ColT>();};
auto const& map_han = auto_registry::makeAutoHandlerMap<IndexT, fn>();
return constructCollectiveMap<ColT>(label, range, cons_fn, map_han);
return constructCollectiveMap<ColT>(range, cons_fn, map_han, label);
}

template <
Expand All @@ -1275,14 +1275,14 @@ CollectionManager::constructCollective(
) {
using IndexT = typename ColT::IndexType;
auto const& map_han = auto_registry::makeAutoHandlerMap<IndexT, fn>();
return constructCollectiveMap<ColT>(label, range, cons_fn, map_han);
return constructCollectiveMap<ColT>(range, cons_fn, map_han, label);
}

template <typename ColT>
CollectionManager::CollectionProxyWrapType<ColT>
CollectionManager::constructCollectiveMap(
std::string const& label, typename ColT::IndexType range,
DistribConstructFn<ColT> user_construct_fn, HandlerType const map_han
typename ColT::IndexType range, DistribConstructFn<ColT> user_construct_fn,
HandlerType const map_han, std::string const& label
) {
return vt::makeCollection<ColT>(label)
.bounds(range)
Expand Down Expand Up @@ -1389,7 +1389,7 @@ CollectionManager::construct(
typename ColT::IndexType range, std::string const& label
) {
auto const map_han = getDefaultMap<ColT>();
return constructMap<ColT>(label, range, map_han);
return constructMap<ColT>(range, map_han, label);
}

template <
Expand All @@ -1401,14 +1401,14 @@ CollectionManager::construct(
) {
using IndexT = typename ColT::IndexType;
auto const& map_han = auto_registry::makeAutoHandlerMap<IndexT, fn>();
return constructMap<ColT>(label, range, map_han);
return constructMap<ColT>(range, map_han, label);
}

template <typename ColT>
CollectionManager::CollectionProxyWrapType<ColT, typename ColT::IndexType>
CollectionManager::constructMap(
std::string const& label, typename ColT::IndexType range,
HandlerType const map_handler
typename ColT::IndexType range, HandlerType const map_handler,
std::string const& label
) {
return vt::makeCollection<ColT>(label)
.bounds(range)
Expand Down

0 comments on commit 386741b

Please sign in to comment.