-
Notifications
You must be signed in to change notification settings - Fork 45
Relaxed PH spoke #513
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
Relaxed PH spoke #513
Conversation
75add33 to
cc45e24
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces extended support for relaxed PH methods by adding new configuration options, hubs, spokes, and extensions. Key changes include:
- New configuration methods (ph_nonant_args, relaxed_ph_fixer_args, relaxed_ph_args) and updated default values.
- Addition of PHNonantHub and RelaxedPHSpoke along with corresponding extension functions.
- Updates in generic cylinders and various cylinder modules to integrate the relaxed PH functionality.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| mpisppy/utils/config.py | New config methods and updated fixer tolerance default. |
| mpisppy/utils/cfg_vanilla.py | Added ph_nonant_hub, add_relaxed_ph_fixer, and relaxed_ph_spoke functions. |
| mpisppy/generic_cylinders.py | Updated to invoke new relaxed PH and nonant configuration functions. |
| mpisppy/extensions/relaxed_ph_fixer.py | New extension implementation for relaxed PH fixer. |
| mpisppy/cylinders/spwindow.py | New Field RELAXED_NONANT added along with updated field mappings. |
| mpisppy/cylinders/hub.py | Introduced PHNonantHub and updated send_ws behavior. |
| mpisppy/cylinders/fwph_spoke.py | Removed redundant convergence functions. |
| mpisppy/cylinders/relaxed_ph_spoke.py | New implementation for relaxed PH spoke functionality. |
Comments suppressed due to low confidence (2)
mpisppy/utils/config.py:481
- The fixer tolerance default was changed from 1e-2 to 1e-4; please confirm that this stricter tolerance is intended and update related documentation or tests if necessary.
default=1e-4
mpisppy/cylinders/spwindow.py:23
- [nitpick] Verify that the new Field.RELAXED_NONANT value does not conflict with existing fields, and ensure its mapping to local_nonant_length is consistent across all components using this field.
RELAXED_NONANT=3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces enhancements to support “relaxed PH” functionality and nonant‐only hubs. It adds new configuration methods (ph_nonant_args, relaxed_ph_fixer_args, relaxed_ph_args) in the config, defines corresponding functions (ph_nonant_hub, add_relaxed_ph_fixer, relaxed_ph_spoke) in cfg_vanilla, incorporates a new relaxed PH fixer extension and cylinder (RelaxedPHSpoke), updates the spwindow and hub modules to support the new fields and hub class, and revises documentation accordingly.
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| mpisppy/utils/config.py | Added new configuration methods for relaxed PH and nonant settings. |
| mpisppy/utils/cfg_vanilla.py | Introduced ph_nonant_hub, add_relaxed_ph_fixer, and relaxed_ph_spoke functions to accommodate new relaxed PH logic. |
| mpisppy/generic_cylinders.py | Updated to call the new configuration methods. |
| mpisppy/extensions/relaxed_ph_fixer.py | New extension for relaxed PH fixer functionality. |
| mpisppy/cylinders/spwindow.py | Added a new Field (RELAXED_NONANT) and mapped field lengths accordingly. |
| mpisppy/cylinders/spoke.py | Added is_converged alias method to support a unified convergence interface. |
| mpisppy/cylinders/relaxed_ph_spoke.py | New cylinder implementation for relaxed PH spoke. |
| mpisppy/cylinders/hub.py | Refactored PHHub into PHNonantHub (for nonants only) and defined a subclassed PHHub that augments nonant functionality. |
| mpisppy/cylinders/fwph_spoke.py | Removed the redundant is_converged method. |
| doc/src/spokes.rst, hubs.rst, extensions.rst | Updated documentation to reflect the new relaxed PH options and hub types. |
Comments suppressed due to low confidence (1)
mpisppy/utils/cfg_vanilla.py:761
- Ensure that multiplying max_iterations by 1,000,000 for PHIterLimit is intentional and that this value will not lead to excessively long iteration limits if max_iterations is set high.
options["PHIterLimit"] = cfg.max_iterations * 1_000_000
| # wait for relaxed iter0: | ||
| if self.relaxed_nonant_buf.id() == 0: | ||
| while not self.opt.spcomm.get_receive_buffer(self.relaxed_nonant_buf, Field.RELAXED_NONANT, self.relaxed_ph_spoke_index): | ||
| continue |
Copilot
AI
May 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider introducing a brief sleep (e.g., using time.sleep(0.01)) or yielding in this busy-wait loop to reduce CPU load during waiting periods.
| continue | |
| time.sleep(0.01) # Reduce CPU usage during busy-wait |
No description provided.