Closed hongkai-dai closed 6 years ago
I changed the code using f2c
, such that the workspace is not set manually, and the results are still different. From the print out file, the only difference in the setup is the "Unbounded objective".
f2c_out.txt
snopt_cwrap_out.txt
I will close this issue and open another one to accurately summarize the problem
Just a follow up on this.
The workspace sizes are hardcoded to 500 (here and here). snMem*
is called automatically to determine the appropriate amount of workspace in the C/C++ interfaces.
You could always not use the C/C++ interface and instead directly call the iso_c_binding
subroutines in snopt_wrapper.f90. It would give you more control over the workspace. I wrote the interface with only "one-off" solves in mind, so it's may not the best choice for certain applications.
Got it, thanks! Now I do not set the workspace, but just let C/C++ interfaces to figure out the workspace by itself.
I recently switched from using the
f2c
interface tosnopt_cwrap.h
, and the solution to the problem is different. I checked the print out files, and it looks that the only big difference in the problem setting is on the size of the integer/real workspace. Attached are the print out files. Inf2c_out.txt
f2c_out.txt, it prints out the workspace on top of the file as, while on
snopt_cwrap_out.txt
snopt_cwrap_out.txt, it does not print out the workspace.I am wondering how I can set the workspace size in
snopt_cwrap.h
. I tried two ways.reallocI
andreallocR
.setIntParameter(problem, "Total integer workspace", 500000l)
andsetIntParameter(problem, "Total real workspace", 500000l)
.In both cases, the solution to the problem using
snopt_cwrap.h
remains different fromf2c
(the solutions to these two cases are the same), andsnopt_cwrap_out [snopt_cwrap_out.txt](https://github.com/snopt/snopt-interface/files/2178347/snopt_cwrap_out.txt)
still does not print out the size of the workspace.