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

649 Clean up use of addAction, especially around LB #953

Merged
merged 9 commits into from
Jul 29, 2020
1 change: 1 addition & 0 deletions src/vt/collective/barrier/barrier.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include "vt/collective/barrier/barrier.h"
#include "vt/collective/collective_alg.h"
#include "vt/messaging/active.h"
#include "vt/scheduler/scheduler.h"

namespace vt { namespace collective { namespace barrier {

Expand Down
1 change: 1 addition & 0 deletions src/vt/collective/collective_alg.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
*/

#include "vt/collective/collective_alg.h"
#include "vt/scheduler/scheduler.h"

#include <cstdint>

Expand Down
1 change: 1 addition & 0 deletions src/vt/collective/collective_scope.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#include "vt/collective/collective_scope.h"
#include "vt/collective/collective_alg.h"
#include "vt/pipe/pipe_manager.h"
#include "vt/scheduler/scheduler.h"

namespace vt { namespace collective {

Expand Down
1 change: 1 addition & 0 deletions src/vt/group/global/group_default.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#include "vt/messaging/message.h"
#include "vt/messaging/message/smart_ptr.h"
#include "vt/collective/tree/tree.h"
#include "vt/scheduler/scheduler.h"

#include <memory>
#include <cassert>
Expand Down
1 change: 1 addition & 0 deletions src/vt/messaging/active.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#include "vt/scheduler/priority.h"
#include "vt/utils/mpi_limits/mpi_max_tag.h"
#include "vt/runtime/mpi_access.h"
#include "vt/scheduler/scheduler.h"

namespace vt { namespace messaging {

Expand Down
1 change: 1 addition & 0 deletions src/vt/sequence/sequencer.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#include "vt/config.h"
#include "vt/sequence/seq_common.h"
#include "vt/sequence/sequencer_headers.h"
#include "vt/scheduler/scheduler.h"

namespace vt { namespace seq {

Expand Down
1 change: 1 addition & 0 deletions src/vt/termination/dijkstra-scholten/comm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#include "vt/termination/dijkstra-scholten/ds.h"
#include "vt/messaging/active.h"
#include "vt/context/context.h"
#include "vt/scheduler/scheduler.h"

namespace vt { namespace term { namespace ds {

Expand Down
119 changes: 0 additions & 119 deletions src/vt/termination/term_scope.cc

This file was deleted.

74 changes: 0 additions & 74 deletions src/vt/termination/term_scope.impl.h

This file was deleted.

65 changes: 0 additions & 65 deletions src/vt/termination/termination.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,70 +204,6 @@ struct TerminationDetector :
*/
void freeEpoch(EpochType const& epoch);

public:
/**
* \struct Scoped
*
* \brief Interface for scoped epochs using C++ lexical scopes to encapsulate
* epoch regimes
*/
struct Scoped {
/**
* \brief Run closure in rooted epoch to detect termination of all its work
*
* \param[in] use_ds whether to use DS algorithm or not
* \param[in] closure The action to generate the initial work, from which
* all transitively generated work will be part of the return epoch
*
* \return the epoch created for it
*/
static EpochType rooted(bool use_ds, ActionType closure);

/**
* \brief Run closure in rooted epoch to detect termination of all its work
*
* \param[in] use_ds whether to use DS algorithm or not
* \param[in] closure The action to generate the initial work, from which
* all transitively generated work will be part of the return epoch
* \param[in] action action to execute after closure terminates
*
* \return the epoch created for it
*/
static EpochType rooted(bool use_ds, ActionType closure, ActionType action);

/**
* \brief Collectively run closure in collective epoch to detect termination
* of all its work
*
* \param[in] closure The action to generate the initial work, from which
* all transitively generated work will be part of the return epoch
*
* \return the epoch created for it
*/
static EpochType collective(ActionType closure);

/**
* \brief Collectively run closure in collective epoch to detect termination
* of all its work
*
* \param[in] closure The action to generate the initial work, from which
* all transitively generated work will be part of the return epoch
* \param[in] action action to execute after closure terminates
*
* \return the epoch created for it
*/
static EpochType collective(ActionType closure, ActionType action);

/**
* \brief Run a rooted sequence of actions with termination in-between them
*
* \param[in] use_ds whether to use DS
* \param[in] closures pack of closures to sequence
*/
template <typename... Actions>
static void rootedSeq(bool use_ds, Actions... closures);
} scope;

public:
/*
* Interface for creating new epochs for termination detection
Expand Down Expand Up @@ -758,6 +694,5 @@ struct TerminationDetector :
}} // end namespace vt::term

#include "vt/termination/termination.impl.h"
#include "vt/termination/term_scope.impl.h"

#endif /*INCLUDED_TERMINATION_TERMINATION_H*/
6 changes: 2 additions & 4 deletions src/vt/vrt/collection/balance/baselb/baselb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,8 @@ void BaseLB::startLB(

importProcessorData(in_comm_stats);

term::TerminationDetector::Scoped::collective(
[this] { computeStatistics(); },
[this] { finishedStats(); }
);
runInEpochCollective([this] { computeStatistics(); });
runInEpochCollective([this] { finishedStats(); });
}

BaseLB::LoadType BaseLB::loadMilli(LoadType const& load) const {
Expand Down
Loading