-
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
702 make reduce return pending send #714
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #714 +/- ##
===========================================
+ Coverage 77.42% 77.54% +0.12%
===========================================
Files 656 656
Lines 25144 25363 +219
===========================================
+ Hits 19468 19668 +200
- Misses 5676 5695 +19
|
ccb7957
to
24f0d39
Compare
66c170c
to
fe927c3
Compare
FYI the build test on mac os x is failing because of an annoying mac os x issue where the hosts file is configured in a certain way that breaks mpich: https://stackoverflow.com/questions/23112515/mpich2-gethostbyname-failed |
I'm trying to debug the failure now. Something changed very recently in Github's configuration. |
FWIW this happens to me every couple of months on my mac os machine; it seems to reset the hosts file |
Ok, I have a issue #931/PR #932 open to try to fix it. I'm planning to add some entries to the hosts file and possible explore other options also. |
@PhilMiller Can you review this? |
fe927c3
to
951903b
Compare
} | ||
|
||
static void test_handler_reduce(ChainReduceMsg *msg) { | ||
if (msg->isRoot()) { |
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.
Should this actually assert that condition? The handler presumably shouldn't be getting run on anywhere other than the root
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.
This is actually a bare reduce handler (the low-level interface) that is invoked by the newer higher level reduce handlers/callbacks. The low-level interface uses a single handler up the tree (including at the root). See default_op.impl.h for reference. This is the correct way to determine if the handler has made its way to the root
Anyway, @nmm0, we should switch this to a modern handler.
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.
@lifflander I wasn't aware there was a preferred handler -- which one should I use here?
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.
The reduction in this case is vt::collective::None
.
- Make the message
ChainReduceMsg
inherit fromvt::collective::ReduceNoneMsg
- Create a callback to a lambda:
auto cb = vt::theCB()->makeFunc<ChainReduceMsg>([](ChainReduceMsg*){
// action to execute on root
});
- Call the reduce like this:
vt::NodeType root = 0;
auto r = vt::theCollective()->global(); // if using the global reducer
r->reduce<vt::collective::None>(root, msg.get(), cb);
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.
Updated to the new interface with the latest commit
All of the titular stuff about making collectives return I see nothing in the issue or PR that motivates or explains the merging bits, though. Their logic seems sound on their face, but I don't understand the use case they fulfill. |
951903b
to
0f22df1
Compare
In my particular use case (contact) they are required for the "CollisionObject" interface. The main idea is that each object has its own CollectionChainSet representing the operations performed on that object. That includes converting local data to a vt collection, building trees, and evaluating collision. In the case of evaluating collision the idea is that both CollisionObject A and CollisionObject B must have completed their previous operations (i.e. building hierarchies and building the VT collections) in order for the collision to work. So the collision detection can be thought of as dependent on both A and B's chainsets. |
Ok, cool, I'll buy that. When you say "object" here, I assume you mean the physical bodies in the structures being simulated, through their dynamics and collisions? |
Exactly -- though they are also referred to as "blocks". Right now in NimbleSM there are two objects, primary and secondary though we want to target arbitrary numbers of objects. Basically in this model there are no self-collision; i.e. elements in one block will not collide with other elements in the block. |
4480bba
to
f8d5895
Compare
…w constructor that allows construction with the new EpochActionType. Additionally move some messages that are not used externally to private to preserve class invariant. Move the definitions of some non-templated functions to the source file. Make the move constructor noexcept.
… collective reduce, collections, and objgroups This makes returning a sequentialID impossible. In order for collections to order properly, add a reduceImmediate public overload set that takes the same parameters as reduce but returns the sequential id instead of a PendingSend. This is used internally by the new reduce and collection reduceMsgExprImpl, but can be called by the user.
…n't repeated on destruction
…ase for epoch that was causing a crash
…s to have a PendingSend be dependent on two chain sets
…epCollective that the index exists in both chain sets
…orm bcast/send is added add extra checks for combining those in the chainset.
…o reflect that the chain sets deal with indices, not necessarily all resident elements from the collection
…ame node as the root for the reduce
a10af4b
to
beea5ea
Compare
Signed commits and rebased on develop |
Here is an overview of what got changed by this pull request: Clones added
============
- tests/unit/termination/test_term_chaining.cc 4
- tests/unit/termination/test_term_dep_send_chain.cc 4
- src/vt/collective/reduce/reduce.h 2
- src/vt/vrt/collection/reducable/reducable.impl.h 2
- src/vt/objgroup/proxy/proxy_objgroup.impl.h 2
See the complete overview on Codacy |
Fixes: #702