If I do:
auto tasks = new Tid[numberOfTasks] ;
foreach ( i ; 0 .. numberOfTasks ) { tasks[i] = spawn ( & partialSum ,
thisTid , i , sliceSize , delta ) ; }
everything workls as desired, I get parallelism and appropriate scaling.
However if I try:
auto tasks = map ! ( ( i ) { return spawn ( & partialSum , thisTid , i ,
sliceSize , delta ) ; } ) ( iota ( numberOfTasks ) ) ;
the code runs but everything is serialized, no parallelism, no speed up.
I would say this is a bug, but perhaps it is a consequence of the way map works?
--
Russel.
=============================================================================
Dr Russel Winder t: +44 20 7585 2200 voip: sip:[email protected]
41 Buckmaster Road m: +44 7770 465 077 xmpp: [email protected]
London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
signature.asc
Description: This is a digitally signed message part
