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

#410: Dependent Epochs rewritten #2204

Open
wants to merge 20 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
ccd5afd
#410: epoch: change unused InsertEpoch to DependentEpoch
lifflander Jun 17, 2019
b393469
#410: epoch: add function to bit-combine epoch category bits
lifflander Jun 19, 2019
9a1efe8
#410: termination: add isDep check
lifflander Sep 28, 2023
72fbfec
#410: term: implement dependent epochs
lifflander Jun 20, 2019
5cd8599
#410: test: add release dependent epoch test
lifflander Jun 20, 2019
10147f4
#410: reduce: fix warning
lifflander Oct 12, 2023
1db25fa
#410: epoch: add test, move pending epochs to scheduler
lifflander Oct 12, 2023
a9816c6
#410: epoch: rework deps, objgroup dep epochs, scheduler buffers
lifflander Oct 16, 2023
4de8a74
#410: objgroup: implement objgroup proxy functions for dependent epochs
lifflander Oct 17, 2023
bfdc3f4
#410: collection: add dependent epochs to collections, system message…
lifflander Oct 18, 2023
3c1ac7f
#410: test: add new test for dep epochs and collections
lifflander Aug 16, 2019
cdf69ab
#410: collection: add missing header include
lifflander Oct 18, 2023
9764708
#410: tests: cleanup tests, fix name collison
lifflander Oct 18, 2023
a974aba
#410: tests: fix license
lifflander Oct 18, 2023
3e76af5
#410: tests: fix some small compilation errors
lifflander Oct 18, 2023
3d2b117
#410: collection: switch broadcast after system broadcast to user msg
lifflander Oct 18, 2023
f746269
#410: collection: fix missing system message designation
lifflander Oct 19, 2023
cb2b519
#410: tests: rewrite dep epoch test to fix logic error
lifflander Oct 19, 2023
4b3a9c6
#410: termination: remove unneeded code, cleanup scheduler
lifflander Oct 31, 2023
48f7a8c
#410: termination: cleanup more code---remove unecessary condition
lifflander Oct 31, 2023
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
7 changes: 7 additions & 0 deletions src/vt/objgroup/proxy/proxy_objgroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,13 @@ struct Proxy {
s | proxy_;
}

/**
* \brief Release a dependent epoch for all nodes
*
* \param[in] epoch the epoch to release
*/
void release(EpochType epoch) const;

private:
ObjGroupProxyType proxy_ = no_obj_group; /**< The raw proxy ID bits */
};
Expand Down
11 changes: 11 additions & 0 deletions src/vt/objgroup/proxy/proxy_objgroup.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,17 @@ void Proxy<ObjT>::destroyHandleSetRDMA(vt::rdma::HandleSet<T> set) const {
return vt::theHandleRDMA()->deleteHandleSetCollectiveObjGroup<T>(set);
}

template <typename ObjT>
inline void releaseRemoteObjGroupBcast(Proxy<ObjT> proxy, EpochType ep) {
auto const node = theContext()->getNode();
proxy[node].release(ep);
}

template <typename ObjT>
void Proxy<ObjT>::release(EpochType epoch) const {
theMsg()->broadcast<releaseRemoteObjGroupBcast<ObjT>>(*this, epoch);
}

inline DefaultProxyElm Proxy<void>::operator[](NodeType node) const {
return DefaultProxyElm{node};
}
Expand Down
16 changes: 16 additions & 0 deletions src/vt/objgroup/proxy/proxy_objgroup_elm.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,22 @@ struct ProxyElm {
*/
NodeType getNode() const { return node_; }

/**
* \brief Check if dependent epoch is released
*
* \param[in] epoch the epoch in question
*
* \return whether it is released
*/
bool isReleased(EpochType epoch) const;

/**
* \brief Release a dependent epoch for this element
*
* \param[in] epoch the epoch to release
*/
void release(EpochType epoch) const;

public:
/**
* \brief Serialize the element proxy
Expand Down
24 changes: 24 additions & 0 deletions src/vt/objgroup/proxy/proxy_objgroup_elm.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,30 @@ ObjT* ProxyElm<ObjT>::get() const {
return theObjGroup()->get<ObjT>(proxy);
}

template <typename ObjT>
bool ProxyElm<ObjT>::isReleased(EpochType epoch) const {
if (node_ == theContext()->getNode()) {
return theSched()->isReleasedEpochObjgroup(epoch, proxy_);
} else {
vtAbort("isReleased can only be called locally");
return false;
}
}

template <typename ObjT>
inline void releaseRemoteObjGroup(ProxyElm<ObjT> proxy, EpochType ep) {
proxy.release(ep);
}

template <typename ObjT>
void ProxyElm<ObjT>::release(EpochType epoch) const {
if (node_ == theContext()->getNode()) {
theSched()->releaseEpochObjgroup(epoch, proxy_);
} else {
theMsg()->send<releaseRemoteObjGroup<ObjT>>(vt::Node(node_), *this, epoch);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it going to be valid to release an epoch for a single node?

}
}

inline ProxyElm<void>::ProxyElm(NodeType in_node) : node_{in_node} {}

template <typename MsgT, ActiveTypedFnType<MsgT>* f, typename... Args>
Expand Down
9 changes: 9 additions & 0 deletions src/vt/scheduler/scheduler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,15 @@ void Scheduler::releaseEpochObjgroup(EpochType ep, ObjGroupProxyType proxy) {
}
}

bool Scheduler::isReleasedEpochObjgroup(
EpochType ep, ObjGroupProxyType proxy
) const {
if (auto it = released_objgroups_.find(ep); it != released_objgroups_.end()) {
return it->second.find(proxy) != it->second.end();
}
return false;
}

#if vt_check_enabled(fcontext)
ThreadManager* Scheduler::getThreadManager() {
return thread_manager_.get();
Expand Down
10 changes: 10 additions & 0 deletions src/vt/scheduler/scheduler.h
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,16 @@ struct Scheduler : runtime::component::Component<Scheduler> {
*/
void releaseEpochObjgroup(EpochType ep, ObjGroupProxyType proxy);

/**
* \brief Check if a epoch is released for an objgroup
*
* \param[in] ep the epoch to check
* \param[in] proxy the objgroup proxy
*
* \return whether it's released
*/
bool isReleasedEpochObjgroup(EpochType ep, ObjGroupProxyType proxy) const;

template <typename SerializerT>
void serialize(SerializerT& s) {
s | work_queue_
Expand Down