pika icon indicating copy to clipboard operation
pika copied to clipboard

Ensure `thread_pool_scheduler` annotations work with stdexec

Open msimberg opened this issue 1 year ago • 1 comments

We currently disable the schedule_from customization for thread_pool_scheduler with stdexec: https://github.com/pika-org/pika/blob/cb8ebe0667c903cd3155201b2a356f0e15b19855/libs/pika/executors/include/pika/executors/thread_pool_scheduler.hpp#L269-L287. We should make sure the customization is used even with stdexec enabled. In the case of this example, transfer should inherit of the scoped_annotation if no annotation is set on the scheduler (pseudo code):

scoped_annotation annotation("annotation");
auto s = schedule(sched) | then() | transfer(sched) | then();

msimberg avatar May 09 '23 13:05 msimberg

It may be possible to dispatch to the default implementation using the new transform_sender mechanism in stdexec (https://ericniebler.github.io/wg21/D2999R1.html). The process would look like this:

  • customize schedule_from for thread_pool_scheduler/thread_pool_domain via transform_sender
  • update the scheduler to have the appropriate annotation
  • dispatch to the default implementation with transform_sender and default_domain
  • use the customization of schedule inside the default implementation of schedule_from

The transition in stdexec is not fully complete, so we may have to wait a bit before trying it out.

msimberg avatar Nov 03 '23 13:11 msimberg