parallel computing with scheduler Comsol-Matlab
조회 수: 11 (최근 30일)
이전 댓글 표시
[EDIT: 20110524 02:40 CDT - reformat, clarify - WDR]
I've made a function JSC.m which I am able to call like this:
JSC('TE',1001,500E-9,70E-9,30E-9)
- and it works fine, I get the output I want.
Now this is pretty time consuming which is why I want to evaluate it in parallel for different inputs using the cluster available to me. So I've made this code:
sched = findResource('scheduler','type','local');
job1 = createJob(sched);
createTask(job1, @JSC, 1, {{'TE',1001,500E-9,70E-9,30E-9} {'TE',1001,500E-9,70E-9,40E-9} {'TE',1001,500E-9,70E-9,50E-9} {'TE',1001,500E-9,70E-9,60E-9}});
submit(job1);
waitForState(job1,'finished');
results = getAllOutputArguments(job1)
But it just returns results = Empty cell array: 4-by-0 Now this job scheduling works fine for rand.m for example:
sched = findResource('scheduler','type','local');
job1 = createJob(sched);
createTask(job1, @rand, 1, {{3,3} {3,3} {3,3} {3,3}});
submit(job1);
waitForState(job1,'finished');
results = getAllOutputArguments(job1);
results{1:4}
returns 4 3-by-3 matrices.
The only difference between rand.m and my JSC.m as I see it, is that it is linked with Comsol, so there is some Comsol code inside it. But why is it able to evaluate it with a normal function call, but not when I use a cluster?
I can post the code for JSC.m if necessary.
댓글 수: 4
Edric Ellis
2011년 5월 24일
Using the "local" scheduler, the workers are running the same installation of MATLAB as your desktop copy. Do have to perform any initialisation to get Comsol to work? You may need to replicate that on the workers. You could add initialisation to "jobStartup" - see http://www.mathworks.com/help/toolbox/distcomp/jobstartup.html
답변 (3개)
Sarah Wait Zaranek
2011년 5월 24일
COMSOL helped me with a similar issue about a year ago. Their answer is below. I would encourage you to contact them. They were very helpful.
"There is a command available for the livelink for MATLAB that allow the user to connect MATLAB with a COSMOL server. The command name is MPHSTART and it is available with the hotfix patch available for version 4.0a : http://www.comsol.com/support/updates/comsol40ap/
Note that if the user is using MATLAB in Distributed Computing Server and call COMSOL function on different node of the server, a COMSOL server will need to be started on each node."
댓글 수: 2
Sarah Wait Zaranek
2011년 5월 25일
I don't know, unfortunately. support@comsol.com might be able to help.
Peng Jia
2011년 9월 1일
Hi Erik,
I'm pulling my hair off my head now because of the same issue as yours. Have you solved this headache? I'm using 3.5a too and can not do dist. cmp. with Matlab. If you have already solved this problem please let me know. And could you share your JSC.m? I'm a stanger to COMSOL, so I'd like to learn from you guys. Thanks.
Best.
Peng
참고 항목
카테고리
Help Center 및 File Exchange에서 MATLAB Parallel Server에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!