kanors-emr / Veda2.0-Installation

Veda2.0 is a data handling system for The Integrated MARKAL-EFOM System (TIMES) - a bottom-up optimization model for energy-environment systems
https://www.kanors-emr.org/
3 stars 0 forks source link

Modification of solver option files #32

Closed victor-guillot closed 5 months ago

victor-guillot commented 5 months ago

Would it be possible to modify the solver opt files in the run manager. I think the gurobi.opt file is not as clear and intuitive as other cplex opt files. My suggestion would be a simple file like this one :

Method=2 Crossover=1 Threads=7

What do you think about adding a possibility to use the new highs (https://highs.dev/) solver ? Not as fast as gurobi/cplex but improving fast: https://forum.openmod.org/t/open-source-highs-solver-performance-boost-for-energy-system-models/2922 A suggestion could be:

solver = ipm run_crossover = true ipm_optimality_tolerance = 1e-6 threads = 7

ravindersinghchauhan commented 5 months ago

See this video.

victor-guillot commented 5 months ago

Thank you for the video, I have my personalized opt files in the AppData folder. The issue was on the clarity of the default gurobi opt file which is not very intuitive when one wants to explore other solver than cplex. I think that a smaller version for the default gurobi.opt default file would ease the process. I was suggesting colleagues to try gurobi, then we had to exchange opt files, that could be easier if accessible with the drop-down list solver options.

The second point on adding new solver like highs is that it seems I do not have access to modification of the drop down list Solver in the run manager. Then if a create a case with Solver: CPLEX (because HIGHS does not exist in the list) and Solver Option: highs that is related to my my highs.opt, veda renames my highs.opt by gurobi.opt when writing dd files. Moereover, it is written in the run file option LP=gurobi, while I want to have option LP=highs. So I have to rewrite it by hand or use RFCmd_OPTIMIZER attribute in a regular scenario. I also have to rename gurobi.opt to highs.opt in my Gams_Wrk. I hope I made it clearer

victor-guillot commented 5 months ago

It seems that the default gurobi.opt is outdated and yields error messages. Here is a copy of the error messages I get with gurobi10 on the DemoS_004 case:

errors_gurobi.txt

akanudia commented 5 months ago

Thanks for testing with Gurobi. I don't have this solver so couldn't test the default option file that I had made - based on the GAMS website 3-4 years ago. It will be great if you can share an options file that we can use as the default one in the resources folder.

akanudia commented 5 months ago

HiGHS will be available in the next update.

In the meantime, you can do the following to use it:

  1. Launch a normal run and cancel it.
  2. Open the GAMSWrk folder where the DD and RUN files reside. You can use the "open folder" button on Run manager.
  3. Edit the "casename".RUN file and replace cplex/gurobi with highs.
  4. put highs.opt in this folder.
  5. Execute VTRUN.CMD to run the model

PS: encouraged by your enthusiasm for HiGHS, I also tried it on a small model that CPLEX solves in under a minute. It took one hour to solve it :(

victor-guillot commented 5 months ago

Thank you for the reply and highs integration. I can provide suggestions with gurobi.opt if we agree on what is needed. As a starting point, I propose this basic opt file for barrier and crossover on 7 threads. I find it explicit and easily editable to simplex or deactivating crossover:

%%%%%%%%%%%% Method=2 Crossover=1 Threads=7 %%%%%%%%%%%%

I can have a look on features like scaling, iis, and translation of baralg, barorder etc, but it seems that on my cases, default is always better.

I had the same experience with highs, cplex, gurobi comparison but it seems that they are trying to make improvements: https://highs.dev/assets/HiGHS_Newsletter_24_0.pdf

akanudia commented 5 months ago

looks like cplex, gurobi, and xpress have some more money to make.

akanudia commented 5 months ago

HiGHS available under version 3.0.5