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

Cannot figure out waitany #8

Closed
VictorEijkhout opened this issue May 8, 2020 · 3 comments
Closed

Cannot figure out waitany #8

VictorEijkhout opened this issue May 8, 2020 · 3 comments

Comments

@VictorEijkhout
Copy link

The crucial lines in my code are:

  if (procno==nprocs-1) {
    mpl::irequest_pool recv_requests;
    vector<int> recv_buffer(nprocs-1);
    for (int p=0; p<nprocs-1; p++) {
      recv_requests.push( comm_world.irecv( recv_buffer[p], p ) );
    }
    printf("Outstanding request #=%d\n",recv_requests.size());
    for (int p=0; p<nprocs-1; p++) {
      auto [success,index] = recv_requests.waitany();

This gives on the waitany call:

Assertion failed in file ./src/include/mpir_request.h at line 313: ((req))->ref_count >= 0
0   libpmpi.12.dylib                    0x000000010a7b44de backtrace_libc + 62
1   libpmpi.12.dylib                    0x000000010a7b4495 MPL_backtrace_show + 21
2   libpmpi.12.dylib                    0x000000010a7502f4 MPIR_Assert_fail + 36
3   libmpi.12.dylib                     0x000000010a579445 MPI_Waitany + 2469
4   irecvsource                         0x000000010a4ea4f0 main + 672
5   libdyld.dylib                       0x00007fff7319c3d5 start + 1

Do you immediately see what I'm doing wrong or do I need to supply a fully functioning reprodcuer?

rabauke added a commit that referenced this issue May 10, 2020
@rabauke
Copy link
Owner

rabauke commented May 10, 2020

Thanks for your report. Please report if 47680a5 fixes your issues.

@VictorEijkhout
Copy link
Author

Thank you. That fixed it.

Btw, instead of returning a pair of bool/index you could use std::optional. I don't know how many users you have, but I don't mind if you make a breaking change in the API here.

@rabauke
Copy link
Owner

rabauke commented May 11, 2020

std::optional is not part of C++ 11. The library will be ported to C++17 in the future. std::optional might be an option then.

@rabauke rabauke closed this as completed May 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants