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

Parallelized triangulated meshes in DVGeometryMulti #224

Merged
merged 17 commits into from
Oct 25, 2023

Conversation

sseraj
Copy link
Collaborator

@sseraj sseraj commented Oct 2, 2023

Purpose

This PR parallelizes the triangulated meshes in DVGeometryMulti by splitting up the mesh points per processor and embedding a subset of the points on each processor. All triangulated mesh points are still stored on all processors because they are needed for pySurf operations. However, the parallelized embedding vastly improves memory usage during derivative computation for large cases and speeds up the embedding step.

I also fixed a minor parallelization bug when using excludeSurfaces. I ran into this while writing a parallelized version of the DVGeometryMulti test, so I included the fix in this PR.

Expected time until merged

2-3 weeks

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

I parallelized the main DVGeometryMulti test and parameterized the test to run on 1 and 3 processors. The coordinates and derivatives match between the serial and parallel cases. The reference file changed because I switched from par_add_val to root_add_val, but the values are identical.

In addition, to test performance on a realistic case, I ran the DLR-F6 adjoint computation and recorded the memory usage for the DVGeo.totalSensitivity call. The memory usage scales much better with the parallelized triangulated meshes:

image

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

@sseraj sseraj requested review from hajdik and anilyil October 2, 2023 18:44
@sseraj sseraj requested a review from a team as a code owner October 2, 2023 18:44
@codecov
Copy link

codecov bot commented Oct 2, 2023

Codecov Report

Merging #224 (be63b71) into main (d6e2d9c) will increase coverage by 0.24%.
The diff coverage is 97.50%.

@@            Coverage Diff             @@
##             main     #224      +/-   ##
==========================================
+ Coverage   64.78%   65.02%   +0.24%     
==========================================
  Files          47       47              
  Lines       12073    12106      +33     
==========================================
+ Hits         7821     7872      +51     
+ Misses       4252     4234      -18     
Files Coverage Δ
pygeo/parameterization/DVGeoMulti.py 92.82% <97.50%> (+1.57%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@anilyil anilyil left a comment

Choose a reason for hiding this comment

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

great stuff

Copy link
Contributor

@hajdik hajdik left a comment

Choose a reason for hiding this comment

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

Very nice

@hajdik hajdik merged commit 957bbea into mdolab:main Oct 25, 2023
11 checks passed
@sseraj sseraj deleted the parallel-trisurf branch October 2, 2024 21:06
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