Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
brain dead parfor - can any expert help to re-design/code something new?

Subject: brain dead parfor - can any expert help to re-design/code something new?

From: nav0239

Date: 2 Mar, 2009 00:56:01

Message: 1 of 2

Noticed the parfor source is actually included in the 2008b. It's so complicated and no wonder it's deadly inefficient for most apps and there are so many restrictions. I have gone through the multi-core code on MFE, which is not very useful if the parallel loop executes within a few seconds.

Are there any Matlab expert out there interested in helping to create something simple, if possible. We can limit it to be used on local multi-core and multi-CPU only. I am thinking something alone the line:

1) at the parallel loop entry assign each thread to do only staggered stride N (# of threads) loops.
2) create one binary semaphore for each of the variable assignment within the loop. Could do better here if preferred, say, there is no need for the semaphore if the variable is or can be made to be temporary and local to each of the threads.
3) create the N threads which will all run using the same client environment and addressing space. They will need to take and release the semaphores before and after updating corresponding variables.
4) at the end of the loop, the main thread will wait for all othes to complete
and continue.

Mex may be used to implement this. Am I thinking too simple here?

Also, a question: is mexCallMatlab() or mexEval() type of calls interact with the dlls directly, or it somehow communicates with the "engine" equivelant or the main process.

Thanks
 

Subject: brain dead parfor - can any expert help to re-design/code something new?

From: Jveer

Date: 2 Mar, 2009 02:10:18

Message: 2 of 2

finally someone decided to act on that $?%@ parfor

good luck

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us