Particleswarm connection to parallel workers

조회 수: 1 (최근 30일)
ss_19
ss_19 2023년 9월 5일
댓글: Sam Marshalik 2023년 9월 6일
When 'UseParallel' is set to true for particleswarm optimization, it seems that the optimizer needs to be 'Connected to parallel workers' quickly enough by obtaining a value for the objective function for each worker or particle. Otherwise I've been getting the error:
Error Caused by:
Error using fcnvectorizer
Function to evaluate must be represented as a string scalar, character vector, or function_handle object.
Failure in user-supplied fitness function evaluation. GA cannot continue.)
Is there a way to increase that time for all parallel workers to be connected for objective functions that take a long time to evaluate?
  댓글 수: 1
Sam Marshalik
Sam Marshalik 2023년 9월 6일
@ss_19, When the optimization is run in parallel there is some data transfer that needs to occur to send data from the MATLAB client to the parallel process workers. I have not seen a scenario where that data transfer has caused failures like this.
Can you include the code you are running to generate this error?
Does this error occur when you run it in serial? If there is an issue with the transfer component, you can try using parpool("Threads", NumWorkers) to start thread based workers, which should not need to transfer any data between the MATLAB client and the workers.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Optimization Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by