cplex error in parallel run

2 vues (au cours des 30 derniers jours)
Maziar Salahi
Maziar Salahi le 18 Fév 2022
Réponse apportée : TARUN le 12 Juin 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'.

Réponses (1)

TARUN
TARUN le 12 Juin 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:

Catégories

En savoir plus sur MATLAB Mobile Fundamentals dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by