It is easy to Parallelize[] Map[] & MapIndexed[], as having been shown in MMA9 Help for ParallelMap[] and Parallelize[].
For MapIndexed[], the default levelspec is {1}. However there are many cases when we need mapping to deeper levels such as {-1}, for example with image data (2D array). I have tried Parallelize[] and found it FAILED and switched to sequential evaluation whenever levelspec is explicitly specified, actually even when levelspec={1} !
In page 652 of Sal Mangano's Mathematica Cookbook, he seems to have written functions which
- use Parallelize[] on MapIndexed[]
- able to specify levelSpec
I don't know how he achieved that, and his example was not detailed enough to see the intended effect. I actually suspect that: with the default levelspec={1}, Parallelize[] could conveniently distribute the elements on the first level of the list across different kernels (like breadth-first search on level 1, using a queue in C); however if we need to go deeper with MapIndexed[]'s depth-first (see help) search, then the parallel implementation would be very difficult.
So is it true that Parallelize[Mapindexed[]] only works with default/implicit levelSpec={1}, not others?
Is Mr. Sal Mangano on this forum? Could he also comment?