smdogroup / paropt Goto Github PK
View Code? Open in Web Editor NEWInterior-point and trust region optimizer for large-scale distributed design problems
License: Other
Interior-point and trust region optimizer for large-scale distributed design problems
License: Other
As explained in #5, recent changes in ParOpt broke the regression test suite for pyOptSparse, which has actually happened previously due to similar problems (#4). I think due to the fact that ParOpt is still in active development with constantly changing API/functionality, it's important to have periodic releases with the code properly version tagged. That way, pyOptSparse can pin a stable release both for testing, and for users to install from, knowing that it has been tested to work with a given version of pyOptSparse. This is currently done for all other external optimizers (i.e. those not shipped with pyOptSparse).
Until ParOpt provides version tagging, I'm afraid we will have to drop ParOpt support within pyOptSparse. The wrapper will remain intact within the package, but we will no longer test ParOpt since build and regression test issues will cause our regression tests to fail, and pyOptSparse should not be testing the ParOpt build process anyhow.
Hi, I've written my custom ParOpt.Problem class:
class MyProb(ParOpt.Problem):
def __init__(self, *args):
# something ...
# ...
....
def writeOutput(self, iter, x):
print(iter) # This is an example
as described in the document:
virtual void writeOutput(int iter, ParOptVec *x)ΒΆ
Implement this function if you'd like to print out something with the same frequency as the output files
But I cannot see anything on my terminal. I think my writeOutput
method in MyProb
does not work.
How can I monitor the optimization process in my own way?
hi,
My lab wanna work through your paper paropt. So first thank you for your paper and your contribution. In order to figure out the process of getting the final result, to figure out how paropt works, we think debug the program step by step may works. And now I see there no build program availble. So I am trying to creat a new project, add the source code in my project to debug step by step. I am using VisualGDB, the cross platform software. When debuging the program, mistakes always occur. And I am still a learner on the way, some problems are beyond my abality to fix it. So I am here to ask for help about the way or solution to build and debug paropt. And I wanna know the way you program paropt, using what software, under what situation. My mailbox is [email protected]. If there is a pdf introducing how to build paropt would be great.
Thanks a ton!
I had an issue with the build of ParOpt. I could compile everything and it worked until i tried to import ParOpt. Here is the error:
python3 -c "from paropt import ParOpt":
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: /root/git/paropt/lib/libparopt.so: undefined symbol: gk_jbufs
I could solve it by building the library together with libGKlib.a
. But as far as i see it there is nothing saying so. I would add something in Makefile.in
to configure the paths and then also add the library at build.
Hi,
I'm trying to compile ParOpt under pyenv with Python 3.10-dev. The compilation via make
of the C-part is working fine. But when I run:
python3 setup.py install
I get:
Warning: passing language='c++' to cythonize() is deprecated. Instead, put "# distutils: language=c++" in your .pyx or .pxd file(s)
Compiling paropt/ParOpt.pyx because it changed.
Compiling paropt/ParOptEig.pyx because it changed.
[1/2] Cythonizing paropt/ParOpt.pyx
/.pyenv/versions/3.10-dev/lib/python3.10/site-packages/Cython/Compiler/Main.py:381: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /optimizer/py/paropt/paropt/ParOpt.pxd
tree = Parsing.p_module(s, pxd, full_module_name)
Error compiling Cython file:
------------------------------------------------------------
...
# Import the string library
from libcpp.string cimport string
# Import the declarations required from the pxd file
from ParOpt cimport *
^
------------------------------------------------------------
paropt/ParOpt.pyx:16:0: 'ParOpt.pxd' not found
Error compiling Cython file:
------------------------------------------------------------
...
ndarray = np.PyArray_SimpleNewFromData(size, shape,
nptype, data_ptr)
if base is not None:
Py_INCREF(base)
ndarray.base = <PyObject*>base
^
------------------------------------------------------------
paropt/ParOpt.pyx:377:15: Assignment to a read-only property
Error compiling Cython file:
------------------------------------------------------------
...
cdef MPI_Comm c_comm = comm.ob_mpi
if nineq < 0:
nineq = ncon
self.me = new CyParOptProblem(c_comm, nvars, ncon, nineq, nwcon, nwblock)
self.me.setSelfPointer(<void*>self)
self.me.setGetVarsAndBounds(_getvarsandbounds)
^
------------------------------------------------------------
paropt/ParOpt.pyx:750:36: Cannot assign type 'void (void *, int, ParOptVec *, ParOptVec *, ParOptVec *) except *' to 'getvarsandbounds'
Error compiling Cython file:
------------------------------------------------------------
...
if nineq < 0:
nineq = ncon
self.me = new CyParOptProblem(c_comm, nvars, ncon, nineq, nwcon, nwblock)
self.me.setSelfPointer(<void*>self)
self.me.setGetVarsAndBounds(_getvarsandbounds)
self.me.setEvalObjCon(_evalobjcon)
^
------------------------------------------------------------
paropt/ParOpt.pyx:751:30: Cannot assign type 'int (void *, int, int, ParOptVec *, ParOptScalar *, ParOptScalar *) except? -1' to 'evalobjcon'
Error compiling Cython file:
------------------------------------------------------------
...
nineq = ncon
self.me = new CyParOptProblem(c_comm, nvars, ncon, nineq, nwcon, nwblock)
self.me.setSelfPointer(<void*>self)
self.me.setGetVarsAndBounds(_getvarsandbounds)
self.me.setEvalObjCon(_evalobjcon)
self.me.setEvalObjConGradient(_evalobjcongradient)
^
------------------------------------------------------------
paropt/ParOpt.pyx:752:38: Cannot assign type 'int (void *, int, int, ParOptVec *, ParOptVec *, ParOptVec **) except? -1' to 'evalobjcongradient'
Error compiling Cython file:
------------------------------------------------------------
...
self.me = new CyParOptProblem(c_comm, nvars, ncon, nineq, nwcon, nwblock)
self.me.setSelfPointer(<void*>self)
self.me.setGetVarsAndBounds(_getvarsandbounds)
self.me.setEvalObjCon(_evalobjcon)
self.me.setEvalObjConGradient(_evalobjcongradient)
self.me.setEvalHvecProduct(_evalhvecproduct)
^
------------------------------------------------------------
paropt/ParOpt.pyx:753:35: Cannot assign type 'int (void *, int, int, int, ParOptVec *, ParOptScalar *, ParOptVec *, ParOptVec *, ParOptVec *) except? -1' to 'evalhvecproduct'
Error compiling Cython file:
------------------------------------------------------------
...
self.me.setSelfPointer(<void*>self)
self.me.setGetVarsAndBounds(_getvarsandbounds)
self.me.setEvalObjCon(_evalobjcon)
self.me.setEvalObjConGradient(_evalobjcongradient)
self.me.setEvalHvecProduct(_evalhvecproduct)
self.me.setEvalHessianDiag(_evalhessiandiag)
^
------------------------------------------------------------
paropt/ParOpt.pyx:754:35: Cannot assign type 'int (void *, int, int, int, ParOptVec *, ParOptScalar *, ParOptVec *, ParOptVec *) except? -1' to 'evalhessiandiag'
Error compiling Cython file:
------------------------------------------------------------
...
self.me.setGetVarsAndBounds(_getvarsandbounds)
self.me.setEvalObjCon(_evalobjcon)
self.me.setEvalObjConGradient(_evalobjcongradient)
self.me.setEvalHvecProduct(_evalhvecproduct)
self.me.setEvalHessianDiag(_evalhessiandiag)
self.me.setComputeQuasiNewtonUpdateCorrection(_computequasinewtonupdatecorrection)
^
------------------------------------------------------------
paropt/ParOpt.pyx:755:54: Cannot assign type 'void (void *, int, int, ParOptVec *, ParOptScalar *, ParOptVec *, ParOptVec *, ParOptVec *) except *' to 'computequasinewtonupdatecorrection'
Error compiling Cython file:
------------------------------------------------------------
...
self.me.setEvalObjCon(_evalobjcon)
self.me.setEvalObjConGradient(_evalobjcongradient)
self.me.setEvalHvecProduct(_evalhvecproduct)
self.me.setEvalHessianDiag(_evalhessiandiag)
self.me.setComputeQuasiNewtonUpdateCorrection(_computequasinewtonupdatecorrection)
self.me.setEvalSparseCon(_evalsparsecon)
^
------------------------------------------------------------
paropt/ParOpt.pyx:756:33: Cannot assign type 'void (void *, int, int, ParOptVec *, ParOptVec *) except *' to 'evalsparsecon'
Error compiling Cython file:
------------------------------------------------------------
...
self.me.setEvalObjConGradient(_evalobjcongradient)
self.me.setEvalHvecProduct(_evalhvecproduct)
self.me.setEvalHessianDiag(_evalhessiandiag)
self.me.setComputeQuasiNewtonUpdateCorrection(_computequasinewtonupdatecorrection)
self.me.setEvalSparseCon(_evalsparsecon)
self.me.setAddSparseJacobian(_addsparsejacobian)
^
------------------------------------------------------------
paropt/ParOpt.pyx:757:37: Cannot assign type 'void (void *, int, int, ParOptScalar, ParOptVec *, ParOptVec *, ParOptVec *) except *' to 'addsparsejacobian'
Error compiling Cython file:
------------------------------------------------------------
...
self.me.setEvalHvecProduct(_evalhvecproduct)
self.me.setEvalHessianDiag(_evalhessiandiag)
self.me.setComputeQuasiNewtonUpdateCorrection(_computequasinewtonupdatecorrection)
self.me.setEvalSparseCon(_evalsparsecon)
self.me.setAddSparseJacobian(_addsparsejacobian)
self.me.setAddSparseJacobianTranspose(_addsparsejacobiantranspose)
^
------------------------------------------------------------
paropt/ParOpt.pyx:758:46: Cannot assign type 'void (void *, int, int, ParOptScalar, ParOptVec *, ParOptVec *, ParOptVec *) except *' to 'addsparsejacobiantranspose'
Error compiling Cython file:
------------------------------------------------------------
...
self.me.setEvalHessianDiag(_evalhessiandiag)
self.me.setComputeQuasiNewtonUpdateCorrection(_computequasinewtonupdatecorrection)
self.me.setEvalSparseCon(_evalsparsecon)
self.me.setAddSparseJacobian(_addsparsejacobian)
self.me.setAddSparseJacobianTranspose(_addsparsejacobiantranspose)
self.me.setAddSparseInnerProduct(_addsparseinnerproduct)
^
------------------------------------------------------------
paropt/ParOpt.pyx:759:41: Cannot assign type 'void (void *, int, int, int, ParOptScalar, ParOptVec *, ParOptVec *, ParOptScalar *) except *' to 'addsparseinnerproduct'
Traceback (most recent call last):
File "/optimizer/py/paropt/setup.py", line 122, in <module>
ext_modules=cythonize(exts, language="c++", include_path=inc_dirs),
File "/.pyenv/versions/3.10-dev/lib/python3.10/site-packages/Cython/Build/Dependencies.py", line 1134, in cythonize
cythonize_one(*args)
File "/.pyenv/versions/3.10-dev/lib/python3.10/site-packages/Cython/Build/Dependencies.py", line 1301, in cythonize_one
raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: paropt/ParOpt.pyx
Any idea, how I can resolve this?
Thanks!
So far I have only managed to build .libs on the windows platform no .dlls. When it comes to building the python interface, I am quite out of depth as to what to modify since it only has entries for linux and MacOS...@gjkennedy any idea where to start?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.