Thanks for trying, but the issue remains unsolved. Evaluate
has no effect in this case because the time-consuming function, NDSolve
, is not being delayed until plotting, and replacing Array
with ParallelArray
multiplies the evaluation time by at least 6.
This takes 4.67 seconds:
AbsoluteTiming[
img = Array[(Plot3D[
Evaluate[Abs[soln[#, x, y]]], {x, y} \[Element] R] &), {16},
0];]
While this takes 27.6 seconds:
AbsoluteTiming[
img = ParallelArray[(Plot3D[
Evaluate[Abs[soln[#, x, y]]], {x, y} \[Element] R] &), {16},
0];]
For serial, my evaluation times as a function of the number of plots is: {{10, 12.2379}, {15, 18.5765}, {20, 24.7349}, {25, 31.6992}, {30,
41.3019}, {35, 45.4878}, {40, 51.805}, {45, 57.9418}, {50, 65.3213}}
While for parallel, it is: {{10, 293.046}, {15, 458.709}, {20, 611.03}, {25, 725.197}, {30,
873.236}, {35, 1027.61}, {40, 1116.4}, {45, 1244.97}, {50, 1397.45}}
The problem appears to be with the implementation of Parallel*