MATLAB Answers


multi core full control

Asked by Anas A.Salam on 18 Apr 2013
hello i want to ask if there is a capability in MATLAB to have full control on CPU cores so if you have any info. about this subject please tell me :) thanks


Show 1 older comment
no i don't think so what i mean about "full control" i want to submit same job on different cores at the same time but these jobs will done on different data by other words if i have huge data and i want to send first part of it to core 1 and second part to core 2 and so on ... so could i do this with matlab with ability to see if cores synchronize, not full and not fail "full control or full monitoring cores" or not ?? note that each core will do same calculation on these parts of submitted data
You could use a distributed array.
how to use this tool could you learn me ??

Sign in to comment.

2 Answers

Answer by Sean de Wolski
on 18 Apr 2013

With the Parallel Computing Toolbox you have direct access to the MPI library low-level functionality. This enables you to use functions such as labSend to explicitly send something to a worker on a CPU core.
What are you trying to do?


what i have: 1- video with 200 frame. 2- some calculation like edges detection.
what i try to do is: 1- separate each frame. 2- send each frame or group of frames to one core (i.e. frame1-frame20 to core 1, frame21-frame40 to core 2, ... and so on). 3- do our job like edge detection on these submitted frames. 4- resend the result from cores and reconstruction the video.
this what i try to do but have to monitor my cores if they are full, fail or not synchronize so could matlab do that or i have to use another tool to provide full cores control ?? by the way if you now any tool that provide what i explain please tell me :) thank you
I think the Parallel Computing Toolbox with parfor or spmd would do that.
i have to read it and then i will reply to you :) thank you so much

Sign in to comment.

Answer by Jason Ross
on 18 Apr 2013
Edited by Jason Ross
on 18 Apr 2013

MATLAB does not provide control at the core level. That behavior is passed off to the operating system to do with as it pleases.
What MATLAB does is let you have a collection of worker processes, which can be located on the same machine or on a cluster, and then provides a variety of methods to distribute work to those workers.
It sounds like the approach which might appeal most to you is the job/task workflow, where you can create a job (or series of jobs) that will execute in a certain order with certain sub-tasks that need to be executed in a certain manner. You might find within these tasks that other parallel language contstructs like parfor or spmd provide the types of processing you are looking for.
I'd encourage you to read the documentation and review the examples for the Parallel Computing Toolbox, as you already have an outline of your algortithm and when you look at the various commands available, you will likely determine which ones map most closely to the parts of your algorithm and assemble your program from there.
In terms of monitoring your cores, the various commands will return errors and handle the work distribution, and montior the job status, which are the job of the scheduler you are using. The "local" scheduler uses the cores on your local machine, but it's also possible to use compute clusters in the same manner, with little or no modifications to the code that works on "local".
What this means is that it's possible that you don't (and shouldn't) worry about how the frames are split up for processing. You could, for example, do that processing using parfor, and the work will be distributed to the workers by the scheduler. This will mean that your code will be identical on a 4 core machine or a 128 node cluster since you don't really care about the specifics of processing and hand that off to the scheduler to take care of, then move onto the next step in processing.

  1 Comment

thank you so much

Sign in to comment.