cplex error in parallel run

2 visualizaciones (últimos 30 días)
Maziar Salahi
Maziar Salahi el 18 de Feb. de 2022
Respondida: TARUN el 12 de Jun. de 2025

I use cplex in parallel in matlab to solve some quadratic problems and get sometimes the following error.
An UndefinedFunction error was thrown on the workers for 'Undefined
function 'handleparams' for input arguments of type 'double'.'.
This might be because the file containing 'Undefined function
'handleparams' for input arguments of type 'double'.' is not
accessible on the workers. Use addAttachedFiles(pool, files) to
specify the required files to be attached. See the documentation
for 'parallel.Pool/addAttachedFiles' for more details.

Error in test_qcqp_rank1 (line 181)
OPTIM_new=One_Negative_Eig_new(2*Q,a,App,bpp,xlb,xub);

Caused by:
Error using cplexqcp
Undefined function 'handleparams' for input arguments of type
'double'.

Respuestas (1)

TARUN
TARUN el 12 de Jun. de 2025
The error you're encountering (Undefined function handleparams for input arguments of type double) means that the MATLAB function handleparams.mis not available to the parallel workers when your code runs.
This usually happens in parallel computing because the workers run in their own space and don't automatically have access to all your local files. So, if your code uses a custom function like handleparams, you need to manually send that file to the workers.
To fix it, you can use this command before executing your parallel job:
addAttachedFiles(gcp, {'handleparams.m'});
This tells MATLAB to send the file to all the workers. Just make sure the file handleparams.m is in your current folder or somewhere on the MATLAB path.
Feel free to go through the following documentation:
Parallel Pool File Attachments:
gcp:

Categorías

Más información sobre MATLAB Mobile Fundamentals en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by