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

parallel_reduce of size 0, not calling init/join #175

Closed
bathmatt opened this issue Jan 26, 2016 · 5 comments
Closed

parallel_reduce of size 0, not calling init/join #175

bathmatt opened this issue Jan 26, 2016 · 5 comments
Assignees
Labels
Bug Broken / incorrect code; it could be Kokkos' responsibility, or others’ (e.g., Trilinos)

Comments

@bathmatt
Copy link

I would assume that if you call a parallel_reduce(0, functor) it would call init and then join for the result, or at least call init for the result. However, this call does nothing.

Therefore, for a reduction of an array has to do the convoluted code listed below with the if statement.

if ( particles_.migrate_count_() == 0 )
for (size_t i=0; i<n_remote_procs_; ++i)
count[i] = 0;
else
// This is the only thing that should be needed
Kokkos::parallel_reduce(particles_.migrate_count_(), counter, &count[0]);

@crtrott
Copy link
Member

crtrott commented Jan 26, 2016

That was supposed to get fixed with a commit about 5 days ago, which should have made it into Trilinos with the last integration I believe. Is this an issue in the current Head Trilinos?

Here is the commit: 432e294

@bathmatt
Copy link
Author

After an update, this seems to work,

@crtrott
Copy link
Member

crtrott commented Jan 26, 2016

OK great. And its not an accident but was explicitly fixed ! ;-) Closing the issue.

@crtrott crtrott closed this as completed Jan 26, 2016
@crtrott crtrott added Bug Broken / incorrect code; it could be Kokkos' responsibility, or others’ (e.g., Trilinos) InDevelop labels Jan 26, 2016
@bathmatt
Copy link
Author

Did you add a test because this was fixed previously (I reported it a long while ago) and broken since then.

@hcedwar
Copy link
Contributor

hcedwar commented Jan 26, 2016

Yes - unit tests were added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Broken / incorrect code; it could be Kokkos' responsibility, or others’ (e.g., Trilinos)
Projects
None yet
Development

No branches or pull requests

4 participants