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

Write failed solution when restart_failed_analysis is False #343

Merged
merged 4 commits into from
Mar 7, 2024

Conversation

eytanadler
Copy link
Contributor

Purpose

In the MPhys wrapper, there is an option to try clean restarting an analysis that stalls/fails to converge. In those cases, the failed solution is written so the user can try to figure out what went wrong. However, no failed solution is written when restart_failed_analysis is False (this is the default), making diagnosis challenging. This PR changes it so a solution is written in this case.

Expected time until merged

A few days

Type of change

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (non-backwards-compatible fix or feature)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Documentation update
  • Maintenance update
  • Other (please describe)

Testing

Run an MPhys ADflow case where the restart_failed_analysis option in the ADflowBuilder is set to False and set the max number of ADflow iterations to a very small number so it fails to converge. Before this PR, you will see no failed analysis solution written. With the PR, you will.

Checklist

  • I have run flake8 and black to make sure the Python code adheres to PEP-8 and is consistently formatted
  • I have formatted the Fortran code with fprettify or C/C++ code with clang-format as applicable
  • I have run unit and regression tests which pass locally with my changes
  • I have added new tests that prove my fix is effective or that my feature works
  • I have added necessary documentation

@eytanadler eytanadler requested a review from a team as a code owner February 15, 2024 15:17
Copy link

codecov bot commented Feb 15, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 41.47%. Comparing base (de01140) to head (83121a7).

Files Patch % Lines
adflow/mphys/mphys_adflow.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #343      +/-   ##
==========================================
- Coverage   41.49%   41.47%   -0.03%     
==========================================
  Files          13       13              
  Lines        4066     4068       +2     
==========================================
  Hits         1687     1687              
- Misses       2379     2381       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

anilyil
anilyil previously approved these changes Feb 25, 2024
@anilyil anilyil requested review from lamkina and removed request for marcomangano February 25, 2024 19:37
…mdolab#345)

* New option for digits in solution filename numbering

* Fixed incorrect option name

* Specified solution digits for failed mesh too
Copy link
Contributor

@lamkina lamkina left a comment

Choose a reason for hiding this comment

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

This is consistent with how we write solutions for the other failed cases so it's good with me.

@anilyil anilyil merged commit 5a8c177 into mdolab:main Mar 7, 2024
16 of 17 checks passed
@eytanadler eytanadler deleted the write_failed_solution branch March 7, 2024 16:48
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.

3 participants