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

Find max value in parallel safely #953

Open
wants to merge 1 commit into
base: fenicsx
Choose a base branch
from

Conversation

jhdark
Copy link
Collaborator

@jhdark jhdark commented Feb 26, 2025

Proposed changes

fix for #900

use MPI to find max value

Types of changes

What types of changes does your code introduce to FESTIM?

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code refactoring
  • Documentation Update (if none of the other choices apply)
  • New tests

Checklist

  • Black formatted
  • Unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

Copy link

codecov bot commented Feb 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.02%. Comparing base (96d62ff) to head (828844c).

Additional details and impacted files
@@           Coverage Diff            @@
##           fenicsx     #953   +/-   ##
========================================
  Coverage    96.02%   96.02%           
========================================
  Files           45       45           
  Lines         2439     2441    +2     
========================================
+ Hits          2342     2344    +2     
  Misses          97       97           

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

@RemDelaporteMathurin RemDelaporteMathurin added the enhancement New feature or request label Feb 27, 2025
Copy link
Collaborator

@RemDelaporteMathurin RemDelaporteMathurin left a comment

Choose a reason for hiding this comment

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

I guess we'll need this for maxinum surface, minimum surface, and minimum volume too

Comment on lines +30 to +31
max_value = max(self.field.solution.x.array[indices])
MPI.COMM_WORLD.barrier()
Copy link
Collaborator

Choose a reason for hiding this comment

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

  1. I believe we still want to use numpy.max instead of native max here for performance purposes, no?
  2. what does barrier() do?

@RemDelaporteMathurin RemDelaporteMathurin added the fenicsx Issue that is related to the fenicsx support label Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fenicsx Issue that is related to the fenicsx support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants