bbopt / NOMAD.jl

Julia interface to the NOMAD blackbox optimization software
Other
47 stars 6 forks source link

NOMAD exception #72

Open ufechner7 opened 7 months ago

ufechner7 commented 7 months ago

I get sometimes this exception:

NOMAD exception (report to developper):
NOMAD::Exception thrown (/workspace/srcdir/nomad/src/Param/PbParameters.cpp, 174) Invalid Parameter. Check: LOWER_BOUND is equal to UPPER_BOUND at index 2. Value =   0       
terminate called after throwing an instance of 'NOMAD_4_3::Exception'
  what():  NOMAD::Exception thrown (/workspace/srcdir/nomad/src/Algos/../Cache/CacheBase.hpp, 165) Cannot get instance. A non-virtual object derived from CacheBase must be instantiated first. For example, call CacheSet::setInstance() ONCE before calling CacheBase::getInstance()

If I restart Julia and try again it works. Any idea?

Additional finding: It seams to happen always if I did create a plot with PyPlot.jl BEFORE calling NOMAD.

salomonl commented 7 months ago

@ufechner7 Could I see the characteristics of your blackbox ? For example,

ufechner7 commented 7 months ago

@ufechner7 Could I see the characteristics of your blackbox ?

The blackbox is not multi-threaded (well, perhaps some BLAS operations are, but I am not using Julia multi-threading. I use modelling toolkit based simulations, but just a simple solver like:

sol  = solve(prob, Rodas5(), dt=dt, tstops=tstops, abstol=tol, dtmax=1, maxiters=Int64(1e6), reltol = tol, saveat=ts)

I did not fix any variable, just restarting Julia fixes the problem.

It reproducible fails after I executed:

plot(rand(3))

in the REPL (from PyPlot).

Error message:

NOMAD exception (report to developper):
NOMAD::Exception thrown (/workspace/srcdir/nomad/src/Param/PbParameters.cpp, 174) Invalid Parameter. Check: LOWER_BOUND is equal to UPPER_BOUND at index 0. Value =   0       
(x_best_feas = nothing, bbo_best_feas = nothing, x_best_inf = nothing, bbo_best_inf = nothing)

So this error message is misleading.

But it should be easy to reproduce, just add PyPlot to your project and run the command mentioned above. I would be glad about a workaround, like stopping the PyPlot event loop, or running NOMAD in a separate process...

salomonl commented 7 months ago

Could you provide me a simple test reproducing the problem ?

Maybe two other things to check (eventually for a workaround):