parallellisation of a large array

I have an array of about a million points. On each point, a number of computations involving frequent conversion between the frequency and time domain is done. So the overall time to process a million data points come to about 5 minutes. I'm looking to to reduce the computation time. One option I am exploring is using GPUs. One of the ways I'm looking to do this is is by chopping the array into smaller sizes and perform the analysis (run the same code) on each of the smaller segments simultaneously. Will I be able to achieve this using GPUs (i.e use the ~100 cores as a cluster of workstations)? If so, how would I simultaneously run multiple instances of the code on multiple threads (cores) simultaneously from the same client program?
Thank you for your help and advice!

Réponses (1)

Edric Ellis
Edric Ellis le 7 Oct 2011

1 vote

GPUs are great at elementwise computations, by putting your data into a gpuArray, you can have all the cores of your CUDA GPU operating simultaneously on your data. Your best is probably to use arrayfun as this lets you write MATLAB code to operate on each element.
This demo shows various different ways of working with gpuArrays.

1 commentaire

Rejoy
Rejoy le 10 Oct 2011
Thanks Edric!
I see the performance advantage of using arrayfun. From the example you suggested, this feature is used when the entire operation is in a function that we can call using arrayfun, so the same algorithm is applied to each element in the array.
Unfortunately, the program I'm trying to speed up is quite big and complex and rewriting/restructuring it to run more efficiently on GPUs is something I'm trying to avoid. Thats why I'm curious if there is a way we can run multiple instances of the program (on different GPU cores) using smaller segments of the original array as the input to each instance. For example if there are 400 cores available, split the entire data set into 400 segments and run 400 instances of the program simultaneously (like a cluster of workstations)with the smaller data sets.
Once again, I appreciate all the help!

Connectez-vous pour commenter.

Catégories

Question posée :

le 7 Oct 2011

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by