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

[WIP] Tape recording debug mode #2442

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from
Open

Conversation

oleburghardt
Copy link
Contributor

Proposed Changes

Add feature to record a tape for debug purposes (as a tool for AD / discrete adjoint / .. developers), using CoDiPack's codi::RealReverseTag.

This is a (cleaned-up) continuation of #2343.

Related Work

Supposed to help finding remaining errors in #2317.

PR Checklist

Put an X by all that apply. You can fill this out after submitting the PR. If you have any questions, don't hesitate to ask! We want to help. These are a guide for you to know what the reviewers will be looking for in your contribution.

  • 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.

@oleburghardt oleburghardt changed the title Tape/Recording debug mode [WIP] Debug tape recording mode Feb 11, 2025
@oleburghardt oleburghardt changed the title [WIP] Debug tape recording mode [WIP] Tape recording debug mode Feb 11, 2025
@@ -515,9 +536,9 @@
FORCEINLINE void SetPreaccIn(const T& data, const int size) {
if (PreaccActive) {
for (int i = 0; i < size; i++) {
if (IsIdentifierActive(data[i])) {
// if (IsIdentifierActive(data[i])) {

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
PreaccHelper.addInput(data[i]);
}
// }

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
@@ -527,9 +548,9 @@
if (!PreaccActive) return;
for (int i = 0; i < size_x; i++) {
for (int j = 0; j < size_y; j++) {
if (IsIdentifierActive(data[i][j])) {
// if (IsIdentifierActive(data[i][j])) {

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
PreaccHelper.addInput(data[i][j]);
}
// }

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
SetPreaccOut(moreData...);
}

template <class T>
FORCEINLINE void SetPreaccOut(T&& data, const int size) {
if (PreaccActive) {
for (int i = 0; i < size; i++) {
if (IsIdentifierActive(data[i])) {
// if (IsIdentifierActive(data[i])) {

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
PreaccHelper.addOutput(data[i]);
}
// }

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
@@ -567,9 +589,9 @@
if (!PreaccActive) return;
for (int i = 0; i < size_x; i++) {
for (int j = 0; j < size_y; j++) {
if (IsIdentifierActive(data[i][j])) {
// if (IsIdentifierActive(data[i][j])) {

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
PreaccHelper.addOutput(data[i][j]);
}
// }

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
cout << " Objective function : " << ObjFunc;
if (driver_config->GetWrt_AD_Statistics()){
cout << " (" << ObjFunc_Index << ")\n";
// cout << " (" << ObjFunc_Index << ")\n";

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
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 this pull request may close these issues.

1 participant