<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264885</link>
    <title>MATLAB Central Newsreader - how to save data when using remote cluster</title>
    <description>Feed for thread: how to save data when using remote cluster</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Tue, 03 Nov 2009 22:18:03 -0500</pubDate>
      <title>how to save data when using remote cluster</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264885#691863</link>
      <author>chaosheng </author>
      <description>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.&lt;br&gt;
This is the script;&lt;br&gt;
&lt;br&gt;
clusterHost = '###.###.###.###';&lt;br&gt;
remoteDataLocation = '/home/Matlab';&lt;br&gt;
&lt;br&gt;
sched = findResource('scheduler', 'type', 'generic');&lt;br&gt;
&lt;br&gt;
set(sched, 'DataLocation', 'F:\Matlab');&lt;br&gt;
set(sched, 'ClusterMatlabRoot', '/share/apps/mtlb');&lt;br&gt;
set(sched, 'HasSharedFilesystem', false);&lt;br&gt;
set(sched, 'ClusterOsType', 'unix');&lt;br&gt;
set(sched, 'GetJobStateFcn', @sgeGetJobState);&lt;br&gt;
set(sched, 'DestroyJobFcn', @sgeDestroyJob);&lt;br&gt;
&lt;br&gt;
set(sched, 'SubmitFcn', {@sgeNonSharedSimpleSubmitFcn, clusterHost, remoteDataLocation});&lt;br&gt;
&lt;br&gt;
j = createJob(sched);&lt;br&gt;
set(j, 'FileDependencies', {'test.m'});&lt;br&gt;
t = createTask(j,@test,1);&lt;br&gt;
&lt;br&gt;
submit(j);&lt;br&gt;
&lt;br&gt;
waitForState(j, 'finished');&lt;br&gt;
results = getAllOutputArguments(j);&lt;br&gt;
celldisp(results)&lt;br&gt;
&lt;br&gt;
this is test.m which is in my working directory.&lt;br&gt;
&lt;br&gt;
function out = test&lt;br&gt;
x = 1;&lt;br&gt;
y = 2;&lt;br&gt;
save('testSaveData.mat','x','y')&lt;br&gt;
out = x+y;&lt;br&gt;
&lt;br&gt;
After I run the script I can get the results as results{1} =3. but I couldn't get the file of testSaveData.mat. &lt;br&gt;
&lt;br&gt;
Please help me how to save data. Thank you so much.</description>
    </item>
    <item>
      <pubDate>Wed, 04 Nov 2009 08:35:09 -0500</pubDate>
      <title>Re: how to save data when using remote cluster</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264885#691959</link>
      <author>Edric M Ellis</author>
      <description>&quot;chaosheng &quot; &amp;lt;csudeng@126.com&amp;gt; writes:&lt;br&gt;
&lt;br&gt;
&amp;gt; hey, I am trying to save data in a file when I run my job on a remote cluster,&lt;br&gt;
&amp;gt; but i don't know how to save.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; This is the script; [...]&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; this is test.m which is in my working directory.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; function out = test&lt;br&gt;
&amp;gt; x = 1;&lt;br&gt;
&amp;gt; y = 2;&lt;br&gt;
&amp;gt; save('testSaveData.mat','x','y')&lt;br&gt;
&amp;gt; out = x+y;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; After I run the script I can get the results as results{1} =3. but I couldn't&lt;br&gt;
&amp;gt; get the file of testSaveData.mat.&lt;br&gt;
&lt;br&gt;
That will save &quot;testSaveData.mat&quot; into the current directory of the workers,&lt;br&gt;
probably not what you want (since that may be a temporary directory&lt;br&gt;
somewhere). I would recommend putting in a full path to some location shared by&lt;br&gt;
the workers and the client, e.g.&lt;br&gt;
&lt;br&gt;
save( '/home/me/data/testSaveData.mat', 'x', 'y' );&lt;br&gt;
&lt;br&gt;
or similar.&lt;br&gt;
&lt;br&gt;
Cheers,&lt;br&gt;
&lt;br&gt;
Edric.</description>
    </item>
    <item>
      <pubDate>Wed, 04 Nov 2009 17:01:03 -0500</pubDate>
      <title>Re: how to save data when using remote cluster</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264885#692111</link>
      <author>chaosheng </author>
      <description>That's good. I fixed that problem. thank you!</description>
    </item>
  </channel>
</rss>

