![]() % (in theory) decreases time on busy machines, but in my case it didn't help. I am on a machine with 64 threads and here are the timing results % pararrayfun using all available threads with ChunksPerProc = 1. However, apparently the Octave interpreter is not smart enough. In my experience, MATLAB's JIT compiler is smart enough to vectorize simple for loops like we have here. I have a philosophical issue with arrayfun / pararrayfun ( What is the use of arrayfun if a for loop is faster?), I believe that they are completely redundant, and they fool MATLAB/Octave users into false sense of efficiency. I was fooling around and testing some other options to do the same calculation and comparing the time spent for each one. ![]() Vector_y = pararrayfun(1, 10.*log10(x.^2), vector_x, "Vectorized", true, "ChunksPerProc", 1) Vector_y = pararrayfun(nproc, 10.*log10(x.^2), vector_x, "Vectorized", true, "ChunksPerProc", 1) Here is the snippet I am using: pkg load parallel
0 Comments
Leave a Reply. |