-
Notifications
You must be signed in to change notification settings - Fork 9
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
lifflander
wants to merge
20
commits into
develop
Choose a base branch
from
410-new-dep-epochs
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
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 b393469
#410: epoch: add function to bit-combine epoch category bits
lifflander 9a1efe8
#410: termination: add isDep check
lifflander 72fbfec
#410: term: implement dependent epochs
lifflander 5cd8599
#410: test: add release dependent epoch test
lifflander 10147f4
#410: reduce: fix warning
lifflander 1db25fa
#410: epoch: add test, move pending epochs to scheduler
lifflander a9816c6
#410: epoch: rework deps, objgroup dep epochs, scheduler buffers
lifflander 4de8a74
#410: objgroup: implement objgroup proxy functions for dependent epochs
lifflander bfdc3f4
#410: collection: add dependent epochs to collections, system message…
lifflander 3c1ac7f
#410: test: add new test for dep epochs and collections
lifflander cdf69ab
#410: collection: add missing header include
lifflander 9764708
#410: tests: cleanup tests, fix name collison
lifflander a974aba
#410: tests: fix license
lifflander 3e76af5
#410: tests: fix some small compilation errors
lifflander 3d2b117
#410: collection: switch broadcast after system broadcast to user msg
lifflander f746269
#410: collection: fix missing system message designation
lifflander cb2b519
#410: tests: rewrite dep epoch test to fix logic error
lifflander 4b3a9c6
#410: termination: remove unneeded code, cleanup scheduler
lifflander 48f7a8c
#410: termination: cleanup more code---remove unecessary condition
lifflander File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
/* | ||
//@HEADER | ||
// ************************************************************************ | ||
// | ||
// test_term_dep_epoch_active.cc | ||
// vt (Virtual Transport) | ||
// Copyright (C) 2018 NTESS, LLC | ||
// | ||
// Under the terms of Contract DE-NA-0003525 with NTESS, LLC, | ||
// the U.S. Government retains certain rights in this software. | ||
// | ||
// Redistribution and use in source and binary forms, with or without | ||
// modification, are permitted provided that the following conditions are | ||
// met: | ||
// | ||
// 1. Redistributions of source code must retain the above copyright | ||
// notice, this list of conditions and the following disclaimer. | ||
// | ||
// 2. Redistributions in binary form must reproduce the above copyright | ||
// notice, this list of conditions and the following disclaimer in the | ||
// documentation and/or other materials provided with the distribution. | ||
// | ||
// 3. Neither the name of the Corporation nor the names of the | ||
// contributors may be used to endorse or promote products derived from | ||
// this software without specific prior written permission. | ||
// | ||
// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY | ||
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE | ||
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | ||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
// | ||
// Questions? Contact [email protected] | ||
// | ||
// ************************************************************************ | ||
//@HEADER | ||
*/ | ||
|
||
#include <gtest/gtest.h> | ||
|
||
#include "test_parallel_harness.h" | ||
#include "data_message.h" | ||
|
||
#include "vt/transport.h" | ||
#include "vt/messaging/collection_chain_set.h" | ||
|
||
namespace vt { namespace tests { namespace unit { | ||
|
||
using namespace vt; | ||
using namespace vt::tests::unit; | ||
|
||
struct TestTermDepEpochActive : TestParallelHarness { }; | ||
|
||
struct TestMsg : vt::Message { }; | ||
|
||
struct TestDep { | ||
static void depHandler(TestMsg* msg) { | ||
//auto const& node = theContext()->getNode(); | ||
num_dep++; | ||
//fmt::print("{}: depHandler: num_dep={}\n", node, num_dep); | ||
EXPECT_EQ(num_non_dep, 1); | ||
} | ||
|
||
static void nonDepHandler(TestMsg* msg) { | ||
//auto const& node = theContext()->getNode(); | ||
num_non_dep++; | ||
//fmt::print("{}: nonDepHandler: num_non_dep={}\n", node, num_non_dep); | ||
EXPECT_EQ(num_dep, 0); | ||
} | ||
|
||
static int num_dep; | ||
static int num_non_dep; | ||
}; | ||
|
||
/*static*/ int TestDep::num_dep = 0; | ||
/*static*/ int TestDep::num_non_dep = 0; | ||
|
||
TEST_F(TestTermDepEpochActive, test_term_dep_epoch_active) { | ||
auto const& this_node = theContext()->getNode(); | ||
auto const& num_nodes = theContext()->getNumNodes(); | ||
bool const bcast = true; | ||
int const k = 10; | ||
|
||
TestDep::num_dep = 0; | ||
TestDep::num_non_dep = 0; | ||
vt::theCollective()->barrier(); | ||
|
||
auto epoch = vt::theTerm()->makeEpochCollectiveDep(); | ||
vt::theMsg()->pushEpoch(epoch); | ||
if (bcast) { | ||
for (int i = 0; i < k; i++) { | ||
auto msg = vt::makeSharedMessage<TestMsg>(); | ||
vt::theMsg()->broadcastMsg<TestMsg, TestDep::depHandler>(msg); | ||
} | ||
} else { | ||
} | ||
vt::theMsg()->popEpoch(epoch); | ||
vt::theTerm()->finishedEpoch(epoch); | ||
|
||
auto chain = std::make_unique<vt::messaging::CollectionChainSet<NodeType>>(); | ||
chain->addIndex(this_node); | ||
|
||
chain->nextStep([=](NodeType node) { | ||
auto const next = this_node + 1 < num_nodes ? this_node + 1 : 0; | ||
auto msg = vt::makeSharedMessage<TestMsg>(); | ||
return vt::theMsg()->sendMsg<TestMsg, TestDep::nonDepHandler>(next,msg); | ||
}); | ||
|
||
chain->nextStep([=](NodeType node) { | ||
auto msg = vt::makeMessage<TestMsg>(); | ||
return vt::messaging::PendingSend(msg, [=](MsgVirtualPtr<vt::BaseMsgType>){ | ||
EXPECT_EQ(TestDep::num_dep, 0); | ||
theTerm()->releaseEpoch(epoch); | ||
}); | ||
}); | ||
|
||
vt::theTerm()->addAction([=]{ | ||
EXPECT_EQ(TestDep::num_non_dep, 1); | ||
EXPECT_EQ(TestDep::num_dep, (num_nodes - 1)*k); | ||
}); | ||
} | ||
|
||
}}} // end namespace vt::tests::unit |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a fan of the style choice of having the scheduler run and the test assertions get checked as a result of running to quiescence as the process is finishing up. If nothing else, it makes for really funky looking stack traces if/when an assertion fails.