|
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.
|