Dear list,

in our current HPX driven project, we encountered the need 
for a functionality, of which we are unsure if it 
currently exists in HPX:

We picture in an abstract way the HPX runtime to behave 
like the following:
Whenever a task is scheduled on a locality (with e.g. 
async) this task is pushed into a FIFO-Queue and whenever 
resources for computation become available the queue is 
polled.

However we would need a functionality to modify the order 
of execution of already scheduled tasks, e.g. replace this 
(imaginary, behind-the-scenes) FIFO-Queue with a 
Priority-Queue.

In other words:
Our program schedules a lot of tasks locally and continues 
to schedule more and more batches of tasks locally over 
time. However we would like tasks that are scheduled at a 
later point in time to possible be run before 
not-yet-started tasks that were scheduled earlier on. For 
this, in our application each task can be assigned a 
unique priority which is calculatable from the arguments 
passed to the asynchronously called function.

Consider the following explanatory code:

for (int i = 0; (i < n); i++)
     hpx::async<some_action>(float priority, T 
other_parameters);

This code snippet would be called multiple times on the 
same locality scheduling multiple batches of tasks of type 
some_action. We now want all tasks of type some_action on 
a certain locality to be executed in an order where the 
priority is considered.

Note that it is no problem to run tasks with a lower 
priority before other tasks with a higher priority, if 
these higher priority tasks just was not scheduled for now 
(think Priority-Queue functionality).

Is there a way to intervene with the hpx runtime on such a 
low level?

Thanks in advance,

Kilian Werner

P.S.: The problem could also be solved by scheduling the 
tasks of type some_action with an executor, which 
internally forwards the tasks through a priority-queue 
based semaphore, but it would be hard to allow just enough 
tasks through the semaphore to fill all computational 
resources.
_______________________________________________
hpx-users mailing list
[email protected]
https://mail.cct.lsu.edu/mailman/listinfo/hpx-users

Reply via email to