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

Bring Python API up-to-speed with recent C++ features #187

Open
pentschev opened this issue Feb 6, 2024 · 0 comments
Open

Bring Python API up-to-speed with recent C++ features #187

pentschev opened this issue Feb 6, 2024 · 0 comments

Comments

@pentschev
Copy link
Member

pentschev commented Feb 6, 2024

@pentschev pentschev changed the title Implement active messages receiver callbacks in Python Bring Python API up-to-speed with recent C++ features Feb 23, 2024
rapids-bot bot pushed a commit that referenced this issue Mar 15, 2024
Adds a new pattern to receive Active Messages where the receiving endpoint registers a callback and the sender informs receiver of the callback to use, the receiver then executes that callback and does not require an explicit `ep->amRecv()` call.

Sample code:

```cpp
// Define AM receiver callback's owner and id for callback
ucxx::AmReceiverCallbackInfo receiverCallbackInfo("TestApp", 0);

// Define AM receiver callback and register with worker
std::shared_ptr<ucxx::Request> receivedRequest = nullptr;
auto callback = ucxx::AmReceiverCallbackType(
  [this, &receivedRequest](std::shared_ptr<ucxx::Request> req) {
    {
      receivedRequest = req;
    }
  });
worker->registerAmReceiverCallback(receiverCallbackInfo, callback);

// Submit and wait for transfers to complete
std::shared_ptr<ucxx::Request> sendRequest;
requests.push_back(ep->amSend(buffer, size, memoryType, receiverCallbackInfo));
while (!sendRequest->isCompleted())
  worker->progress()

while (receivedRequest == nullptr)
  worker->progress();
```

This PR only implements C++ parts, #187 tracks the missing Python implementation.

Authors:
  - Peter Andreas Entschev (https://github.com/pentschev)

Approvers:
  - Lawrence Mitchell (https://github.com/wence-)

URL: #186
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

1 participant