computablee / DotMP

A collection of powerful abstractions for parallel programming in .NET with an OpenMP-like API.
https://computablee.github.io/DotMP/
GNU Lesser General Public License v2.1
29 stars 8 forks source link

[FEATURE] Create custom scheduler API #99

Closed computablee closed 11 months ago

computablee commented 11 months ago

I would love to be able to provide an easy-to-use API for implementing custom worksharing parallel-for schedulers into DotMP. There is research precedent for this, such as:

I would like to incorporate an interface named IScheduler which incorporates the InitLoop and CoreLoop methods. The InitLoop method should be void and take an int start, int end, and a params dynamic[] tuning_params. The CoreLoop method should be of type (int, int), take an int thread_id as a parameter, and return the start and end of the current chunk to execute.

The only alternative to this solution would be to clone the DotMP repo and implement custom schedulers that way, which would be harder on anyone who wants to implement a custom scheduler due to the necessity to understand DotMP internals.

This will be yet another full rewrite of the internal scheduler code. I am self-assigning this issue. This will involve breaking API changes.