Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Parallel computing toolbox

조회 수: 1 (최근 30일)
Aidy
Aidy 2011년 10월 18일
답변: Walter Roberson 2022년 6월 19일
Good day all,
I currently have an optimization algorithm implemented in Matlab. The time to arrive at a solution for this algorithm varies.
There is a speed variation since success of ending the optimization relies on randomly selecting a set of data which is hopefully reliable enough for a solution. So for example, my algorithm can end in little as 1 iterations or a maximum of 200 iterations ( i.e. ,a value which I set).
I have seen Matlab's Parallel computing toolbox but not sure if would apply to my situation.
I would like to know if it is possible to somehow run my algorithm in "parallel" jobs, such that, I can run the script multiple times and end the overall algorithm with the job that terminates first ?
Is anything like this or similarly possible with the parallel toolbox?
thanks any suggestions, Aiden
  댓글 수: 1
Walter Roberson
Walter Roberson 2011년 10월 18일
If your iterations are as independent as they sound to be, using PCT should work. Note, though, that to really be effective, each iteration must do "enough" work to balance out the cost of distributing the problem to the core or cpu.

답변 (2개)

Namnendra
Namnendra 2022년 6월 18일

Walter Roberson
Walter Roberson 2022년 6월 19일
If you parfeval() a series of processes, then you can wait for the first one to finish, and then cancel() the rest.
Note that if you try to submit more jobs than you have cores, then the operating system might not schedule the additional jobs until something finishes. Also, it is possible to configure the maximum simultaneous to be the number of hyperthreads instead of the number of cores, but if you are using compute-bound processes then threads are going to be starved for compute resources. Hyperthreads are best when you have some kind of I/O in the mix, as they can be more efficient about allowing computation while I/O is happening.

이 질문은 마감되었습니다.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by