MATLAB Answers

Why does my MATLABPOOL fail to open after I modify an environment variable in Parallel Computing Toolbox R2011b?

3 views (last 30 days)
After I modify an environment variable in my MATLAB and then call MATLABPOOL OPEN, the MATLABPOOL fails to start and I receive the following error:
>> setenv('many_a', repmat('a', 1,8192));
>> matlabpool open local 4
Starting matlabpool using the 'local' configuration ...
ERROR: Error using matlabpool (line 136)
Failed to open matlabpool. (For information in addition to the
causing error, validate the configuration 'local' in the
Configurations Manager.)
Caused by:
Error using
distcomp.interactiveclient/pGetSockets>iThrowIfBadParallelJobStatus
(line 114)
The interactive parallel job finished without any messages.
>>
After looking in the job logs I notice that workers are exiting and reporting the following error:
ERROR: [0]MATLAB core dump: Exit on fatal error (no core) enabled.
[0]Environment variable MDCE_DECODE_FUNCTION ("parallel.cluster.generic.parallelDecodeFcn") does not
[0]represent a valid MATLAB function on the current matlab path

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 22 Jun 2021
Edited: MathWorks Support Team on 22 Jun 2021
This enhancement has been incorporated in Release 2012b (R2012b). For previous product releases, read below for any possible workarounds:
This error is caused by a limitation imposed by either the underlying operating system or the MPI implementation used by MATLAB.
The limit imposed by MPI is 8192 characters for the total length of the environment variables passed on to workers.
There are also Operating System limits which vary from the operating system to operating system:
To work around this issue consider one of the two alternatives:
1) Set the large environment variable in the system before launching MATLAB
2) If you must modify a large environment variable inside of MATLAB, then open the MATLABPOOL prior to modifying the environment and the execute one of the following:
pctRunOnAll('setenv('many_a', repmat('a', 1,8192))')
or
spmd
setenv('many_a', repmat('a', 1,8192));
end

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by