User Tools

Site Tools


cluster:96

This is an old revision of the document!



Home

Matlab 2010b

So, now that 2010b is the version of Matlab and we're using Lava scheduler we need to integrate the two.

In the examples below the code waits for the results. Don't do that when submitting jobs, it is just for debug purposes. Change the last 3 lines with this 'get(sched)' and then you exit Matlab interactive session.

This old way still works:

% distributed matlab jobs
% start 'matlab -nodisplay', issue the command 'newSimple'

% set up the scheduler and matlab worker environment
sched = findResource('scheduler', 'type', 'generic');
set(sched, 'HasSharedFilesystem', true);
set(sched, 'ClusterMatlabRoot', '/share/apps/matlab/2010b')
set(sched, 'SubmitFcn', @distributedSubmitFcn)   

% specify location for worker output
set(sched, 'DataLocation', '/home/hmeij/hp/matlab')

% create job and assign tasks to be done
j = createJob(sched);
T = createTask(j, @rand, 1, {{3,3} {3,3} {3,3} {3,3} {3,3}});

% submit job, wait for jobs to finish, fetch output
submit(j)
% WARNING: this may hang if the workers are busy!
waitForState(j)
results = getAllOutputArguments(j);
results{1:5}


Home

cluster/96.1297281209.txt.gz · Last modified: 2011/02/09 14:53 by hmeij