MATLAB: Do I receive an error “Error encountered while adding AttachedFiles to MATLAB path” after submitting a job to the cluster

MATLAB Parallel ServerParallel Computing Toolbox

Why do I receive this error after submitting a job to my cluster?
Error encountered while adding AttachedFiles to MATLAB path

Best Answer

This error occurs when submitting a MATLAB Parallel Server job (parpool or batch) and there is insufficient space in the temporary directory. By default, any attached files will be copied over to /tmp on each compute node that is part of the job.
To workaround this issue, specify a different temporary directory via the TMP and TMPDIR environment variable. This environment variable can be placed into the communicatingSubmitFcn, independentSubmitFcn or into the $MATLAB/bin/worker script
NOTE: Starting in R2019a the following name changes occurred:
  • MATLAB Distributed Computing Server was renamed to MATLAB Parallel Server
  • mdce_def was renamed to mjs_def
  • mdce binary was renamed to mjs