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

[WIP] Proper multistage bundles #474

Open
wants to merge 223 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
223 commits
Select commit Hold shift + click to select a range
f943763
add some notes about agnostic
DLWoodruff Dec 19, 2022
7ac63b3
minor edits to txt file
DLWoodruff Jan 7, 2023
62ff84e
Merge branch 'main' into agnostic
DLWoodruff Aug 23, 2023
191027d
just getting started; more questions than answers
DLWoodruff Aug 24, 2023
6ef0c0b
[WIP] scenario creator for agnostic object is roughed in but totally …
DLWoodruff Aug 25, 2023
43fe36c
starting to make agnostic work
DLWoodruff Aug 25, 2023
537e3ba
scenario creation executes
DLWoodruff Aug 25, 2023
4423e00
starting to modify phbase for agnostic
DLWoodruff Aug 26, 2023
ea5f306
a bash script to be deleted later
DLWoodruff Aug 26, 2023
3fcf43d
WIP; early work on ph callback; starting attach to obj
DLWoodruff Aug 26, 2023
159d6e3
WIP; still working on attach_PH_to_objective (need xbars)
DLWoodruff Aug 26, 2023
1dd7c46
ready to start work on solve_one
DLWoodruff Aug 27, 2023
bfca106
starting on solve_one
DLWoodruff Aug 27, 2023
1d4b156
solve_one executes; need to debug _reenable_W
DLWoodruff Aug 27, 2023
440156b
PH is executing; need to write a solution and start working on spokes
DLWoodruff Aug 27, 2023
8c0e510
move the example to the examples dir
DLWoodruff Aug 27, 2023
06754dc
ready to try xhatter
DLWoodruff Aug 27, 2023
c24c3be
xhatshuffle seems to be working
DLWoodruff Aug 27, 2023
6492b8f
WIP: debugging W's in lagrangian
DLWoodruff Aug 27, 2023
23e41c1
debugging output
DLWoodruff Aug 28, 2023
64efddb
the ampl version of farmer (stochastic)
DLWoodruff Aug 28, 2023
1ebdba4
single scenario farmer works
DLWoodruff Aug 29, 2023
3b88743
examples of amplpy from AMPL
DLWoodruff Aug 30, 2023
26bd8bf
lshaped did not yet have the uniform probabiity option
DLWoodruff Aug 30, 2023
370fba9
draft of ampl create scenario written
DLWoodruff Aug 30, 2023
c94cccc
[WIP] almost done with draft of AMPL agnostic; one copy function left
DLWoodruff Aug 30, 2023
2ae66d7
w_ and prox_ disabled do not need a callout
DLWoodruff Aug 31, 2023
c4ea3c4
farmer_ampl_agnostic.py is sort of done, but totally untested
DLWoodruff Aug 31, 2023
c1d8c7e
[WIP] working on solving
DLWoodruff Aug 31, 2023
a7ec164
solve executes; now we need actual scenarios
DLWoodruff Sep 1, 2023
0f2f17e
The ampl guest module seems to be working
DLWoodruff Sep 2, 2023
e715e1a
reoranize files
DLWoodruff Sep 4, 2023
fb7f4c3
try to create a simple test
DLWoodruff Sep 4, 2023
76d41ad
have the ampl farmer in the test dir for now; a few months from now, …
DLWoodruff Sep 4, 2023
a076f12
decent tests added; the ampl example does not yet copy W values corre…
DLWoodruff Sep 4, 2023
b612e45
attach a better obj; but still doesn't seem to work right
DLWoodruff Sep 5, 2023
8878ab8
correct errors in objective function for PH
DLWoodruff Sep 5, 2023
e396e0a
drop a debugging print statement
DLWoodruff Sep 5, 2023
5efca81
not cool, but we have farmer.mod in two places
DLWoodruff Sep 7, 2023
1bf1e0b
ampl is almost working with PH, but is returning the wrong the object…
DLWoodruff Sep 7, 2023
d408982
giving up on getting data processing related to objs in the hub to ma…
DLWoodruff Sep 7, 2023
0450a6f
during merge from main, deal with bundling and persistent solvers; co…
DLWoodruff Sep 11, 2023
3b3472c
merge from main
DLWoodruff Nov 16, 2023
5cbd94e
finish merge
DLWoodruff Nov 16, 2023
acf8119
single scenario farmer for GAMS
DLWoodruff Nov 16, 2023
cd5f701
adding basic GAMS example
bknueven Nov 16, 2023
2424686
no gamspy
bknueven Nov 16, 2023
d7f9aea
some installation instructions for AMPL
DLWoodruff Nov 16, 2023
68620aa
update asl instructions
DLWoodruff Nov 16, 2023
a9bad1c
with padding
bknueven Nov 16, 2023
250850a
better GAMS installation instructions
bknueven Nov 16, 2023
211a866
adding seemingly working modifications
bknueven Nov 17, 2023
51af113
modifying records
bknueven Nov 17, 2023
ca40b86
really working
bknueven Nov 17, 2023
4b31cc7
quasi-working gams
bknueven Nov 17, 2023
741b674
adding farmer_gams_agnostic
bknueven Nov 17, 2023
7b068cd
now giving a rho a value in ampl and gams guests
DLWoodruff Nov 27, 2023
82a2a4b
[WIP] working on copying xbars and rho (ampl and gams are just pasted…
DLWoodruff Nov 27, 2023
aa03985
Merge branch 'main' into agnostic
DLWoodruff Nov 29, 2023
96f6a4f
[WIP] adding rho and xbar to the things that need to come from the ho…
DLWoodruff Nov 29, 2023
a591c3d
[WIP] Pyomo as a guest seems to be getting xbar, W, and rho; AMPL exe…
DLWoodruff Dec 12, 2023
bccc513
[WIP] AMPL does not match Pyomo at iter 2 (after iter 1)
DLWoodruff Dec 13, 2023
2cf5a66
GAMS now tries to copy W xbar and rho before solve; gams executes, bu…
DLWoodruff Dec 14, 2023
d64336e
GAMS is at a roadblock: non-determinstic trouble loading the solution…
DLWoodruff Dec 16, 2023
f51678f
AMPL now matches Pyomo
DLWoodruff Dec 16, 2023
1baa4d5
Linearized prox term for gams farmer
DLWoodruff Dec 28, 2023
032ed2c
at least the iter zero solves do not fail!
DLWoodruff Dec 28, 2023
aceac81
cleanup and comments for ampl
DLWoodruff Dec 28, 2023
0f3a777
The last commit message was misleading: some levels are somehow bad e…
DLWoodruff Dec 29, 2023
de715b4
added sync_db to debug code; ready to make it work for mpisppy
DLWoodruff Dec 29, 2023
fcd6e28
Now iter 0 really works, but iter 1 solves fail (with linearized prox…
DLWoodruff Dec 30, 2023
879d885
farmer_linear_augmented.py and farmer_line_augmented.gms show the bad…
DLWoodruff Dec 31, 2023
4230b31
gams linear is working with PH; bounds are not working yet; not sure …
DLWoodruff Dec 31, 2023
1c04d6b
gams linearized seems to work for hub and one other cylinder, but not…
DLWoodruff Dec 31, 2023
bdc863c
update notes
DLWoodruff Jan 3, 2024
bbb4b85
add serial PH example
bknueven Mar 29, 2024
3cfcda9
barely starting work on general agnostic with pyomo as guest
DLWoodruff Apr 26, 2024
7e071be
[WIP] working on pyomo.py for agnostic
DLWoodruff Apr 26, 2024
aa6fd8a
[WIP] done with my first pass at the general Pyomo; ready to develop …
DLWoodruff Apr 29, 2024
de71dec
[WIP] working on agnostic general cylinders; --help executes
DLWoodruff May 1, 2024
37d253b
move agnostic.py from utils to agnostic
DLWoodruff May 1, 2024
8bf335b
[WIP] about to support a class instead of a module in agnostic.py
DLWoodruff May 1, 2024
7d09b5a
update example
DLWoodruff May 1, 2024
179a844
[WIP] able to execute object creation
DLWoodruff May 1, 2024
75706e6
ready to test pyomo as guest
DLWoodruff Jun 5, 2024
8a34323
agnostic for general pyomo as guest seems to execute
DLWoodruff Jun 5, 2024
4678ebc
Just getting started with generic AMPL
DLWoodruff Jun 6, 2024
dde7e96
a rough version of generic ampl needs a lot of work to make it go
DLWoodruff Jun 6, 2024
3c7d974
ampl is starting to run, but still needs work
DLWoodruff Jun 7, 2024
601ab69
Just started working on callbacks for generic AMPL
DLWoodruff Jun 7, 2024
bfad1dc
ready to work on attach PH
DLWoodruff Jun 8, 2024
9747e0c
generic, agnostic farmer is starting to run, but solve_one still need…
DLWoodruff Jun 10, 2024
a161c7a
generic, agnostic ampl seems to be working at least for a hub; have n…
DLWoodruff Jun 10, 2024
ae2c4fb
set go.bash to run pyomo for now
DLWoodruff Jun 10, 2024
e217d37
add a little agnostic doc
DLWoodruff Jun 10, 2024
e656377
deal with merge conflicts
DLWoodruff Jun 10, 2024
fce36a9
trying to use a new pyotracker badge
DLWoodruff Jun 12, 2024
d58990b
Merge pull request #1 from DLWoodruff/badgerepair
DLWoodruff Jun 12, 2024
731c280
a little more agnostic doc; fix bug in ampl guest
DLWoodruff Jun 14, 2024
54310d2
typos
AymericPCLegros Jun 14, 2024
0a69744
WIP, doesn't work yet, trying to geeralize step by step the farmer ex…
AymericPCLegros Jun 25, 2024
460ce38
WIP easier to test things, but name not adapted
AymericPCLegros Jun 25, 2024
a6b3c12
Merge branch 'Pyomo:main' into main
DLWoodruff Jun 29, 2024
4567d99
we don't need or want the callouts in the thin wrapper
DLWoodruff Jul 10, 2024
5f90ae1
remove 'area' paste error; give an error with empty nonants list
DLWoodruff Jul 11, 2024
66d4244
Merge commit 'refs/pull/402/head' of https://github.com/Pyomo/mpi-spp…
AymericPCLegros Jul 11, 2024
3e46869
[WIP] GAMS does not work, but the doc is modified
AymericPCLegros Jul 12, 2024
ca54a68
completing the doc
AymericPCLegros Jul 12, 2024
a5e6d6d
Merge branch 'agnostic' into agnostic_local
AymericPCLegros Jul 12, 2024
154ff09
Merge pull request #2 from AymericPCLegros/agnostic_local
DLWoodruff Jul 12, 2024
0f5135e
created a bundle example for farmer called by go.bash
DLWoodruff Jul 15, 2024
405a329
[WIP] bundles not yet working due, presumably, to objective function …
DLWoodruff Jul 15, 2024
30a4b40
[WIP] making progress, but still need to get the names right
DLWoodruff Jul 15, 2024
ae539d4
[WIP] things seem to be working apart from the xhatter
DLWoodruff Jul 15, 2024
602a24c
The generic Pyomo farmer example seems to be working with proper bundles
DLWoodruff Jul 15, 2024
1512aec
edit the archicture png directly
DLWoodruff Jul 15, 2024
92e981b
fix warning message
DLWoodruff Jul 15, 2024
3cfd82b
trying to add the quadratic progamming nothing works yet
AymericPCLegros Jul 16, 2024
5769ad1
adding the powerpoint to modify the image
AymericPCLegros Jul 16, 2024
25d0793
Merge pull request #4 from AymericPCLegros/agnostic_local
DLWoodruff Jul 16, 2024
b23617f
cleaning the file, gams for specific linearized farmer seem to work
AymericPCLegros Jul 16, 2024
b9ac52c
implemented farmer problem in gurobipy
keeks05 Jul 16, 2024
2701329
added scenario creator
keeks05 Jul 16, 2024
2031248
implemented solve_one for gurobipy
keeks05 Jul 17, 2024
8874867
[WIP] The Best Bound print is not correct
AymericPCLegros Jul 19, 2024
a08c87b
[WIP] restauring the good values of prox_on...
AymericPCLegros Jul 22, 2024
6751cd9
adding print statements
AymericPCLegros Jul 22, 2024
f45a077
the incumbent is not absurd anymore, but does not get better
AymericPCLegros Jul 23, 2024
c1de5c6
gams farmer seems to work!
AymericPCLegros Jul 24, 2024
ee87cdf
deleting prints
AymericPCLegros Jul 24, 2024
a2c5cb9
Merge branch 'main' into agnostic
DLWoodruff Jul 25, 2024
406ebfd
Merge branch 'main' into agnostic
DLWoodruff Jul 25, 2024
9cc57c6
pip install -e . for testagnsotic.yml
DLWoodruff Jul 26, 2024
d3151ba
update test for agnostic.py now in agnostic, not utils
DLWoodruff Jul 26, 2024
6e7b251
starting generalizing gams for other problems than farmer
AymericPCLegros Jul 26, 2024
dc679ba
specifying which parts are generic in scenario creator
AymericPCLegros Jul 29, 2024
761ead1
starting the generic gams file, should be changed
AymericPCLegros Jul 29, 2024
3670298
[WIP] the cylinders need to be modified
AymericPCLegros Jul 30, 2024
7f3fb23
[WIP] problem with the kwargs in generic gams
AymericPCLegros Jul 31, 2024
ed5360e
Agnostic generic GAMS seems to be working, at least with farmer
AymericPCLegros Jul 31, 2024
9686a62
starting to implement the transport example
AymericPCLegros Aug 2, 2024
8512713
trying to adapt for sets defined as cartesian products
AymericPCLegros Aug 5, 2024
c66868d
The files in the agnostic directory execute. Yet, the lagrangian does…
AymericPCLegros Aug 9, 2024
d33f1f1
merge conflicts
AymericPCLegros Aug 9, 2024
b4a65de
Merge pull request #6 from AymericPCLegros/agnostic_gams
DLWoodruff Aug 9, 2024
45c467f
images for agnostic architecture
AymericPCLegros Aug 9, 2024
0fde762
Merge pull request #7 from AymericPCLegros/agnostic_gams
DLWoodruff Aug 9, 2024
abf3ffc
Merge branch 'main' into agnostic
DLWoodruff Aug 9, 2024
567fc8f
Merge branch 'main' of https://github.com/DLWoodruff/mpi-sppy-1
DLWoodruff Aug 12, 2024
51782e9
Merge branch 'main' into agnostic
DLWoodruff Aug 12, 2024
a01c2d6
up to date agnostic figure
DLWoodruff Aug 12, 2024
4431309
minor improvements to agnostic picture
DLWoodruff Aug 12, 2024
1401c09
Update agnostic_cylinders.py
DLWoodruff Aug 13, 2024
7dfc81a
Update agnostic_cylinders.py
DLWoodruff Aug 13, 2024
2f6d1df
fix error where the wrong obj was being used
DLWoodruff Aug 15, 2024
f9287a1
fix the objective function bug in the ampl_guest
DLWoodruff Aug 15, 2024
744fe5f
solution output file names now given as a string on command line
DLWoodruff Aug 15, 2024
f339c4c
try to add mpigap (untested)
DLWoodruff Aug 15, 2024
e2aff6c
implement farmer agnostic for gurobipy
keeks05 Aug 20, 2024
8c1a457
delete old gurobipy files
keeks05 Aug 21, 2024
dc9de39
pasted in contents of farmer.py
keeks05 Aug 29, 2024
c7b619f
fix coefficient bug
keeks05 Aug 30, 2024
df43f4b
Update farmer_gurobipy_agnostic.py
DLWoodruff Sep 4, 2024
bd25b6e
Merge branch 'main' of https://github.com/DLWoodruff/mpi-sppy-1
DLWoodruff Sep 12, 2024
f070a86
Merge branch 'main' of https://github.com/DLWoodruff/mpi-sppy-1
DLWoodruff Sep 17, 2024
1e2f26a
Merge remote-tracking branch 'david-fork/agnostic' into pr-402
keeks05 Sep 17, 2024
4bcba82
Merge branch 'main' of https://github.com/DLWoodruff/mpi-sppy-1
DLWoodruff Sep 18, 2024
4a9784a
merge conflicts
DLWoodruff Sep 18, 2024
7441080
Merge branch 'Pyomo:main' into agnostic
DLWoodruff Sep 24, 2024
b211318
add unit test for gurobipy
keeks05 Sep 24, 2024
d5d6afd
Merge pull request #8 from keeks05/pr-402
DLWoodruff Sep 27, 2024
c6d7f05
Merge branch 'main' of https://github.com/DLWoodruff/mpi-sppy-1
DLWoodruff Sep 27, 2024
b10b63d
Merge branch 'main' into agnostic
DLWoodruff Sep 27, 2024
5cbab27
Merge branch 'main' into agnostic
DLWoodruff Oct 8, 2024
8183e1c
paste to make farmer ampl example more like what people need
DLWoodruff Oct 12, 2024
ae79235
Files from Antarish
DLWoodruff Oct 29, 2024
bcf5e92
merge conflict with main resolved
DLWoodruff Nov 3, 2024
634e356
remove picklebundles.rst to match main
DLWoodruff Nov 12, 2024
b4f01e7
factored from problem-specific scenario creator, but transport exampl…
DLWoodruff Nov 12, 2024
fa0ddab
The factoring has been done for transport, but it fails on mi.instant…
DLWoodruff Nov 13, 2024
f801a59
[WIP] gams_guest.py has debugging prints
DLWoodruff Nov 15, 2024
226acc9
Merge branch 'main' of https://github.com/DLWoodruff/mpi-sppy-1
DLWoodruff Nov 20, 2024
530d9cf
Merge branch 'main' into agnostic
DLWoodruff Nov 20, 2024
50eb688
Merge branch 'main' of https://github.com/DLWoodruff/mpi-sppy-1
DLWoodruff Nov 21, 2024
6b3e8bd
replace the model name in the new gams file hack that is written
DLWoodruff Nov 21, 2024
f68de6b
[WIP] working on temp dir for GAMS
DLWoodruff Nov 21, 2024
2639fd7
both examples work, but the gap does not close for transport
DLWoodruff Nov 21, 2024
39de7df
working tests; still need a GAMS test
DLWoodruff Nov 22, 2024
02bc1da
Merge branch 'main' of https://github.com/DLWoodruff/mpi-sppy-1
DLWoodruff Nov 22, 2024
98467dc
Merge branch 'main' into agnostic
DLWoodruff Nov 22, 2024
da94798
there is now a gams test, but many ruff errors
DLWoodruff Nov 22, 2024
3f9f2fd
ruff should be happy
DLWoodruff Nov 22, 2024
4f9b502
ruff should be even happier
DLWoodruff Nov 22, 2024
9712def
Merge branch 'main' into agnostic
DLWoodruff Nov 23, 2024
2870815
added a test for agnostic_cyliners
DLWoodruff Nov 23, 2024
9a61d39
Merge branch 'agnostic' of https://github.com/DLWoodruff/mpi-sppy-1 i…
DLWoodruff Nov 23, 2024
515a72a
trying to fix a syntax error in the yml file, but I cannot figure out…
DLWoodruff Nov 23, 2024
421a57d
Now I am starting to see what was wrong with the yml file
DLWoodruff Nov 23, 2024
6f62299
fix indentation error in yml file
DLWoodruff Nov 23, 2024
0d96744
working on missing headers
DLWoodruff Nov 23, 2024
da62617
change it so tests will try xpress before cplex
DLWoodruff Nov 24, 2024
8be93ff
try to see if using python 3.9 is causing failures
DLWoodruff Nov 24, 2024
6dcfe30
try reverting the yml to see if tests pass
DLWoodruff Nov 24, 2024
4e61fa7
usoing the agnostic version of the test yml again
DLWoodruff Nov 24, 2024
864ee1a
fix a merge error from bcf5e92
DLWoodruff Nov 24, 2024
b917862
add need_solution to args list for callout to solve_one
DLWoodruff Nov 24, 2024
c394100
The tests are passing on my machine, so try cplex on github
DLWoodruff Nov 24, 2024
3b24ce2
Merge branch 'main' of https://github.com/DLWoodruff/mpi-sppy-1
DLWoodruff Dec 1, 2024
842685c
pull conflict
DLWoodruff Dec 8, 2024
0c4c97f
Merge branch 'main' of https://github.com/DLWoodruff/mpi-sppy-1
DLWoodruff Dec 12, 2024
fa27a43
Merge branch 'main' of https://github.com/DLWoodruff/mpi-sppy-1
DLWoodruff Dec 15, 2024
e8d1e02
Merge branch 'main' of https://github.com/DLWoodruff/mpi-sppy-1
DLWoodruff Dec 21, 2024
9310d49
[WIP] first shot at proper multi-stage bundles; ready to test
DLWoodruff Dec 21, 2024
1a6e17e
[WIP] add a commant for aircond (no bundles) to generic_cylinders.bas…
DLWoodruff Dec 21, 2024
d9ea29d
aircond runs with generic cylinders. Ready to try bundles
DLWoodruff Dec 21, 2024
f8610b6
added a command to pickle just the scenarios; now need to deal with n…
DLWoodruff Dec 21, 2024
0ca7556
the aircond example now sets cfg.num_scens
DLWoodruff Dec 25, 2024
81d519c
bash script updated
DLWoodruff Dec 25, 2024
9a4dd94
Merge branch 'main' of https://github.com/DLWoodruff/mpi-sppy-1
DLWoodruff Dec 25, 2024
72d0842
Merge branch 'main' into proper_multi
DLWoodruff Dec 25, 2024
f6a3512
adding to the sample runs bash script
DLWoodruff Dec 28, 2024
998a04f
proper, multi-stage bundles are supported with some restrictions
DLWoodruff Dec 28, 2024
2bb5539
didcallout needed to be removed as unused
DLWoodruff Dec 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 47 additions & 9 deletions .github/workflows/test_pr_and_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ jobs:
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test_env
python-version: 3.9
python-version: 3.
auto-activate-base: false
- name: Install dependencies
run: |
Expand Down Expand Up @@ -245,7 +245,7 @@ jobs:
pip install -e .

- name: run tests
timeout-minutes: 100
timeout-minutes: 10
run: |
cd mpisppy/tests
# envall does nothing
Expand Down Expand Up @@ -274,7 +274,7 @@ jobs:
pip install -e .

- name: run tests
timeout-minutes: 100
timeout-minutes: 10
run: |
cd mpisppy/tests
# envall does nothing
Expand All @@ -290,7 +290,7 @@ jobs:
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test_env
python-version: 3.8
python-version: 3.9
auto-activate-base: false
- name: Install dependencies
run: |
Expand Down Expand Up @@ -318,7 +318,7 @@ jobs:
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test_env
python-version: 3.8
python-version: 3.9
auto-activate-base: false
- name: Install dependencies
run: |
Expand Down Expand Up @@ -416,7 +416,7 @@ jobs:
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test_env
python-version: 3.8
python-version: 3.9
auto-activate-base: false
- name: Install dependencies
run: |
Expand Down Expand Up @@ -455,14 +455,14 @@ jobs:
pip install -e .

- name: run pysp model tests
timeout-minutes: 100
timeout-minutes: 10
run: |
cd mpisppy/tests
# envall does nothing
python test_pysp_model.py

- name: run pysp unit tests
timeout-minutes: 100
timeout-minutes: 10
run: |
cd mpisppy/utils/pysp_model
pytest -v .
Expand All @@ -477,7 +477,7 @@ jobs:
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test_env
python-version: 3.8
python-version: 3.9
auto-activate-base: false
- name: Install dependencies
run: |
Expand All @@ -493,3 +493,41 @@ jobs:
run: |
cd mpisppy/tests
mpiexec -np 2 python -m mpi4py test_with_cylinders.py

test-agnostic:
name: tests on agnostic
runs-on: ubuntu-latest
needs: [ruff]

steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test_env
python-version: 3.9
auto-activate-base: false
- name: Install dependencies
run: |
conda install mpi4py pandas setuptools
pip install pyomo xpress
pip install numpy
python -m pip install amplpy --upgrade
python -m amplpy.modules install highs cbc gurobi
python -m pip install gamspy
# license?

- name: setup the program
run: |
pip install -e .

- name: run agnostic tests
timeout-minutes: 10
run: |
cd mpisppy/tests
python test_agnostic.py

- name: run agnostic cylinders
timeout-minutes: 10
run: |
cd mpisppy/agnostic/examples
python afew_agnostic.py --oversubscribe
138 changes: 138 additions & 0 deletions agnostic.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
newest notes on top
----------------------------------------

host means mpisppy
guest means whatever the guest language is (which can even be Pyomo, of course)


Jan 3 2024: We are going to require that the guest takes care of
bundling and presents the host with "proper" bundles
that look to the host like regular scenarios.
We have AMPL and Pyomo working as guests and GAMS seems to work OK,
except that there are file contention issues that can probably be solved
easily (I think they have an example with parallel execution)

-------------------------


Aug 27


The example is now farmer_agnostic.py and agnostic_cylinders.py (ag.bash)
in the farmer example directory.

HEY::: who updates W? Let's do it right before the solve so we don't have to care...
this is a little dangerous at present because we are being silent when
they are not there because of xhatters


== nonant communication needs to be on the host side, of course, but
then callouts need to get values copied to/from the guest

== we need to enforce the assumption that the nonants match in every way possible
between host and guest at all times (e.g. _restore_nonants needs to callout,
but _save_nonants does not.

== bundling is left hanging in dangerous ways: e.g. Eobjective in two places

Aug 26

Work proceeds on three fronts:

- Addiing callouts to mpisppy
- creating the example guest language functions (in Pyomo)
- creating examples of the guest language funtions in other languages

= note: the callouts are almost always inside the local scenario loop in mpisspy

= note: after the solve we are going update the host model x values so
it can update the xbars

= The host will update the w's then a callout will send the new values to
the guest

= I am not even thinking about extensions...

= For bundling, we need to be able to solve EFs (to state the obvious)

circa Aug 25

- no changes needed in spbase so long as agnostic scenario creator is passed in

- EF will be basically a rewrite because we use blocks

- ? for the phbase constructor: pass cfg that contains Ag or pass Ag?; use the options dict for now

- working on an example, which is farmer_agnostic.py run from the __main__ of agnostic.py
(farmer_agnostic is presently run from the utils directory and I have a copy of farmer.py there as well)


===============================================================
Thoughts about AML-agnostic extensions to mpi-sppy
(started by DLW 18 Dec 2022)
Just thinking about support for straight PH for now. Bundles are probably the first thing to add.

-1. BTW: both GAMS and AMPL have python APIs.

0. On the Python side each scenario is still a Pyomo "model" (that perhaps has only the nonant Vars)
with _mpisppy_data and _mpisppy_model attached.
- it might result in a little speed-up to cut Pyomo out some day, but we should start with Pyomo, I think

1. Some functions in spbase, most functions in phbase, and maybe some functions in spopt will call this function:

def callout_agnostic(cfg, name, **kwargs):
""" callout for AML-agnostic support
Args:
cfg (Config): the field "AML_agnostic" might contain a module with callouts
name (str): the function name to call
kwargs (dict): the keywords args for the callout function
Calls:
a callout function that presumably has side-effects
Returns:
True if the callout was done and False if not
"""

if cfg.get(AML_agnostic, ifmissing=None) is not None:
if not hasattr(cfg.AML_agnostic, name):
raise RuntimeError(f"AML-agnostic module is missing function {name}")
fct = getattr(cfg.AML_agnostic, name)
fct(**kwargs)
return True
else:
return False

The function that is called by fct(**kwargs) will do the work of
interacting with the AML and updating mpi-sppy structures that are
passed in as kwargs. Note that cfg is going to need to be attached
some some objects that don't presently have it (e.g. SPOpt). Some
functions in mpi-sppy will want to return immediately if
callout_agnostic returns True (i.e., have the callout function do
all the work).


2 in spbase:
- don't support variable_prob
- _set_scense needs a callout

3 The scenario_creator function will be in Python and needs to call an AML scenario creator function

4. In solve_one it might be easiest to just do everything in the callout function. Maybe that will be the
case for many callouts. But from a maintenance perspective, it would best to have mpi-sppy code
do as much as possible and the callout Python do as little as possible.

5. Think about Compute_Xbar and Update_W. They probably need to do all their processing then do
a callout at the end so the AML model can be updated.

=======================================
Notes about callouts

- There are going to be a lot of them!

- Maybe it would be better to drop the name argument and use
inspect.stack()[1][3] in callout_agnostic so the name of the cfg field
is the name of the calling function in mpi-sppy.
This would
o standardize names,
o eliminate some cut-and-paste errors,
o make it a little wierd if there were ever two callouts from one function,
but not that wierd (just handled with kwarg flag) and two callouts should be rare.
Loading
Loading