Skip to content

Fixing Custom Objective Function for Unsteady Adjoint #2587

Open
ErcanUmut60 wants to merge 19 commits intosu2code:developfrom
ErcanUmut60:fix_unsteady_adjoint_custom_objfunc
Open

Fixing Custom Objective Function for Unsteady Adjoint #2587
ErcanUmut60 wants to merge 19 commits intosu2code:developfrom
ErcanUmut60:fix_unsteady_adjoint_custom_objfunc

Conversation

@ErcanUmut60
Copy link

@ErcanUmut60 ErcanUmut60 commented Oct 10, 2025

Defining Custom Objective Function does not work with shape_optimization.py. historyMap.py is updated in order to fix the problem.

  • I am submitting my contribution to the develop branch.
  • My contribution generates no new compiler warnings (try with --warnlevel=3 when using meson).
  • My contribution is commented and consistent with SU2 style (https://su2code.github.io/docs_v7/Style-Guide/).
  • I used the pre-commit hook to prevent dirty commits and used pre-commit run --all to format old commits.
  • I have added a test case that demonstrates my contribution, if necessary.
  • I have updated appropriate documentation (Tutorials, Docs Page, config_template.cpp), if necessary.

@ErcanUmut60 ErcanUmut60 changed the base branch from master to develop October 10, 2025 10:23
Copy link
Member

@pcarruscag pcarruscag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is generated via a script, we need to fix or update that script, otherwise the next time someone uses it it will break the custom objective again.

@ErcanUmut60
Copy link
Author

This file is generated via a script, we need to fix or update that script, otherwise the next time someone uses it it will break the custom objective again.

Okay I will look into it but do you mean it is generated during build/install? When I look into source code the file is inside /SU2_PY/SU2/io.

@bigfooted
Copy link
Contributor

bigfooted commented Oct 10, 2025

check SU2_PY/updateHistoryMap.py

@ErcanUmut60
Copy link
Author

I did some changes in the python file so it can read custom obj. func. from the CFlowOutput.cpp.
I am not sure I did the right changes but it works this way. If I didn't, I can try to fix the remaining with some guidance.
Otherwise, I don't mind if you take it from here.

removing json from import.
@bigfooted
Copy link
Contributor

If you run the python script updatehistorymap.py, does it generate the correct, updated, historymap?

@ErcanUmut60
Copy link
Author

If you run the python script updatehistorymap.py, does it generate the correct, updated, historymap?

Yes, I tried with Tutorials. There is no problem.

@bigfooted
Copy link
Contributor

@ErcanUmut60 If you (and the checks) are ready, you can 'squash and merge'.

@ErcanUmut60
Copy link
Author

@ErcanUmut60 If you (and the checks) are ready, you can 'squash and merge'.

I don't see an option for merging the PR. I thought only maintainers were able to do that.

@bigfooted
Copy link
Contributor

@pcarruscag we merge this PR or not?

@pcarruscag
Copy link
Member

Some tests are failing, I was not able to figure out why.

@Ovocode05
Copy link

Hey @pcarruscag and @bigfooted,

I was looking into why this PR has been stuck since January and traced the ReverseOMP failure back to a transient network error during the git submodule clone .

Verified Locally Today

Test Command Result
Eigen URL works git clone https://gitlab.com/libeigen/eigen.git Exit: 0
Pinned commit exists git checkout d71c30... Exit: 0
Eigen/Core present ls Eigen/Core Exit: 0

Note: local test was on a research HPC node

Conclusion

The January failure looks like a dropped connection mid-clone to me. The folder was left empty, which made it surface as a compilation error.

PR #2746 this week showed the identical pattern — same code, CI failed 5 consecutive times then passed on retry — suggesting CI intermittently drops GitLab submodule clones.

The code here was approved by @pcarruscag in October 2025. If it seems reasonable, would a maintainer be open to re-running the ReverseOMP check?

@pcarruscag
Copy link
Member

Sure, that was not the issue, the workflows are running.

@bigfooted
Copy link
Contributor

Quite sure I've seen this issue before:

  File "/github/workspace/install/bin/SU2/eval/functions.py", line 124, in function
    func_out = state["FUNCTIONS"]["COMBO"]
KeyError: 'COMBO'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants