MatLab: get username in Parallel Computing -


i'm using matlab parallel computing toolbox on several computers in office: i've enstabilished cluster managed custom scheduler (the matlab's own kind: mjs).

everything seems run smoothly long run scripts , functions have same path on every pc (e.g. c:\sample.m), unfortunately need access functions in dropbox folder of every computer (for example file c:\users\myusername\dropbox\sample.m).

to solve problem, tried this:

parfor j=1:100    myusername=getenv('username');    cd(['c:\users\',myusername,'\dropbox'])    sample(1,2,3); end     

but code cd function set current folder in c:\users\system\dropbox , can't find sample.m in it.

has way around problem?

you have several options here. first, compute username outside parfor loop

myusername = getenv('username'); parfor ...     ...     cd(['c:\users\', myusername, '\dropbox']);     ... end 

if you're running more recent version of matlab, there automatic dependency analysis should transfer functions need workers when required - version using? can use listautoattachedfiles see files have been attached pool.

finally, if mjs administrator run @ security level 3, workers run credentials, , getenv('username') behave expect on workers.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -