Trouble running the hydro example #409
Replies: 3 comments 2 replies
-
I just noticed that I encounter the same problems if I run the farmer_cylinder.py script. The examples from: https://mpi-sppy.readthedocs.io/en/latest/examples.html do work as desired. PS C:\Users\s147670\PycharmProjects\MultiStage\mpi-sppy\examples\farmer> python farmer_cylinders.py --num-scens 3 --crops-mult 1 --default-rho 1 --solver-name "gurobi_direct" --max-iterations 10 It seems like I am making the same mistake twice, but I don't know what means I can use to figure out what is going wrong. I think it would be very helpful to show in the examples how to run the scripts from the command line to get working solutions. [ 0.00] Initializing mpi-sppy |
Beta Was this translation helpful? Give feedback.
-
The command you are running is working as expected, it only has a hub
cylinder (no bounds cylinders).
Assuming you have MPI and mpi4py installed properly (see the readme and
when in doubt, go the anaconda route):
mpiexec -np 3 python -m mpi4py farmer_cylinders.py --num-scens 3
--crops-mult 1 --default-rho 1 --solver-name "gurobi_direct"
--max-iterations 10 --lagrangian --xhatshuffle
(see simple.bash in the farmer example for more command lines)
…On Fri, Aug 16, 2024 at 5:25 AM Bart van der Holst ***@***.***> wrote:
I just noticed that I encounter the same problems if I run the
farmer_cylinder.py script. The examples from:
https://mpi-sppy.readthedocs.io/en/latest/examples.html <http://url> do
work as desired.
PS C:\Users\s147670\PycharmProjects\MultiStage\mpi-sppy\examples\farmer>
python farmer_cylinders.py --num-scens 3 --crops-mult 1 --default-rho 1
--solver-name "gurobi_direct" --max-iterations 10
[ 0.00] Initializing mpi-sppy
[ 1.53] Initializing SPBase
[ 1.53] Initializing PHBase
[ 1.53] Starting spcomm.main()
[ 1.53] Creating solvers
[ 1.55] Entering solve loop in PHBase.Iter0
[ 1.59] Iter. Best Bound Best Incumbent Rel. Gap Abs. Gap
[ 1.59] 1 * -115405.5556 inf inf% inf
[ 1.61] 2 -115405.5556 inf inf% inf
[ 1.62] 3 -115405.5556 inf inf% inf
[ 1.64] 4 -115405.5556 inf inf% inf
[ 1.66] 5 -115405.5556 inf inf% inf
[ 1.68] 6 -115405.5556 inf inf% inf
[ 1.70] 7 -115405.5556 inf inf% inf
[ 1.72] 8 -115405.5556 inf inf% inf
[ 1.74] 9 -115405.5556 inf inf% inf
[ 1.76] 10 -115405.5556 inf inf% inf
[ 1.76] Reached user-specified limit=10 on number of PH iterations
Arbitrary sanity checks:
SUGAR_BEETS0 for scenario scen0 is 236.19106321346567
FirstStageCost for scenario scen0 is 108538.4744787988
[ 1.76] Hub algorithm PH complete, waiting for spoke finalization
[ 1.76] Statistics at termination
[ 1.76] Iter. Best Bound Best Incumbent Rel. Gap Abs. Gap
[ 1.76] 10 -115405.5556 inf inf% inf
[ 1.76] Windows freed
[ 1.76] No incumbent solution available to write!
[ 1.76] No incumbent solution available to write!
[ 1.76] No incumbent solution available to write!
—
Reply to this email directly, view it on GitHub
<#409 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD4VTBEXGXZ4FZMPPOZ7AWTZRXVURAVCNFSM6AAAAABMT5YYZSVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTAMZVHA2DEMY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
One seems to need quotes around the 3 3 as in "3 3"
Also, if you want bounds (or a solution), you need to run as in the file
demo.bash (except that it doesn't have the necessary quotes around 3 3).
Dave
…On Fri, Aug 16, 2024 at 4:59 AM Bart van der Holst ***@***.***> wrote:
Dear All,
First I want to thank you for the development of this package. It seems to
be exactly what I needed.
The problem I want to solve is quite similar to the hydro problem, so I am
trying to understand it first.
Though I managed to run hydro_ef.py, I do some trouble with running the
cylinder scripts from the command line.
**Passing the branching-factors"
When trying to run e.g.:
python hydro_cylinders.py --branching-factors 3 3 --max-iterations 20
--solver-name "gurobi_direct" --default-rho 1
I get the error message:
farmer_cylinders: error: unrecognized arguments: 3
This error seems to apply to the second "3". The -h tells me to provide
branching-factors as: "Spaces delimited branching factors (e.g., 2 2)", but
this does not seem to work for me. Do you know what I am doing wrong?
*No incumbent solution*
More worryingly, if I run:
python hydro_cylinders_pysp.py --max-iterations 50 --default-rho 1.0
--solver-name "gurobi_direct"
(which "ignores the branching factors" (how?)) I get no incumbent solution
(see below). Is it true that this should be the case? I didn't make any
changes to the model. Starting from an example that does not solve the
model, makes it very hard to start building upon it.
I thank you in advance!
`
PS C:\Users\s147670\PycharmProjects\MultiStage\mpi-sppy\examples\hydro>
python hydro_cylinders_pysp.py --max-iterations 50 --default-rho 1.0
--solver-name "gurobi_direct"
[ 0.00] Initializing mpi-sppy
[ 1.79] Initializing SPBase
[ 1.85] Initializing PHBase
[ 1.86] Starting spcomm.main()
[ 1.86] Creating solvers
[ 1.88] Entering solve loop in PHBase.Iter0
[ 2.00] Iter. Best Bound Best Incumbent Rel. Gap Abs. Gap
[ 2.00] 1 * 175.0168 inf inf% inf
[ 2.06] 2 175.0168 inf inf% inf
[ 2.12] 3 175.0168 inf inf% inf
[ 2.18] 4 175.0168 inf inf% inf
[ 2.24] 5 175.0168 inf inf% inf
[ 2.30] 6 175.0168 inf inf% inf
[ 2.36] 7 175.0168 inf inf% inf
[ 2.42] 8 175.0168 inf inf% inf
[ 2.48] 9 175.0168 inf inf% inf
[ 2.54] 10 175.0168 inf inf% inf
[ 2.59] 11 175.0168 inf inf% inf
[ 2.65] 12 175.0168 inf inf% inf
[ 2.71] 13 175.0168 inf inf% inf
[ 2.77] 14 175.0168 inf inf% inf
[ 2.83] 15 175.0168 inf inf% inf
[ 2.89] 16 175.0168 inf inf% inf
[ 2.95] 17 175.0168 inf inf% inf
[ 3.01] 18 175.0168 inf inf% inf
[ 3.07] 19 175.0168 inf inf% inf
[ 3.14] 20 175.0168 inf inf% inf
[ 3.19] 21 175.0168 inf inf% inf
[ 3.25] 22 175.0168 inf inf% inf
[ 3.31] 23 175.0168 inf inf% inf
[ 3.37] 24 175.0168 inf inf% inf
[ 3.42] 25 175.0168 inf inf% inf
[ 3.48] 26 175.0168 inf inf% inf
[ 3.54] 27 175.0168 inf inf% inf
[ 3.59] 28 175.0168 inf inf% inf
[ 3.65] 29 175.0168 inf inf% inf
[ 3.71] 30 175.0168 inf inf% inf
[ 3.77] 31 175.0168 inf inf% inf
[ 3.83] 32 175.0168 inf inf% inf
[ 3.88] 33 175.0168 inf inf% inf
[ 3.94] 34 175.0168 inf inf% inf
[ 4.00] 35 175.0168 inf inf% inf
[ 4.06] 36 175.0168 inf inf% inf
[ 4.11] 37 175.0168 inf inf% inf
[ 4.17] 38 175.0168 inf inf% inf
[ 4.23] 39 175.0168 inf inf% inf
[ 4.29] 40 175.0168 inf inf% inf
[ 4.34] 41 175.0168 inf inf% inf
[ 4.40] 42 175.0168 inf inf% inf
[ 4.46] 43 175.0168 inf inf% inf
[ 4.57] 45 175.0168 inf inf% inf
[ 4.63] 46 175.0168 inf inf% inf
[ 4.69] 47 175.0168 inf inf% inf
[ 4.74] 48 175.0168 inf inf% inf
[ 4.80] 49 175.0168 inf inf% inf
[ 4.86] 50 175.0168 inf inf% inf
[ 4.86] Reached user-specified limit=50 on number of PH iterations
[ 4.86] Hub algorithm PH complete, waiting for spoke finalization
[ 4.86] Statistics at termination
[ 4.86] Iter. Best Bound Best Incumbent Rel. Gap Abs. Gap
[ 4.86] 50 175.0168 inf inf% inf
[ 4.86] Windows freed
BestInnerBound=inf and BestOuterBound=175.0168013257502
[ 4.86] No incumbent solution available to write!
[ 4.86] No incumbent solution available to write!
`
—
Reply to this email directly, view it on GitHub
<#409>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD4VTBA46ALEIQETJK2DBJDZRXSTXAVCNFSM6AAAAABMT5YYZSVHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZXGA2TSNZRGY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Dear All,
First I want to thank you for the development of this package. It seems to be exactly what I need.
The problem I want to solve is quite similar to the hydro problem, so I am trying to understand it first.
Though I managed to run hydro_ef.py, I have trouble running the cylinder scripts from the command line.
Passing the branching-factor
When trying to run e.g.:
python hydro_cylinders.py --branching-factors 3 3 --max-iterations 20 --solver-name "gurobi_direct" --default-rho 1
I get the error message:
farmer_cylinders: error: unrecognized arguments: 3
This error seems to apply to the second "3". The -h tells me to provide branching-factors as: "Spaces delimited branching factors (e.g., 2 2)", but this does not seem to work for me. Do you know what I am doing wrong?
No incumbent solution
More worryingly, if I run:
python hydro_cylinders_pysp.py --max-iterations 50 --default-rho 1.0 --solver-name "gurobi_direct"
(which "ignores the branching factors" (how?)) I get no incumbent solution (see below). Is it true that this should be the case? I didn't make any changes to the model. Starting from an example that does not solve the model, makes it very hard to start building upon it.
Thank you in advance!
`
PS C:\Users\s147670\PycharmProjects\MultiStage\mpi-sppy\examples\hydro> python hydro_cylinders_pysp.py --max-iterations 50 --default-rho 1.0 --solver-name "gurobi_direct"
[ 0.00] Initializing mpi-sppy
[ 1.79] Initializing SPBase
[ 1.85] Initializing PHBase
[ 1.86] Starting spcomm.main()
[ 1.86] Creating solvers
[ 1.88] Entering solve loop in PHBase.Iter0
[ 2.00] Iter. Best Bound Best Incumbent Rel. Gap Abs. Gap
[ 2.00] 1 * 175.0168 inf inf% inf
[ 2.06] 2 175.0168 inf inf% inf
[ 2.12] 3 175.0168 inf inf% inf
[ 2.18] 4 175.0168 inf inf% inf
[ 2.24] 5 175.0168 inf inf% inf
[ 2.30] 6 175.0168 inf inf% inf
[ 2.36] 7 175.0168 inf inf% inf
[ 2.42] 8 175.0168 inf inf% inf
[ 2.48] 9 175.0168 inf inf% inf
[ 2.54] 10 175.0168 inf inf% inf
[ 2.59] 11 175.0168 inf inf% inf
[ 2.65] 12 175.0168 inf inf% inf
[ 2.71] 13 175.0168 inf inf% inf
[ 2.77] 14 175.0168 inf inf% inf
[ 2.83] 15 175.0168 inf inf% inf
[ 2.89] 16 175.0168 inf inf% inf
[ 2.95] 17 175.0168 inf inf% inf
[ 3.01] 18 175.0168 inf inf% inf
[ 3.07] 19 175.0168 inf inf% inf
[ 3.14] 20 175.0168 inf inf% inf
[ 3.19] 21 175.0168 inf inf% inf
[ 3.25] 22 175.0168 inf inf% inf
[ 3.31] 23 175.0168 inf inf% inf
[ 3.37] 24 175.0168 inf inf% inf
[ 3.42] 25 175.0168 inf inf% inf
[ 3.48] 26 175.0168 inf inf% inf
[ 3.54] 27 175.0168 inf inf% inf
[ 3.59] 28 175.0168 inf inf% inf
[ 3.65] 29 175.0168 inf inf% inf
[ 3.71] 30 175.0168 inf inf% inf
[ 3.77] 31 175.0168 inf inf% inf
[ 3.83] 32 175.0168 inf inf% inf
[ 3.88] 33 175.0168 inf inf% inf
[ 3.94] 34 175.0168 inf inf% inf
[ 4.00] 35 175.0168 inf inf% inf
[ 4.06] 36 175.0168 inf inf% inf
[ 4.11] 37 175.0168 inf inf% inf
[ 4.17] 38 175.0168 inf inf% inf
[ 4.23] 39 175.0168 inf inf% inf
[ 4.29] 40 175.0168 inf inf% inf
[ 4.34] 41 175.0168 inf inf% inf
[ 4.40] 42 175.0168 inf inf% inf
[ 4.46] 43 175.0168 inf inf% inf
[ 4.57] 45 175.0168 inf inf% inf
[ 4.63] 46 175.0168 inf inf% inf
[ 4.69] 47 175.0168 inf inf% inf
[ 4.74] 48 175.0168 inf inf% inf
[ 4.80] 49 175.0168 inf inf% inf
[ 4.86] 50 175.0168 inf inf% inf
[ 4.86] Reached user-specified limit=50 on number of PH iterations
[ 4.86] Hub algorithm PH complete, waiting for spoke finalization
[ 4.86] Statistics at termination
[ 4.86] Iter. Best Bound Best Incumbent Rel. Gap Abs. Gap
[ 4.86] 50 175.0168 inf inf% inf
[ 4.86] Windows freed
BestInnerBound=inf and BestOuterBound=175.0168013257502
[ 4.86] No incumbent solution available to write!
[ 4.86] No incumbent solution available to write!
`
Beta Was this translation helpful? Give feedback.
All reactions