Turnip without parallelization

I really like the Repa interface, despite its concurrency capabilities. And I really need repa arrays to be consistent, since my arrays are relatively small, and parallelizing them is useless, even harmful.

However, I use parallelization in my program with parallel io, so I compile it -threaded and run with +RTS -Nx . And it allows parallelization for repa. Is there a way to disable repa concurrency functions?

Hm, when writing this, I realized that it was unlikely that I would need something else and then DIM1 , so maybe I need to switch to Vector . Nevertheless, the answer to the question will be useful.

A warning message that I get with parallel running,

 Data.Array.Repa: Performing nested parallel computation sequentially. You've probably called the 'force' function while another instance was already running. This can happen if the second version was suspended due to lazy evaluation. Use 'deepSeqArray' to ensure that each array is fully evaluated before you 'force' the next one. 

I don't really have force in my code.

+7
source share
1 answer

Use the Repa 3 development version from http://code.ouroborus.net/repa/repa-head . It has a version of "force" (called computeS) that will evaluate the array sequentially.

Repa does not automatically perform sequencing operations on small arrays. C (map f xs) runtime depends on what "f" does as the size of "xs". Repa is not trying to figure out what "f" is doing (it will be difficult), so he does not know how expensive the calculation will be.

+3
source

All Articles