Run two functions on two cores .. in a dual core processor..
10 ビュー (過去 30 日間)
古いコメントを表示
I want to run two functions on two cores of my dual core processor. The functions are independent of each other.Is it possible to do so? If not what other applications or softwares are there to do such parallel processing?
0 件のコメント
回答 (2 件)
Daniel Shub
2012 年 3 月 4 日
Yes, you can run two independent functions on independent cores. The easiest way is probably to start to sessions of MATLAB. See my answer here: http://www.mathworks.com/matlabcentral/answers/31056-run-two-functions-in-parallel
"... you could try running two MATLAB sessions. If you are on Windows you could use ActiveX to communication between the sessions. You might be able to stick everything in a parfor loop to handle the communications and the MATLAB sessions behind the scenes."
0 件のコメント
Jan
2012 年 3 月 4 日
This is a very general question.
- You can run two instances of Matlab in parallel.
- The Parallel Computing Toolbox allows to run different jobs on different cores inside one Matlab session.
- Different threads can be started in nearly every programming language. Under Windows the API allows spawning threads, under Linux pthreads is a reliable library.
9 件のコメント
Jan
2012 年 3 月 4 日
Do you have the program already? If so, in which programming language is it written? How long does it run?
It would be a waste of time, if you spend more time in the parallelization than will be saved finally.
Walter Roberson
2012 年 3 月 5 日
spmd code outline:
if labindex is 1, call function 1
else, call function 2
end
This is a single program, but the effect is completely different for the two parallel processes.
参考
カテゴリ
Help Center および File Exchange で Graphics Performance についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!