Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Structuring a MATLAB program for parallelization
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
akappner

Posts: 1
Registered: 11/23/12
Structuring a MATLAB program for parallelization
Posted: Nov 23, 2012 9:40 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I am a novice MATLAB user currently writing a resource-intensive simulation program. Its main data structure is a collection of particles having a three-component position vector and a number of other properties (the number of which is known in advance).

My first attempt was to use an array of structs for this (particles(n).x=rand(), etc...), which would work fine with a regular loop but gave an error when wrapping it in a parfor loop, which makes it seem that this is not the best approach.
Furthermore, I would like to move part of the calculations to the GPU at a later time, which seems impossible using the struct array. What would be the preferred way of organizing such a data structure in MATLAB?

Best regards
Alexander



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.