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

Sort output for test_iProbe. #119

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Changes from 1 commit
Commits
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
3 changes: 3 additions & 0 deletions tests/mpi/eckit_test_mpi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* does it submit to any jurisdiction.
*/

#include <algorithm>
#include <fstream>
#include <numeric>

Expand Down Expand Up @@ -1000,6 +1001,8 @@ CASE("test_iProbe") {
--count;
}

std::sort(data.begin(), data.begin() + nproc);
Copy link
Contributor

Choose a reason for hiding this comment

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

Given that we know the size is nproc, we may as well write

std::sort(data.begin(), data.end());

or better still

std::sort(begin(data), end(data));

Also, I'd expect the same fix to be also needed for test_probe, although I'm too surprised we hit this
first with test_iProbe.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I have updated as you say.

The failure is transient, so maybe it does affect test_probe as well, I just haven't really noticed. I have made the same change for test_probe.


for (int i = 0; i < nproc; i++) {
EXPECT(i == data[i]);
}
Expand Down