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

`DotMP.Parallel.For`, `ForReduction` should throw exception if nested #48

Closed computablee closed 11 months ago

computablee commented 1 year ago

In the last major refactor of the DotMP core, I neglected to re-add the exception handling for DotMP.Parallel.For and DotMP.Parallel.ForReduction if they are nested within each other. You should check the WorkShare singleton's in_for flag and throw the CannotPerformNestedForException if it's set. Shouldn't be difficult, but you want to make sure to instantiate a WorkShare object using the default constructor to check the in_for flag before the parameterized constructor is called, because calling the parameterized constructor resets the static WorkShare fields.

You can skim the WorkShare class in the Init.cs file to see what I mean.

Myworld21 commented 1 year ago

I would like to work on this issue. Will you please assign it to me?

computablee commented 1 year ago

Absolutely! When opening your PR, just please make sure to target the bug-fixes branch.

Myworld21 commented 1 year ago

Sure! Thank You!

computablee commented 11 months ago

@Myworld21 I'm just checking in, do you have any updates?

Kaybangz commented 11 months ago

I would like to take on this task if @Myworld21 is no longer working on it

computablee commented 11 months ago

@Kaybangz Sure, I'll assign you as well. You can just add it to your current PR if you like, it'll be a really good error handling PR.

computablee commented 11 months ago

Update: when working on exception handling tonight I inadvertently fixed this issue. I am unassigning everyone and closing this issue.

@Kaybangz Since I accidentally fixed this issue right after assigning you, let me know if there's another issue you want to work on and I'll see what I can make happen. So sorry!