Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug when running MACH-Aero tutorial with SLSQP #96

Closed
1064168551 opened this issue Jun 8, 2023 · 9 comments · Fixed by #98
Closed

Bug when running MACH-Aero tutorial with SLSQP #96

1064168551 opened this issue Jun 8, 2023 · 9 comments · Fixed by #98

Comments

@1064168551
Copy link

1064168551 commented Jun 8, 2023

Description

There is a bug when running MACH-Aero tutorial using docker named mdolab/public:u20-gcc-ompi-stable, I would be very grateful if you could help me.
The bug is

'ValueError: failed to initialize intent(inout) array -- expected elsize=8 but got 16 -- input 'D' not compatible to 'd'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/home/mdolabuser/mount/opt/aero/aero_opt.py", line 245, in <module>
    sol = opt(optProb, MP.sens, storeHistory=os.path.join(args.output, "opt.hst"))
  File "/home/mdolabuser/.pyenv/versions/3.9.16/lib/python3.9/site-packages/pyoptsparse/pySLSQP/pySLSQP.py", line 218, in __call__
    slsqp.slsqp(m, meq, la, n, xs, blx, bux, ff, gg, df, dg, acc, maxit,
ValueError: failed in converting 5th argument `x' of slsqp.slsqp to C/Fortran array'

Steps to reproduce issue

Current behavior

Expected behavior

Code versions

  • Operating System:
  • Python:
  • OpenMPI:
  • CGNS:
  • PETSc:
  • Compiler:
  • This repository:
@1064168551
Copy link
Author

image

@1064168551
Copy link
Author

The figure of the bug was listed, I would be really grateful if you can help me.

@eirikurj
Copy link
Contributor

eirikurj commented Jun 8, 2023

Thanks for the issue. For completeness, please update and populate the remaining issue sections, i.e., Steps to reproduce issue with minimal steps etc.

However, I can confirm that the tutorial is broken when running SLSQP. This is due to a recent change in pyOptSparse (see PR mdolab/pyoptsparse#348 for details). We will look into this, but the fundamental problem is that pyGeo DVs are allocated as complex.

In the meantime to circumvent the issue, you can checkout the previous version of pyOptSparse into a separate branch, e.g., git checkout -b v2.10.0 v2.10.0.

@1064168551
Copy link
Author

Sincerely thanks for your answer and kindness, SLSQP seems OK when I used pyOptSparse 2.10.0.

@A-CGray
Copy link
Member

A-CGray commented Jul 31, 2023

For future reference, the solution here is to fix the handling of real and complex values in pyGeo

@r-quadros
Copy link

@eirikurj : I am running the optimization in docker and facing the same challenge. I am trying to revert back to a previous version of pyOptSparse still the error remains. Here is where I am reverting back in the "repos" folder in the container as seen in the "git status":
mdolabuser@bf5736a488a8:/repos/pyoptsparse$ git status
On branch v2.10.0
nothing to commit, working tree clean
mdolabuser@bf5736a488a8:
/repos/pyoptsparse$

and when I try to run the optimization, I get the same error. Is there something I am missing here? I am sorry, I am new to docker and probably I am reverting to a previous branch in a wrong folder.

@A-CGray
Copy link
Member

A-CGray commented Aug 4, 2023

Did you pip install pyoptsparse again after checking out the older release?

@r-quadros
Copy link

@A-CGray : That helped immensely! Opt. running now. Many thanks.

@marcomangano marcomangano reopened this Sep 29, 2023
@ewu63 ewu63 changed the title Bug when running MACH-Aero tutorial using docker. Bug when running MACH-Aero tutorial with SLSQP Jan 8, 2024
@ewu63 ewu63 pinned this issue Jan 8, 2024
@sseraj sseraj closed this as completed in #98 Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants
@A-CGray @eirikurj @marcomangano @1064168551 @r-quadros and others