4

If the list contains numbers, I suggest vectorization instead of parallelization. Try to write f so that it is vectorizable. My BoolEval package (partially available as a resource function) is also convenient. For example, if f is Sin (which is vectorized) then you can do arr = RandomReal[100, 100000000]; << BoolEval` mask = BoolEval[Sin[arr] >...


4

Parallelize the application of the selector function, then use Pick to choose the elements for which the selector function returns Trueor False. I made up a slow function f and a "long list": f = (Pause[0.1]; # < 50) &; longlist = RandomReal[{0, 100}, {10}]; You can appreciate the difference in application time between serial and parallel execution:...


2

i = 1; Table[i++, {j, 1, 4}] {1, 2, 3, 4} h = 1; ParallelTable[h++, {j, 1, 4}] {1, 1, 1, 1}


1

krs=LaunchKernels[]; (*It launches 6 kernels by default on my PC*) ParallelEvaluate[a = 1 + 1, krs[[5]]]; ParallelEvaluate[Names["a"]] The output is like: {{}, {}, {}, {}, {"a"}, {}}


Only top voted, non community-wiki answers of a minimum length are eligible