Skip to content
Advertisement

Getting a disk I/O error when running an optimization with OpenMDAO

I’m getting this error when running an optimtization inside a local respository using the ScipyOptimizeDriver and recording the result file. It worked flawlessly, however all of a sudden, I got this error:

  File "C:UsersxxxAnaconda3envsxxxlibsite-packagesopenmdaorecorderssqlite_recorder.py", line 234, in _initialize_database
    c.execute("CREATE TABLE global_iterations(id INTEGER PRIMARY KEY, "
sqlite3.OperationalError: disk I/O error

I didn’t change anything to my code, hence I don’t know where it came from. I also can find any solution online. Here, a generalized version of my code.

import openmdao.api as om

prob = om.Problem()

indep_var_comp = om.IndepVarComp()
indep_var_comp.add_output(...)
prob.model.add_subsystem("prob_vars", indep_var_comp, promotes=["*"])

prob.model.connect(...)

prob.driver = om.ScipyOptimizeDriver()

prob.driver.options["tol"] = 1e-6
prob.driver.options["optimizer"] = 'SLSQP'
prob.driver.recording_options["includes"] = ["*"]

rec_data_file = 'opt_output.db'
rec = om.SqliteRecorder(rec_data_file)
prob.driver.add_recorder(rec)
prob.add_recorder(rec)

prob.model.add_objective(....)
prob.model.add_design_var(...)
prob.model.add_constraint(...)

prob.setup()
prob.run_driver()

Advertisement

Answer

Id suggest you post this as a bug report to the OpenMDAO issue tracker. since it seems like a potentially a bug, and likely you’d need to give details about OpenMDAO version, python version, etc.

Broadly this kind of sql error implies that something “bad” happened to the database file. Maybe the operating system locked it for some reason, or the file system got messed up.

Are you running on a local machine? or on a “magic” file system on some kind of HPC cluster. If you’re using a parallel file system on a cluster, then the sql-lite recorder is probably going to be grumpy in general (those file systems are REALLY not designed for that kind of disk i/o).

Ultimately, we just need more information to give you a more complete answer and this is probably best reported as a bug with some more details about your environment.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement