Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: how to save data when using remote cluster
Date: Tue, 3 Nov 2009 22:18:03 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 38
Message-ID: <hcqa6r$3mk$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1257286683 3796 172.30.248.35 (3 Nov 2009 22:18:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 3 Nov 2009 22:18:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2055202
Xref: news.mathworks.com comp.soft-sys.matlab:582193


hey, I am trying to save data in a file when I run my job on  a remote cluster, but i don't know how to save.
This is the script;

clusterHost = '###.###.###.###';
remoteDataLocation = '/home/Matlab';

sched = findResource('scheduler', 'type', 'generic');

set(sched, 'DataLocation', 'F:\Matlab');
set(sched, 'ClusterMatlabRoot', '/share/apps/mtlb');
set(sched, 'HasSharedFilesystem', false);
set(sched, 'ClusterOsType', 'unix');
set(sched, 'GetJobStateFcn', @sgeGetJobState);
set(sched, 'DestroyJobFcn', @sgeDestroyJob);

set(sched, 'SubmitFcn', {@sgeNonSharedSimpleSubmitFcn, clusterHost, remoteDataLocation});

j = createJob(sched);
set(j, 'FileDependencies', {'test.m'});
t = createTask(j,@test,1);

submit(j);

waitForState(j, 'finished');
results = getAllOutputArguments(j);
celldisp(results)

this is test.m which is in my working directory.

function out = test
x = 1;
y = 2;
save('testSaveData.mat','x','y')
out = x+y;

After I run the script I can get the results as results{1} =3. but I couldn't get the file of testSaveData.mat. 

Please help me how to save data. Thank you so much.