Having trouble with parallel Haskell

Bryan O'Sullivan bos at serpentine.com
Wed Jun 4 21:01:34 EDT 2008


Albert Y. C. Lai wrote:

> In main, the builder of input is highly lazy, since randoms is. To be
> sure, the spine of the list is presently forced by printing its length,
> but the numbers inside the list... It is very bleak because randoms
> ensures that input!!(n+1) is patently dependent on input!!n, ad
> infinitum; this should defy all attempts at parallelism...

Hmm.  I forced the elements of the list with rnf, and it didn't really
make a difference.  I now get perhaps 115% CPU usage during a sort.
That is a small improvement in parallelism, but it also causes the
program to take about 15% longer to run :-)

	<b


More information about the Glasgow-haskell-users mailing list