Skip to content

DotMP Release v1.6.0

Compare
Choose a tag to compare
@computablee computablee released this 26 Nov 07:13
· 183 commits to main since this release
2db30d0

DotMP v1.6.0 doesn't incorporate a ton of new features (though there are some!). Rather, it aims to provide a wide plethora of well-needed performance improvements across the board.

Licensing Changes

The project license has been changed from MIT to LGPL 2.1.

Changes to the Scheduler API

The schedule parameter in Parallel.For and its derivatives now take implementations of the IScheduler interface instead of a DotMP.Schedule enum. The changes are fully source-compatible with previous versions, but breaks API and ABI compatibility. There are not only performance benefits to doing this, but in addition, the code is simpler, more modular, more maintainable, more readable, has less duplication, and is expansible by the user.

The IScheduler interface is public-facing and permits users to implement their own custom schedulers. Details are outlined in the new wiki!

We also introduce a new work-stealing scheduler. The work-stealing scheduler can be accessed via DotMP.Schedule.WorkStealing, and has been seamlessly integrated into the rest of DotMP. Details are also outlined in the new wiki.

Performance Improvements

There have been minor performance improvements across the board with parallel-for loops. However, collapsed for loops see substantial performance improvements, over 3x in some of my benchmarks. Static scheduling sees a performance bump as well from better avoidance of false sharing issues.

GetThreadNum has also been optimized, though this is already such a lightweight function that it's hardly noticeable.

Tasking Improvements

Previously, it was possible to spawn tasks from within other tasks, but it was not possible for a task to wait on its child tasks to complete. Now, there is a new implementation of taskwait which permits you to specify which tasks to wait on, and this version does not act as a barrier if called from within a task. If the default taskwait without arguments is called from within a task, a deadlock is detected and an exception is thrown.

Bug Fixes

Prior to this release, if an exception was thrown from inside a parallel region, it could not be caught from outside the region. Now, exceptions thrown inside parallel regions are properly caught and re-thrown in serial space, allowing for try/catch blocks to be thrown around a parallel region and catch exceptions that happen in parallel space.

Atomics

We have now implemented atomic subtraction for unsigned integer types. Two new methods were added to the Atomic static class: uint Sub(ref uint, uint), and ulong Sub(ref ulong, ulong).

Reorganizing

There has been some internal reorganizing. DotMP exceptions have been moved to the DotMP.Exceptions namespace, and the actual scheduler implementations have been moved to the DotMP.Schedulers namespace.

What's Changed

Full Changelog: v1.5.0...v1.6.0