MATLAB: Am I getting warning messages when submitting a BATCH job to a cluster running MATLAB Distributed Computing Server 5.0 (R2010b)

MATLAB Parallel Server

When I execute the following commands:
job = batch('myScript','CaptureDiary',true);
waitForState(job)
diary(job)
destroy(job)
where 'myscript' is
for i = 1:10
disp('Hello!')
pause(0.1)
end
I receive the following warning messages
Warning: Unable to change to requested folder: /home/user/test.
Current folder is: /gpfs/home/user.
Reason: Cannot CD to /home/user/test (Name is nonexistent or not a
directory).
> In executeFunction at 26
In distcomp/private/dctEvaluateFunction>iEvaluateWithNoErrors at 23
In distcomp/private/dctEvaluateFunction at 7
In distcomp/private/dctEvaluateTask>iEvaluateTask/nEvaluateTask at 264
In distcomp/private/dctEvaluateTask>iEvaluateTask at 136
In distcomp/private/dctEvaluateTask at 60
In distcomp_evaluate_filetask>iDoTask at 97
In distcomp_evaluate_filetask at 39

Best Answer

This warning occurs because prior to evaluating the script, BATCH tries to change the worker's working directory to the same directory as the submitting MATLAB.
When the worker is on a different machine than the client, and the file system is not shared between the client and worker, this is not possible, and MATLAB gives the warning messages.
To work around this issue set 'CurrentDirectory' parameter in BATCH to '.', as follows:
job = batch('myScript','CaptureDiary',true, 'CurrentDirectory', '.');
waitForState(job)
diary(job)
destroy(job)
With 'CurrentDirectory' parameter set to '.' the BATCH command will not attempt to change the working directory on the worker.