parallel compute but can't use load to read data

1 次查看(过去 30 天)
I succeeded using two computers to parallel.I tested ,it work. But when I use 'load' command in the task function , it didn't work. I checked the task's error message,say unable to read file ,no such file or directory. But I am sure the path is correct.Because I executed it in command windows. By the way,the path is on a network drive.
How can I let the two machines find the correct path?
thank you!

回答(2 个)

Jason Ross
Jason Ross 2011-9-15
It's likely that the user context on the remote system is different and doesn't know what t:\ is. If you execute
[status,result] = system('net use');
in your parallel code, the "result" will have the drive mappings that are known under the user contest the process is using. I'm betting that t:\ doesn't show up there.
Try using the UNC path instead, as it should be accessible without having to go through setting up drive letters.
  2 个评论
buaa
buaa 2011-9-16
I used
[status,result] = system('net use');
in my parallel code,the 'result' is empty list. Why?
Are the any different between parallel program and common code?
Thank you!
Jason Ross
Jason Ross 2011-9-16
The difference is in that the MATLAB worker is running under a different user context (most likely LocalSystem). Different user contexts in Windows don't share drive letters, so therefore T:\ doesn't make any sense for that process.
Were you able to access the data using UNC? You can try using a "dir" command in the same manner to see if you can get a directory listing.
You could also try running these commands interactively in pmode. I find it a good way to debug issues like this. Just type "pmode open <configname>" at the prompt and you'll be connected to the workers in an interactive fashion.

请先登录,再进行评论。


Jan
Jan 2011-9-15
You can insert an "exist(FileName, 'file')" in the code to check this again. But the error message is actually exhaustive enough: MATLAB is sure, that the path is not correct. There are certainly good reasons for this fact.
Check if the network drive is mapped to the same drive letter, UNC path or whatever. Think of spaces in the definition of the path - sometimes these spaces are overseen (see http://www.mathworks.com/matlabcentral/answers/15876-addpath-question). Post the relevant code to get a more specific assistence.
  3 个评论
buaa
buaa 2011-9-15
Sorry,
function fa=pfft2d()
fa=exist('T:\test\project_20110902\test2\RawImage_test_99_107_115\PreProImage\
PreImage_00001.mat','file');
end
Jan
Jan 2011-9-15
Try "set(Job,'PathDependencies',{'T:\'});" with a trailing file separator. 'T:' is the current path on the T drive, while 'T:\' is the root folder on this drive. Is the network drive mounted correctly and does the user have read permissions in the subfolder? Try "exist('T:\', 'dir')" and "exist('T:\test\project_20110902\test2\RawImage_test_99_107_115\", 'dir')".

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 File Operations 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by