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 for distributed jobs:

% 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}

This old way for parallel jobs does not, not sure why:

% start 'matlab -nodisplay', issue the command 'myPJob'

% set up the scheduler and matlab worker environment
%2007a sched = findResource('scheduler', 'configuration', 'generic')
%2007a set(sched, 'Configuration', 'generic')
sched = findResource('scheduler','type','LSF')
set(sched, 'SubmitArguments', '-R type==LINUX64')
set(sched, 'SubmitArguments', '-q matlab')

set(sched, 'HasSharedFilesystem', true);
set(sched, 'ClusterMatlabRoot', '/share/apps/matlab/2010b')
set(sched, 'SubmitFcn', @lsfParallelSubmitFcn)   

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

% create job and assign tasks to be done

set(pj, 'MaximumNumberOfWorkers', 4)
set(pj, 'MinimumNumberOfWorkers', 4)

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


% submit job, wait to finish, get status jobs, gather results
submit(pj)
get(sched)

% you can now exit matlab
% at system prompt type 'bjobs' 


Home

cluster/96.1297281358.txt.gz · Last modified: 2011/02/09 14:55 by hmeij