Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.
Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.
Matlab Comsol function evaluated in parallel on cluster
Posted 21 mag 2011, 06:24 GMT-4 RF & Microwave Engineering, Interfacing, LiveLink for MATLAB Version 4.1 1 Reply
Please login with a confirmed email address before reporting spam
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 comsuming 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.
JSC('TE',1001,500E-9,70E-9,30E-9)
- and it works fine, I get the output I want.
Now this is pretty time comsuming 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.
1 Reply Last Post 21 mag 2011, 10:48 GMT-4