Skip to content

Conversation

@bknueven
Copy link
Collaborator

@bknueven bknueven commented May 7, 2025

No description provided.

@bknueven bknueven force-pushed the relaxed_PH_spoke branch 2 times, most recently from 75add33 to cc45e24 Compare May 7, 2025 19:45
@bknueven bknueven force-pushed the relaxed_PH_spoke branch from cc45e24 to 4e1cf1f Compare May 7, 2025 19:46
@bknueven bknueven requested review from DLWoodruff and Copilot May 9, 2025 14:55
Copy link
Contributor

Copilot AI left a 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

@bknueven bknueven requested a review from Copilot May 9, 2025 18:55
Copy link
Contributor

Copilot AI left a 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
Copy link

Copilot AI May 9, 2025

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.

Suggested change
continue
time.sleep(0.01) # Reduce CPU usage during busy-wait

Copilot uses AI. Check for mistakes.
@bknueven bknueven marked this pull request as ready for review May 9, 2025 21:23
@bknueven bknueven enabled auto-merge May 16, 2025 17:44
@bknueven bknueven merged commit eb2bdfc into Pyomo:main May 16, 2025
19 checks passed
@bknueven bknueven deleted the relaxed_PH_spoke branch May 16, 2025 21:20
bknueven added a commit that referenced this pull request Dec 3, 2025
This reverts commit eb2bdfc, reversing
changes made to 8262292.
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.

2 participants