Skip to content

Commit

Permalink
Deprecate warnings for loose bundles (#473)
Browse files Browse the repository at this point in the history
* getting ready to deprecate loose bundles

* give deprecation warning in config help text

* forgot a closing quote
  • Loading branch information
DLWoodruff authored Dec 29, 2024
1 parent c3d31d5 commit b1e968c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions doc/src/properbundles.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ scenarios. We will refer to these as `loose bundles`. This bundling scheme
is very flexible with respect to the numbers of scenarios in each bundle.
There are various if-blocks in the mpisppy code to support this type of bundle.

.. Warning::
In relase 1.0, loose bundles scheduled to be deprecated.

In 2024, `proper bundles` were supported. After the extensive form
for a proper bundle is created, the original scenarios are more or less
forgotten and all processing takes place for the bundle. At the time
Expand Down
6 changes: 6 additions & 0 deletions mpisppy/spbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,15 @@ def __init__(
raise RuntimeError("More ranks than scenarios")

self._calculate_scenario_ranks()
# Put the deprecation message in the init so they should only see it once per rank
if "bundles_per_rank" in self.options and self.options["bundles_per_rank"] > 0:
self._assign_bundles()
self.bundling = True
print("WARNING: The bundles-per-rank is now called `loose bundling' and\n"
"loose bundling will be deprecated in the next release\n."
"You should switch to the use of 'proper bundles'.\n"
" See the documentation and also misppy.generic_cylinders.py"
)
else:
self.bundling = False
self._create_scenarios(scenario_creator_kwargs)
Expand Down
2 changes: 1 addition & 1 deletion mpisppy/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def popular_args(self):
default=None)

self.add_to_config("bundles_per_rank",
description="Loose bundles per rank (default 0 (no bundles))",
description="Loose bundles per rank (default 0 (no bundles)) WILL BE DEPRECATED",
domain=int,
default=0)

Expand Down

0 comments on commit b1e968c

Please sign in to comment.