-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1636 from dklein-pik/develop
For Nash: after infeasibilities continue in debug mode before aborting
- Loading branch information
Showing
20 changed files
with
119 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
title;start;cm_nash_mode;cm_iteration_max;optimization;results_folder;output;cm_quick_mode;force_replace;slurmConfig | ||
testOneRegi;1;debug;1;testOneRegi;output/testOneRegi;NA;on;TRUE;--qos=priority --nodes=1 --tasks-per-node=1 --mem=8000 --time=60 --wait | ||
testOneRegi;1;1;1;testOneRegi;output/testOneRegi;NA;on;TRUE;--qos=priority --nodes=1 --tasks-per-node=1 --mem=8000 --time=60 --wait |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
# | AGPL-3.0, you are granted additional permissions described in the | ||
# | REMIND License Exception, version 1.0 (see LICENSE file). | ||
# | Contact: [email protected] | ||
name, type, reason | ||
name,type,reason | ||
cm_solver_try_max, switch, not needed | ||
pm_prtp, parameter, ??? | ||
pm_taxCO2eq, parameter, ??? | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,28 +6,30 @@ | |
*** | Contact: [email protected] | ||
*** SOF ./modules/80_optimization/nash/solve.gms | ||
|
||
regi(all_regi) = no; | ||
hybrid.solvelink = 3; | ||
regi(all_regi) = NO; | ||
hybrid.solvelink = 3; !! activate multiple-CPU mode for GAMS | ||
hybrid.optfile = 9; | ||
|
||
$ifthene.debug (sameas("%cm_nash_mode%","serial"))OR(sameas("%cm_nash_mode%","debug")) | ||
hybrid.solvelink = 0; | ||
$endif.debug | ||
if(cm_nash_mode eq 1, | ||
hybrid.solvelink = 0; !! activate single-CPU mode for GAMS | ||
); | ||
|
||
loop (all_regi, | ||
!! only solve for regions that do not have a valid solution for this nash iteration | ||
if ( sol_itr.val gt 1 | ||
AND ( p80_repy(all_regi,"modelstat") eq 2 | ||
!! only solve for regions that do not have a valid solution from the | ||
!! last solver iteration | ||
if ( ( sol_itr.val gt 1 | ||
OR s80_runInDebug eq 1) | ||
AND ( p80_repy(all_regi,"modelstat") eq 2 | ||
$ifthen.repeatNonOpt "%cm_repeatNonOpt%" == "off" | ||
OR p80_repy(all_regi,"modelstat") eq 7 | ||
OR p80_repy(all_regi,"modelstat") eq 7 | ||
$endif.repeatNonOpt | ||
), | ||
|
||
p80_repy_thisSolitr(all_regi,solveinfo80) = 0; | ||
continue; | ||
); | ||
|
||
regi(all_regi) = yes; | ||
regi(all_regi) = YES; | ||
|
||
if (execError > 0, | ||
execute_unload "abort.gdx"; | ||
|
@@ -50,30 +52,28 @@ $endif.repeatNonOpt | |
|
||
solve hybrid using nlp maximizing vm_welfareGlob; | ||
|
||
$ifthene.debug (sameas("%cm_nash_mode%","serial"))OR(sameas("%cm_nash_mode%","debug")) | ||
p80_repy_thisSolitr(all_regi,"solvestat") = hybrid.solvestat; | ||
p80_repy_thisSolitr(all_regi,"modelstat") = hybrid.modelstat; | ||
p80_repy_thisSolitr(all_regi,"resusd") = hybrid.resusd; | ||
p80_repy_thisSolitr(all_regi,"objval") = hybrid.objval; | ||
if (p80_repy_thisSolitr(all_regi,"modelstat") eq 2, | ||
p80_repyLastOptim(all_regi,"objval") = p80_repy(all_regi,"objval"); | ||
if(cm_nash_mode eq 1, | ||
p80_repy_thisSolitr(all_regi,"solvestat") = hybrid.solvestat; | ||
p80_repy_thisSolitr(all_regi,"modelstat") = hybrid.modelstat; | ||
p80_repy_thisSolitr(all_regi,"resusd") = hybrid.resusd; | ||
p80_repy_thisSolitr(all_regi,"objval") = hybrid.objval; | ||
if (p80_repy_thisSolitr(all_regi,"modelstat") eq 2, | ||
p80_repyLastOptim(all_regi,"objval") = p80_repy(all_regi,"objval"); | ||
); | ||
); | ||
$endif.debug | ||
|
||
regi(all_regi) = NO; | ||
p80_handle(all_regi) = hybrid.handle; | ||
); !! close regi loop | ||
|
||
$ifthen.parallel %cm_nash_mode% == "parallel" | ||
if(cm_nash_mode eq 2, | ||
repeat | ||
loop (all_regi$handlecollect(p80_handle(all_regi)), | ||
p80_repy_thisSolitr(all_regi,"solvestat") = hybrid.solvestat; | ||
p80_repy_thisSolitr(all_regi,"modelstat") = hybrid.modelstat; | ||
p80_repy_thisSolitr(all_regi,"resusd") = hybrid.resusd; | ||
p80_repy_thisSolitr(all_regi,"objval") = hybrid.objval; | ||
|
||
* p80_repyLatestSolve(all_regi,solveinfo80) = p80_repy(all_regi,solveinfo80); | ||
|
||
if (p80_repy_thisSolitr(all_regi,"modelstat") eq 2, | ||
p80_repyLastOptim(all_regi,"objval") = p80_repy_thisSolitr(all_regi,"objval"); | ||
); | ||
|
@@ -83,7 +83,7 @@ repeat | |
); | ||
display$sleep(5) "sleep some time"; | ||
until card(p80_handle) = 0; | ||
$endif.parallel | ||
); | ||
|
||
regi(all_regi) = YES; | ||
|
||
|
@@ -110,7 +110,8 @@ loop (regi, | |
if (p80_repy(regi,"modelstat") eq 2 OR p80_repy(regi,"modelstat") eq 7, | ||
pm_SolNonInfes(regi) = 1; | ||
); | ||
if (p80_repy(regi,"modelstat") eq 7, p80_SolNonOpt(regi) = 1); | ||
if (p80_repy(regi,"modelstat") eq 7, | ||
p80_SolNonOpt(regi) = 1); | ||
); | ||
|
||
*** set o_modelstat to the highest value across all regions | ||
|
@@ -121,14 +122,6 @@ $else.repeatNonOpt | |
= smax(regi, p80_repy(regi,"modelstat")); !! also taking into account status 7 | ||
$endif.repeatNonOpt | ||
|
||
*** in cm_nash_mode=debug mode, enable solprint for next sol_itr when last | ||
*** iteration was non-optimal: | ||
$ifthen.solprint %cm_nash_mode% == "debug" | ||
if (o_modelstat ne 2, | ||
option solprint = on; | ||
); | ||
$endif.solprint | ||
|
||
!! add information if this region was solved in this iteration | ||
p80_repy_iteration(regi,solveinfo80,iteration)$( | ||
p80_repy_thisSolitr(regi,solveinfo80) ) | ||
|
Oops, something went wrong.