I have three large lists that need to have certain values removed from them. Each list is completely independent of each other, so three threads should be able to execute these in parallel. Here's a MWE of what I want to do:
maxN = 1000000; list1=RandomReal[1,maxN]; list2=RandomReal[1,maxN]; list3=RandomReal[1,maxN]; list1=DeleteCases[list1,x_/;x>=0.5]; list2=DeleteCases[list2,x_/;x>=0.5]; list3=DeleteCases[list3,x_/;x>=0.5];
As you can see, it is very straight forward. I have tried wrapping the entire block of "DeleteCases" with
ParallelTry but it shows no speedup. In fact, it actually slows it down a bit. Of course, I am using
LaunchKernels first, which loads 4 kernels (I have 1 physical CPU, 4 physical cores, 8 logical cores).
Is there a way I can execute each line on a different kernel such that I can evaluate a single cell and have it fork the jobs to 3 kernels? (i.e. this is a piece of larger cell which I do not want to split between cells or other notebooks)
Again, this is a MWE. I do not have 3 simple lists like this, but I do want to delete specific cases from each list. That's the part I need to parallelize.
This is running on Mathematica 9, Win 10 x64.