Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

msvadi

macrumors 6502
Original poster
Aug 12, 2010
364
68
Hi,

I'm planning to buy a Mac Pro for running (statistical) Monte Carlo simulations with Matlab. My programs can be easily parallelized, so I would like to have more cores. At the same time, since the processor speed drops with the number of cores, I wonder if a 8-core or even 6-core machine would be more efficient than 12 cores. Does anyone here uses Mac Pros for similar purposes? What do you think the optimal number of cores is?

Another question: do you think it makes sense for me to go with a more powerful GPU (D700 instead of D500)? I have not tried yet GPU computing with Matlab, so I'm not sure if it's worth it.

Thanks
 

Earl Urly

macrumors regular
Jul 11, 2004
221
1

msvadi

macrumors 6502
Original poster
Aug 12, 2010
364
68
At the moment MatLab only supports CUDA for speeding up computations.

http://www.mathworks.com/products/matlab/choosing_hardware.html#_Graphics_Processing_Unit_1

So that means it's an nVidia card and an older Mac Pro if you want GPU acceleration. It's very unlikely, though technically not impossible, to see nVidia cards eventually show up on the new Mac Pro.

http://9to5mac.com/2013/10/25/graphics-card-on-new-mac-pro-could-be-upgradeable/

I see, thanks. I'll forget about GPU computing for now.
 

itsmrjon

macrumors regular
Jun 11, 2011
122
0
Chicago
If you want a real speedup move away from Matlab all together.

Since MC algorithms are embarrassingly parallel you can get linear or even possibly superlinear speedup if you know what you are doing. So assuming you are that good at your implementation, speedup will be on the order of clock*cores, meaning you should have as many cores as possible.

Now, onto the grittier details... you need to efficiently and effectively generate random numbers across as many cores as possible, this is where you are going to see the penalty, unless you use a very good RNG library. I strongly recommend using SPRNG (http://www.sprng.org/) if you want to see that linear speedup.

But this brings me back to my original point... if you want to use a good parallel random number generation library AND see good speedups, you'll have to move away from matlab, regardless of whether you buy a mac pro or not.

--------
topic 2: GPU

MC algorithms are amazing on the mac pro GPU. I actually just wrote one for pricing american options using PyOpenCL, speedup was ~50x over using 8 cores on the d500s. But once again, Matlab uses CUDA not OpenCL, so you'll need to switch programming languages.

My serious recommendation, look into Python with Numpy. It can do array like expressions similar to matlab, it is faster, and it is more extensible. You can also use the PyOpenCL package for writing code that will execute on the GPUs (http://mathema.tician.de/software/pyopencl).
 

msvadi

macrumors 6502
Original poster
Aug 12, 2010
364
68
If you want a real speedup move away from Matlab all together.

.

Thanks, itsmrjon, this is helpful and very intriguing. I've heard already many good things about python/numpy, and it's certainly on my list of things to learn.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.