multi core full control
1 次查看(过去 30 天)
显示 更早的评论
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
4 个评论
回答(2 个)
Sean de Wolski
2013-4-18
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?
3 个评论
Sean de Wolski
2013-4-18
I think the Parallel Computing Toolbox with parfor or spmd would do that.
Jason Ross
2013-4-18
编辑:Jason Ross
2013-4-18
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.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!