June 25, 2021

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.

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.

June 25, 2021

On Friday, 25 June 2021 at 15:16:30 UTC, jfondren wrote:

>

I reckon that there's some other memory error and that the parallelism is unrelated.

@safe:

source/AI.d(83,23): Error: cannot take address of local `rData` in `@safe` function `main`
source/analysisEngine.d(560,20): Error: cannot take address of local `rd_flattened` in `@safe` function `add_missingPoints`
source/analysisEngine.d(344,5): Error: can only catch class objects derived from `Exception` in `@safe` code, not `core.exception.RangeError`

And then, about half complaints about @system dlib calls and
complaints about void* <-> rawData[]* casting

The RangeError catch likely does nothing with your compile flags.

Even if you don't intend to use @safe in the end, I'd bet that the
segfaults are due to what it's complaining about.

June 25, 2021

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.

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.

June 25, 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.

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.

June 25, 2021

On Friday, 25 June 2021 at 16:37:06 UTC, seany wrote:

>

On Friday, 25 June 2021 at 15:50:37 UTC, seany wrote:

>

On Friday, 25 June 2021 at 15:16:30 UTC, jfondren wrote:

>

[...]

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.

PS: this is the error message : "core.thread.threadbase.ThreadError@src/core/thread/threadbase.d(1219): Error creating thread"

June 25, 2021

On Friday, 25 June 2021 at 16:37:44 UTC, seany wrote:

>

On Friday, 25 June 2021 at 16:37:06 UTC, seany wrote:

>

On Friday, 25 June 2021 at 15:50:37 UTC, seany wrote:

>

On Friday, 25 June 2021 at 15:16:30 UTC, jfondren wrote:

>

[...]

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.

PS: this is the error message : "core.thread.threadbase.ThreadError@src/core/thread/threadbase.d(1219): Error creating thread"

If i use parallel(...)it runs.

If i use prTaskPool.parallel(..., then in the line : auto prTaskPool = new TaskPool(threadCount); it hits the error. Please help.

June 25, 2021

On Friday, 25 June 2021 at 19:17:38 UTC, seany wrote:

>

If i use parallel(...)it runs.

If i use prTaskPool.parallel(..., then in the line : auto prTaskPool = new TaskPool(threadCount); it hits the error. Please help.

parallel() reuses a single taskPool that's only established once.

Your code creates two TaskPools per a function invocation and you
call that function in a loop.

stracing your program might again reveal the error you're hitting.

June 25, 2021

On Friday, 25 June 2021 at 19:30:16 UTC, jfondren wrote:

>

On Friday, 25 June 2021 at 19:17:38 UTC, seany wrote:

>

If i use parallel(...)it runs.

If i use prTaskPool.parallel(..., then in the line : auto prTaskPool = new TaskPool(threadCount); it hits the error. Please help.

parallel() reuses a single taskPool that's only established once.

Your code creates two TaskPools per a function invocation and you
call that function in a loop.

stracing your program might again reveal the error you're hitting.

I have removed one - same problem.
Yes, I do call it in a loop. how can I create a taskpool in a function that itself will be called in a loop?

June 25, 2021

On Friday, 25 June 2021 at 19:52:23 UTC, seany wrote:

>

On Friday, 25 June 2021 at 19:30:16 UTC, jfondren wrote:

>

On Friday, 25 June 2021 at 19:17:38 UTC, seany wrote:

>

If i use parallel(...)it runs.

If i use prTaskPool.parallel(..., then in the line : auto prTaskPool = new TaskPool(threadCount); it hits the error. Please help.

parallel() reuses a single taskPool that's only established once.

Your code creates two TaskPools per a function invocation and you
call that function in a loop.

stracing your program might again reveal the error you're hitting.

I have removed one - same problem.
Yes, I do call it in a loop. how can I create a taskpool in a function that itself will be called in a loop?

One option is to do as parallel does:
https://github.com/dlang/phobos/blob/master/std/parallelism.d#L3508

1 2 3
Next ›   Last »