Comments (12)
I made some modifications in the code to break if two calls to CUTEstModel
are made. This does not fix the problem, but it is better than letting the user thinks the decoding was sucessful.
The commit is abelsiqueira/CUTEst.jl@6412f637, and testing was updated after that.
from cutest.jl.
Many thanks. I have to look into this more closely, but I'm tied up until Wednesday.
from cutest.jl.
The same behavior occurs with the Matlab interface, but issuing a clear all
before decoding the second problem resolves the issue, which makes me wonder if it's really a CUTEst issue. I've tried calling Julia's garbage collector before loading the second problem, but that didn't do it.
from cutest.jl.
I was thinking that this could be a problem with the global variables in CUTEst. Maybe the clear all
on matlab clear those too?
from cutest.jl.
Yes I believe it does. I don't see a way to clear them in Julia.
from cutest.jl.
Did your previous interface allow for two consecutive problems?
from cutest.jl.
Yes I believe it does. I don't see a way to clear them in Julia.
Maybe accessing each one directly through this?
But I don't think that is a good idea, because it seems like something that CUTEst should handle on its own.
Did your previous interface allow for two consecutive problems?
No, I had the exact same problem.
from cutest.jl.
Returning to this discussion, removing @eval
did not fix the problem. I'm still investigating though.
I also tried to make something in C to investigate what is happening.
I found out that the problem isn't at the decoding, or at the .f created. In that example, I decode two problems before linking to the executable. Then I rename the SIF files (ELFUN, EXTER, etc.) so that both remain in the folder. Then I link each SIF file to a main.c
. This main.c
calls opens each problem and print x0
and f(x0)
, one at a time. Each executable prints the correct output for their linked correspondent, but not for the other. In addition the wrong function value corresponds to the one in CUTEst.jl
. This, at least, shows that the problem is not decoding twice, or reopening the OUTSDIF.d
file, so it must be internal.
from cutest.jl.
Hey, turns out that (at least now that we open the library with dlopen
), that closing it on terminate made this almost work. This build made this change, and fixed some calls in julia_interface
that break in this specific scenario.
However, this is still not fully operational. The OSX build does not work (can't test why), and also the specialized interface test breaks on the second call. Don't know why yet. The segmentation fault that happens is on the dlclose
call, but it doesn't happens (necessarily) outside the runtests.jl
script.
For now, on linux, checkout the fix/double_decode
branch and do
nlp = CUTEstModel("HS32")
cfn(nlp, nlp.meta.x0)
cutest_finalize(nlp)
nlp = CUTEstModel("HS4")
ufn(nlp, nlp.meta.x0)
cutest_finalize(nlp)
from cutest.jl.
Made it work on C. In this example I decode two problems and load their libraries at the same time. I had to create elfun_
and group_
using a global pointer to the "active" library. This successfully enabled the use of two libraries simultaneously.
Also, I had to use the dl*
functions, so maybe I'm on the right direction.
from cutest.jl.
Hey, just made a PR regarding this problem.
The solution I found is not the best, but it works, and is well tested.
Essentially, I removed the possibility of having two problems open at the same time, which allows the use of a global variable for the shared library.
I tried making it work with two problems at the same time, as my comment above suggests, but eventually it broke randomly again.
However, I think that this is as good as would be expected of a CUTEst interface. The usual user would normally open one file at a time (I think), and the three interfaces are working.
from cutest.jl.
Fixed
from cutest.jl.
Related Issues (20)
- ERROR: ArgumentError: NULL library handle HOT 15
- Issue with -lSystem HOT 3
- `jac_coord!` memory allocation HOT 2
- Try syntax `CUTEstModel("...") do nlp` to allow automatic closing of nlp
- Check eval counters against those from CUTEst
- Unit test fails for HS14
- Improve `lin_cons` computation
- Use `increment!` and `decrement!` functions HOT 3
- change license to MIT?
- Mislcassified problems HOT 4
- Remove allocations in CUTEst.jl HOT 2
- Fix the documentation
- gfortran error HOT 10
- KeyError: key "MASTSIF" not found HOT 7
- How to specify the size of the test problem? HOT 2
- NLPModels computes gradient with elements out of order HOT 9
- jth_hess_coord! seems not implemented HOT 2
- CUTEst.jl and AutoDiff -- compute high-order derivatives HOT 10
- Function "NONCVXUN" HOT 5
- Make the package loadable in Windows even though it is not usable HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cutest.jl.