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

#1879: objgroup: fix breaking label change #1880

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 7 additions & 4 deletions src/vt/objgroup/manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,17 +157,20 @@ struct ObjGroupManager : runtime::component::Component<ObjGroupManager> {
* \brief Collectively construct a new object group from a raw pointer to the
* object.
*
* \warning This overload requires the caller to manage the lifetime of the
* object. Do not allow the object to be deallocated before the object group
* is destroyed.
* \note When \c obj is \c nullptr this overload constructs the objgroup with
* the default constructor.
*
* \warning This overload (when not \c nullptr ) requires the caller to manage
* the lifetime of the object. Do not allow the object to be deallocated
* before the object group is destroyed.
*
* \param[in] obj raw pointer to the object
* \param[in] label object group label
*
* \return proxy to the object group
*/
template <typename ObjT>
ProxyType<ObjT> makeCollective(ObjT* obj, std::string const& label = {});
ProxyType<ObjT> makeCollective(ObjT* obj = nullptr, std::string const& label = {});

/**
* \brief Collectively construct a new object group from a smart-pointer-like
Expand Down
4 changes: 3 additions & 1 deletion src/vt/objgroup/manager.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ ObjGroupManager::makeCollective(std::string const& label, Args&&... args) {
template <typename ObjT>
ObjGroupManager::ProxyType<ObjT>
ObjGroupManager::makeCollective(ObjT* obj, std::string const& label) {
vtAssert(obj != nullptr, "Must be a valid obj pointer");
if (obj == nullptr) {
return makeCollective<ObjT>("unlabeled");
}
auto holder_base = std::make_unique<holder::HolderBasic<ObjT>>(obj);
return makeCollectiveObj<ObjT>(label, obj, std::move(holder_base));
}
Expand Down