surrogateopt: Dot indexing is not supported for variables of this type.

4 visualizaciones (últimos 30 días)
I am trying to use the function surrogateopt in a script that I submit to a computer cluster. I don't want to plot the solver progress. To illustrate the problem that I have, I will use the toy code "Minimization_test.m":
minobj=@(xj)(xj+2).^2;
lbe= [-20];
ube= [20];
opts = optimoptions(@surrogateopt,'PlotFcn',[],'MaxFunctionEvaluations',600);
xj = surrogateopt(minobj,lbe,ube,[],opts)
This script works correctly on my computer (matlab 2020a) and on the cluster (matlab 2020a) if create an interactive matlab session.
However, I get an error if I request that the job scheduling program SLURM execute the script. My SLURM script reads:
#!/bin/bash
#SBATCH -t 1:00:00
#SBATCH --mem=1g
#SBATCH -J matlab
#SBATCH -o slurm.out
module load Matlab/R2020a
matlab -nojvm -nodisplay -singleCompThread -r Minimization_test
If I submit this job, I get the following error in the output file:
Dot indexing is not supported for variables of this type.
Error in globaloptim.bmo.solver
Error in globaloptim.bmo.createSolver
Error in globaloptim.bmo.BlackboxModelOptimizer (line 92)
self =
globaloptim.bmo.createSolver(self,expensive,lb,ub,intcon,options);
Error in surrogateopt>createController (line 329)
controller =
globaloptim.bmo.BlackboxModelOptimizer(expensive,lb,ub,intcon,options);
Error in surrogateopt (line 292)
controller = createController(objconstr,lb,ub,intcon,options);
Error in Minimization_test (line 5)
xj = surrogateopt(minobj,lbe,ube,[],opts)
  9 comentarios
Farhad Omidvar
Farhad Omidvar el 22 de Sept. de 2020
Thanks, Walter, for the suggestions.
Before seeing them, I submitted the job for running on MATLAB/2020a (insteaad of the 2018b version) and the problem magically got fixed.

Iniciar sesión para comentar.

Respuesta aceptada

Walter Roberson
Walter Roberson el 22 de Sept. de 2020
Removing the -nojvm solves the problem (for reasons currently unknown.)
  1 comentario
Daniel Rischawy
Daniel Rischawy el 27 de Oct. de 2020
Unfortunately I have the same problem. But I get the error if I run surrogates with parallel computing normally in Matlab2019a. The error appears random after around 200-300 iterations. Sample tasks for surrogates, however, did not cause any problems. Therefore I think it should have something to do with my objective function or parallel computing, but I do not understand the cause and why the error occurs so randomly. Could the reason be the Java version I use or the Matlab version? Thanks a lot in advance.
Regards

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Cluster Configuration en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by