The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Structuring a MATLAB program for parallelization
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  

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

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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.