How to call stop from parallel foreach

seany seany at uni-bonn.de
Fri Jun 25 16:37:06 UTC 2021


On Friday, 25 June 2021 at 15:50:37 UTC, seany wrote:
> On Friday, 25 June 2021 at 15:16:30 UTC, jfondren wrote:
>> On Friday, 25 June 2021 at 14:44:13 UTC, seany wrote:
>>>>
>>>> This particular location does not cause segfault.
>>>> It is segfaulting down the line in a completely unrelated 
>>>> location... Wait I will try to make a MWP.
>>>
>>> [Here is MWP](https://github.com/naturalmechanics/mwp).
>>>
>>> Please compile with `dub build -b release --compiler=ldc2 `. 
>>> Then to run, please use : `./tracker_ai --filename 
>>> 21010014-86.ptl `
>>
>> With ldc2 this segfaults for me even if std.parallelism is 
>> removed
>> entirely. With DMD and std.parallelism removed it runs to 
>> completion.
>> With DMD and no changes it never seems to finish.
>>
>> I reckon that there's some other memory error and that the 
>> parallelism
>> is unrelated.
>
> Try : (this 
> version)[https://github.com/naturalmechanics/mwp/tree/nested-loops]
>
> The goal is to parallelize : `calculate_avgSweepDist_pairwise` 
> at line `3836`. Notice there we have 6 nested loops. Thank you.

Ok, i stopped the buss error and the segfault. It was indeed an 
index that was written wrong in the flattened version .

No, I dont have the seg fault any more. But I have "error 
creating thread" - time to time.  Not always.

But, even with the taskpool, it is not spreading to multiple 
cores.


More information about the Digitalmars-d-learn mailing list