File tree 2 files changed +31
-0
lines changed
2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,14 @@ option. Note
21
21
that at the time of this writing, the number of scenarios is obtained
22
22
by counting the mps files in the directory given.
23
23
24
+ The file ``examples.sizes.mps_demo.txt `` has two commands. The second illustrates
25
+ how to instruction ``MPI-SPPY `` to read mps/json file pairs for each scenario from a
26
+ directory. The first command illustrates how to use ``MPI-SPPY `` to write
27
+ them in the first place (but if ``MPI-SPPY `` can get your scenarios, there
28
+ is probably no reason to write them and then read them again!). This
29
+ functionality is intended to be used by users of other AMLs or other
30
+ scenario-based stochastic programming applications.
31
+
24
32
25
33
Tight integration
26
34
^^^^^^^^^^^^^^^^^
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ # This is mainly to demonstrate what loose agnostic files look like and
3
+ # how to use them with agnostic_cylinders.py.
4
+ # To do that, we write the files based on a Pyomo model, then
5
+ # read them in.
6
+ # Note: if you actually have a Pyomo model, you probably don't want to do
7
+ # it this way since you would have had to have written most of the
8
+ # functions (e.g. scenario_creator) anyway.
9
+ # If you are using some other AML, then you migth want to use the second
10
+ # command line to read the files you wrote with your AML and
11
+ # you can use the first command to write files as an example of the format
12
+ # for the json files.
13
+
14
+ set -e
15
+
16
+ SOLVER=cplex
17
+
18
+ # assumes we are in the sizes directory and don't mind polluting it with 6 files
19
+ python ../../mpisppy/generic_cylinders.py --module-name sizes_expression --num-scens 3 --default-rho 1 --solver-name ${SOLVER} --max-iterations 0 --scenario-lp-mps-files
20
+
21
+ # By specifying the module to be mps_module we will read files for the problem
22
+ # from the specified mps-files-directory.
23
+ mpiexec -np 3 python -m mpi4py ../../mpisppy/generic_cylinders.py --module-name ../../mpisppy/utils/mps_module --xhatshuffle --lagrangian --default-rho 1 --solver-name ${SOLVER} --max-iterations 10 --mps-files-directory=.
You can’t perform that action at this time.
0 commit comments