- Download scipoptsuite-5.0.1 binaries for Linux, i.e., scipoptsuite-5.0.1.tgz
- Go to /path/to/scipoptsuite-5.0.1.tgz
tar -xvf scipoptsuite-5.0.1.tgz
- Compile scipoptsuite-5.0.1
cd scipoptsuite-5.0.1
mkdir build
cd build
cmake ..
make
make check
- Install scipoptsuite-5.0.1
- Go to /path/to/scipoptsuite-5.0.1.tgz
mkdir local
- From within build directory, Install SCIP. For example,
make install DESTDIR=/path/to/local
- Add PATH to SCIP
export SCIPOPTDIR="/path/to/local/usr/local":$SCIPOPTDIR
- Add <export SCIPOPTDIR="/path/to/local/usr/local":$SCIPOPTDIR> to .bashrc file
- run SCIP Standalone
- To run SCIP standalone after compilation, enter
/path/to/local/usr/local/bin/scip
- To run SCIP standalone after compilation, enter
- Download and install Julia Version 1.1.0. See for example: (https://github.com/gher-ulg/Documentation/wiki/Install-julia-on-Linux)
- To use Julia, enter
~/julia-1.1.0/bin/julia
- To add packages, use
import Pkg
andPkg.add("package_name")
- To set the number of threads on the operating system level before julia starts, edit the bashrc file to add the following environment variable: export JULIA_NUM_THREADS=10:$JULIA_NUM_THREADS. The number of threads can be modified.
- Make sure the number of threads used by optimizer is less than the number of threads available to Julia.
- To use SCIP in Julia, use the following steps:
- Add PATH to SCIP installation
export SCIPOPTDIR="/path/to/local":$SCIPOPTDIR
- Add <export SCIPOPTDIR="/path/to/local":$SCIPOPTDIR> to .bashrc file
- run
Julia
to enter Julia REPL import Pkg
- To enter the pkg mode (Pkg REPL) enter:
]
add SCIP@v0.6.1
pin SCIP
#this will pin the SCIP.jl version to 0.6.1 so it is compatible with SCIP installationbuild SCIP
using SCIP
- The file /.julia/packages/SCIP/.../src/mpb_interface.jl of the package SCIP.jl v0.6.1 has to be modified manually. In lines 185, 186, 192, 193, 207 and 208, numvar(m) has to be changed by MathProgBase.numvar(m).
- To use CPLEX in Julia, use the following steps:
- To check the version of SCIP installed in Julia, run
Pkg.installed()
- Find more details on (https://github.com/SCIP-Interfaces/SCIP.jl).
- To use OOESAlgorithm in Julia, use the following steps:
import Pkg
Pkg.add("OOESAlgorithm")
Pkg.build("OOESAlgorithm")
using OOESAlgorithm
- See details here: (http://eng.usf.edu/~amsierra/documents/Documentation_OOESAlg.pdf)
- To use multiple threads for CPLEX or SCIP solvers while solving MIP in OOES algorithm, use the following steps:
- The file /.julia/packages/OOESAlgorithm/faYKc/src/initial_operations.jl has to be modified manually. For SCIP, modify the line 89 to
mip_solver=SCIPSolver("display/verblevel", 3, "parallel/minnthreads", 4, "parallel/maxnthreads", 8, "limits/gap", relative_gap, "limits/time", 6000.0)
. For CPLEX, modify the line 87 tomip_solver=CplexSolver(CPX_PARAM_SCRIND=0, CPX_PARAM_THREADS=8, CPX_PARAM_EPGAP=relative_gap)
.
- The file /.julia/packages/OOESAlgorithm/faYKc/src/initial_operations.jl has to be modified manually. For SCIP, modify the line 89 to
- Other required Julia packages and their corresponding versions are SCIP (0.6.1), JuMP (0.20.1), CSV (v0.5.23), DataFrames (v0.20.0), MathOptFormat (v0.2.2).
- In the first step, data file Input_File.txt is converted into a .lp file model.lp.
- The directory optimizer must contain the following files:
- Input_File.txt : input data file in designated format
- LPCreator.jl: Julia code for creating Model.lp file given a data input file
- optimizer.jl: Julia code for running optimizer and writing output
- Model.lp : The output file in .lp format which contains the optimization model
- Given a data file Input_File.txt, run the following standalone script line by line in command line inside the directory optimizer:
path/to/julia -p8 LPCreator.jl
For example: /home/zulqarnain/workspace/WWTP/julia-1.0.5/bin/julia -p8 LPCreator.jl where -p8 represents the number of threads/processes Julia can use.path/to/julia -p8 optimizer.jl
For example: /home/zulqarnain/workspace/WWTP/julia-1.0.5/bin/julia -p8 optimizer.jl where -p8 represents the number of threads/processes Julia can use.- LPCreator.jl gives Model.lp as its output. The program also gives optimizer_output_file1.txt as output. The file is in turn modified by optimizer.jl
- Else, create a script file, for instance optimizer.sh, and copy and paste above lines of code inside the file. Then, run the following commands from inside the directory optimzier
chmod +x optimizer.sh
ls -l optimizer.sh
./optimizer.sh
- The Julia file optimizer.jl contains a call to OOESAlgorithm. For example:
solutions = OOES("/path/to/Model.lp",pareto_frontier=true,mipsolver=4,threads=8,parallelization=2,timelimit=60.0)
- The default MIP Solver is set to SCIP since mipsolver=4. To modify other arguments including the path to Model.lp file, edit the optimizer.jl file.
- For details about arguments and possible options, see (https://github.com/alvsierra286/OOESAlgorithm.jl) and (http://eng.usf.edu/~amsierra/documents/Documentation_OOESAlg.pdf).