$onText Data file for running slvtest. Option --runall=yes will include models in the skip lists (sets exsmw, exsml). $offText $offListing $include gamsmod.inc $onListing $eolCom // $onDollar $set slvcreate slvcreate.gms $set trace slvtest.txt // trace file (will be appended to) $set SLASH \ $if %system.filesys% == UNIX $set SLASH / $if not set weaktl $set weaktl 3 $if not set PREFIX $set PREFIX %system.buildcode% $if not set fail $set fail failures_slv.gms $if not set keepfail $set keepfail 0 $setNames %fail% v1 v2 v3 $set fail2 %v2%I%v3% $if %keepfail%==0 $call rm -f %fail% %fail2% $if not exist %fail% $echo "$call rm -f %fail2%" >> %fail% $echo * Failures of slvtest run started at %system.date% %system.time% >> %fail% $set cond %gams.u1% $if '%cond%' == '' $set cond 'ord(s) <= card(s)' $ifI '%cond%' == 'test' $set cond 'ord(s) = 23' $ifI '%cond%' == 'initial' $set cond '(ord(s)=1 or ord(s)=27 or ord(s)=99 or ord(s)=124 or ord(s)=131 or ord(s)=149 or ord(s)=208 or ord(s)=212 or ord(s)=248 or ord(s)=269 or ord(s)=284 or ord(s)=291 or ord(s)=311)' $ifI '%cond%' == 'big' $set cond 'big(s)' $ifI '%cond%' == 'small' $set cond 'not big(s)' $ifI '%cond%' == 'small_1' $set cond '(not big(s) and ord(s) <= 150)' $ifI '%cond%' == 'small_2' $set cond '(not big(s) and ord(s) > 150 and ord(s) <= 300)' $ifI '%cond%' == 'small_3' $set cond '(not big(s) and ord(s) > 300 )' $ifI '%cond%' == 'lic' $set licensed 1 $ifI '%cond%' == 'lic_1' $set licensed 1 $ifI '%cond%' == 'lic_2' $set licensed 1 $ifI '%cond%' == 'lic_3' $set licensed 1 $ifI '%cond%' == 'lic' $set cond 'ord(s) <= card(s)' $ifI '%cond%' == 'lic_1' $set cond '( ord(s) <= 150)' $ifI '%cond%' == 'lic_2' $set cond '(ord(s) > 150 and ord(s) <= 300)' $ifI '%cond%' == 'lic_3' $set cond '(ord(s) > 300 )' $onText initial includes: 'ord(s)=1' lp trnsport 'ord(s)=212' cns korcns 'ord(s)=27' nlp sample 'ord(s)=248' scenred srkandw 'ord(s)=124' minlp alan 'ord(s)=269' mpec nash 'ord(s)=131' mcp two3mcp 'ord(s)=284' qcp qdemo7 'ord(s)=149' mpsge kehomge 'ord(s)=291' miqcp qmeanvar 'ord(s)=208' mip absmip 'ord(s)=311' gsolver $offText $set cond1 1 $set cond2 1 $set cond3 1 $set cond4 1 $set cond5 1 $if set c1 $set cond1 sameas(s1,'%c1%') $if set c2 $set cond2 sameas(s2,'%c2%') $if set c3 $set cond3 sameas(s3,'%c3%') $if set c4 $set cond4 sameas(s4,'%c4%') $if set c5 $set cond5 sameas(s5,'%c5%') $set TESTLIM 2000 $set MYWORKSPACE 500 $set MINLPSpecial skip = ((sameas('MINLP',t1) or sameas('MIQCP',t1)) and minlpskip(s1,s2,s3)) or (sameas('MIQCP',t1) and miqcpskip(s1,s2,s3)) * s Model Sequence Numbers * m model names in alphabetic order parameter test model type summary; test(s,t) = ts(t,s); test(s,'total') = sum(t, test(s,t)); test('total',t) = sum(s, test(s,t)); *display test; test(s,'mcp' )$ts('mpsge',s) = 1; test(s, 'mpsge') = 0; * this enables looping over nlp/qcp and mip subsolvers for minlp/miqcp solvers test(s,'nlp' )$ts('minlp',s) = 1; test(s,'mip' )$ts('minlp',s) = 1; test(s,'qcp' )$ts('miqcp',s) = 1; test(s,'mip' )$ts('miqcp',s) = 1; test(s,'gams')$ts('gams' ,s) = 0; * sets below are defined in gamsmod.inc * big(s) cannot be solved with student system * notest(s) should not be used for testseries * t model types DECIS, GAMS, LP, MIP, ... $onEmpty set solver master set of solvers / alphaecp, antigone, baron, cbc, conopt3, conopt, copt, cplex dicopt, gurobi, gurobiold, highs, ipopt, ipopth, jams, knitro, lindo, miles, minos mosek, nlpec, odhcplex, path, pathnlp quadminos, sbb, scip, shot, snopt, soplex, xpress, xpressold / dsolver dummy solvers to access solvers / decisc / gsolverdet(solver) "solvers that are deterministic global for nonlinear nonconvex problems (cplex has this off by default)" / antigone, baron, copt, gurobi, gurobiold, lindo, scip, xpress, xpressold / ; alias (solver,minlpslv,nlpslv,qcpslv,mipslv); set minlpskip(minlpslv,nlpslv,mipslv) 'never use these combos for MINLP' miqcpskip(minlpslv,qcpslv,mipslv) 'never use these combos for MIQCP'; * most MINLP/MIQCP solvers do not care about GAMS options NLP/QCP/MIP to select subsolvers, so run only with default subsolvers minlpskip(solver,nlpslv,mipslv) = yes; minlpskip(solver,'%system.nlp%','%system.mip%') = no; miqcpskip(solver,qcpslv,mipslv) = yes; miqcpskip(solver,'%system.qcp%','%system.mip%') = no; * for AlphaECP, however, since MIPs can grow large, only use free MIP solvers minlpskip('ALPHAECP','%system.nlp%','%system.mip%') = yes; miqcpskip('ALPHAECP','%system.qcp%','%system.mip%') = yes; minlpskip('ALPHAECP','%system.nlp%','Cbc') = no; miqcpskip('ALPHAECP','%system.qcp%','Cbc') = no; * for DICOPT, run with all NLP solver that are not in gsolverdet and all MIP solver except for BARON, LINDO, GUROBIOLD, and XPRESSOLD minlpskip('DICOPT',nlpslv,mipslv)$(not gsolverdet(nlpslv)) = no; miqcpskip('DICOPT',qcpslv,mipslv)$(not gsolverdet(qcpslv)) = no; minlpskip('DICOPT',nlpslv,'BARON') = yes; minlpskip('DICOPT',nlpslv,'GUROBIOLD') = yes; minlpskip('DICOPT',nlpslv,'LINDO') = yes; minlpskip('DICOPT',nlpslv,'XPRESSOLD') = yes; * for SBB, run with all NLP solver that are not in gsolverdet, SBB does not solve MIPs minlpskip('SBB',nlpslv,'%system.mip%')$(not gsolverdet(nlpslv)) = no; miqcpskip('SBB',qcpslv,'%system.mip%')$(not gsolverdet(qcpslv)) = no; set ssc solver subsystem codes / 00 'GAMS/Demo' AT 'ANTIGONE' BA 'BARON' CT 'COPT' CL 'CPLEX/L' CO 'CONOPT' CM 'CPLEXPAR' CP 'CPLEX' DI 'DICOPT' EC 'ALPHAECP' FR 'FREE' GE 'MPS/GE' GU 'GUROBI' IP 'IPOPT' HI 'HIGHS' KN 'KNITRO' LD 'LINDO' LI 'LINDOGLOBAL' M5 'MINOS' MC 'MILES' MK 'MOSEK' OD 'ODHCPLEX' PT 'PATH' SB 'SBB' SN 'SNOPT' XP 'XPRESS' /; set sc(solver,ssc) / alphaecp.EC antigone.AT baron.BA (cbc,ipopt,scip,shot,soplex).00 ipopth.IP highs.00 (conopt3,conopt).CO copt.CT cplex.(CP,CM) odhcplex.OD dicopt.DI gurobi.GU gurobiold.GU knitro.KN lindo.LD miles.MC (minos,quadminos).M5 mosek.MK (path,pathnlp).PT sbb.SB snopt.SN xpress.XP xpressold.XP /; *--------! Skip lists !--------* set big50(s) 'models that do not fit into 50x50 demo limits of antigone, baron, lindo, but are not in gamsmod.inc:big' / 6, 8, 9, 10, 12, 13, 15, 16, 17, 18, 23, 28, 30, 32, 33, 34, 35, 36, 38, 39, 40, 42, 43, 45, 46, 47, 48, 49, 51, 53, 54, 56, 57, 58, 59, 61, 62, 65, 75, 80, 81, 82, 88, 86, 87, 89, 90, 92, 97, 98, 100, 103, 105, 107, 108, 113, 114, 115, 117, 118, 120, 122, 123, 125, 158, 159, 160, 161, 170, 171, 172, 173, 174, 175, 176, 178, 179, 180, 182, 186, 191, 193, 194, 204, 207, 209, 210, 211, 212, 213, 217, 218, 219, 220, 221, 222, 223, 225, 226, 227, 228, 230, 231, 232, 238, 239, 242, 246, 249, 251, 252, 253, 254, 263, 268, 270, 271, 272, 283, 284, 293, 306, 310, 312, 323, 324, 328, 331, 344, 345, 346, 350, 352, 371, 373, 376, 379, 383, 384, 387, 395, 401, 402, 410, 431, 432, 433, 435 /; set big300(s) 'models that do not fit into the 300x300 demo limits of knitro, but are not in gamsmod.inc:big' / 6, 13, 17, 30, 34, 35, 49, 54, 57, 62, 75, 86, 87, 89, 90, 97, 107, 123, 134, 137, 173, 184, 186, 210, 211, 222, 229, 236, 238, 239, 242, 251, 252, 253, 254, 321, 323, 328, 329, 346, 379, 395 / set exm(s) exclusion list for model / /; exm(deprecated(s)) = yes; set exS(solver) exclusion list for solvers / /; set exsmd(s,solver) model solver combination that deserve exclusion / (95,387,395).(cplex, odhcplex, mosek, xpressold) 'do not support QCPs that are not SOCP-representable so far' 296.mosek 'nonconvex MIQP (cplex etc. can do nonconvex products of binaries)' (382,392).lindo 'Lindo does not solve equilibrium EMPs' (321,423).(antigone,baron,gurobi,gurobiold,lindo,scip,xpress,xpressold) 'there is no point in doing a stochastic searches with a global solver' (398,399,400).(baron,pathnlp) 'GUSS requires a solvelink 5 solver' 423.pathnlp 'GUSS requires a solvelink 5 solver' 424.miles 'GUSS requires a solvelink 5 solver' 205.minos 'cycling: expand frequency (see useopt3) does not help, #1700 wontfix' (139*156,304).knitro 'knitro does not support MPSGE' 267.(scip,xpress,xpressold) 'may not terminate with one of the expected solutions' 328.baron 'danwolfe model cannot handle when LP solver does not return marginals for master' /; // end exsmd * solnpool (326) sets the MIP solver hard to CPLEX exsmd('326',solver)$(not sameas(solver, 'cplex')) = yes; * dicegrid (330) sets the MIP solver hard to CPLEX exsmd('330',solver)$(not sameas(solver, 'cplex')) = yes; * ccoil (370) has its own logic to set the MIP solver exsmd('370',solver)$(not sameas(solver, 'cplex')) = yes; * solmpool (394) sets the MIP solver hard to CPLEX exsmd('394',solver)$(not sameas(solver, 'cplex')) = yes; * asyncjobs (403) sets the MIP solver hard to GUROBI exsmd('403',solver)$(not sameas(solver, 'gurobi')) = yes; * quadminos is a slow LP solver, so run only on small models exsmd(s,'quadminos')$big(s) = yes; * model has dicontinuities all over the place, run only with Lindo for now exsmd('407',solver)$(not sameas(solver, 'lindo')) = yes; * model has dicontinuities all over the place exsmd('408',solver)$(not sameas(solver, 'lindo')) = yes; exsmd('409',solver)$(not sameas(solver, 'lindo')) = yes; * cbenders (415) sets the MIP solver hard to CPLEX and SCIP exsmd('415',solver)$(not sameas(solver, 'cplex')) = yes; $ifThen not set licensed * skip models that hit the 50x50 demo limit of antigone, baron, and lindo * (TODO for lindo, this limit applies only to nonlinear models, not LP or MIP) exsmd(big50,'antigone') = yes; exsmd(big50,'baron') = yes; exsmd(big50,'lindo') = yes; * skip models that hit the 300x300 demo limit of knitro exsmd(big300,'knitro') = yes; $endif set exsmw(s,solver) waiting for fix / $if %system.buildcode% == DAC 379.cplex 'hangs when multithreading is enabled, #5816' $if %system.buildcode% == DAC 233.antigone 'hangs, #6505' $if %system.buildcode% == LAG 327.knitro 'crash #6762' $if %system.buildcode% == WEI 433.odhcplex 'returned solution is infeasible #6978' 35.baron 'wrong marginals from BARON lead to division by zero' 239.pathnlp 'pathnlp ends with 13/13 due to non-sufficient lemke_rank_deficiency_iterations, #6940 (with increased lemke_rank_deficiency_iterations path still stops due to lack of progress)' 396.lindo 'finds optimal solution for infeasible final instance, see devel/products#6913' /; set exsml(s,solver) off limits / *reslim 600 without finding feasible point (28,69,81,97,100,107,122,123,209,210,211,212,223,236,238,239,240,241,346).scip 'reslim exceeded' 270.dicopt 'reslim exceeded in generated mip relaxation, or reaching maxcycles' 265.(ipopt,ipopth) 'convergence issues on DNLP' 251.knitro 'iterlim / reslim without finding feasible point' $if %system.buildcode% == DEG 410.knitro 'stuck without finding feasible point (no Knitro updates for DEX anymore)' 399.lindo 'With Lindo 15 not all scenarios can be solved within 600s reliably' 434.cbc '30s timelimit exceeded' (68,80,81,97,107,123,125,202,209,210,211,223,231,236,239,426).(xpress,xpressold) 'reslim without finding feasible point' (81,97,100,122,107,239,410).(gurobi,gurobiold) 'reslim without finding feasible point' *other limits 148.miles 'Miles iteration limit exceeded' 125.minos 'Minos writes 10GB log' 432.minos 'may stop when reaching some iteration limit' 270.sbb 'node limit exceeded on kport' 273.ipopt 'mumps may run out of memory (WEI: Problem with integer stack size)' 293.mosek 'terminated due to slow progress' (41,251,253,350).scip 'LP solver fails to solve LP' (251,253).conopt 'residuals too large, exceed Lim_Variable' 228.scip 'model evaluates log(0) with solution from scip or miles' * take long (>= 600s), but does not fail; run only in long tests $ifThen not set licensed (122,123,223,224,270).alphaecp (22,24,25,68,69,205,380,426).antigone (25,68,202,426).baron 331.cbc 331.copt (22,23,24,25,28,69,84,117,125,173,223,229,230,231,232,236,238,242,263,267,387,395).(gurobi,gurobiold) 331.highs 270.knitro (22,24,41,68,69,331,426).lindo 331.mosek (123,125,254).ipopt 123.ipopth (22,23,24,25,68,80,84,117,125,173,205,227,229,230,231,232,237,242,263,331,373,395,410,426).scip (23,123,125,204,239).snopt (24,25,28,69,117,118,122,173,224,227,229,232,237,238,242,259,263,331,373,425).(xpress,xpressold) (53,111).xpressold $endIf * take very long (>= 3000s), but does not fail; do not even run in long tests (251,253).(antigone,baron,gurobi,gurobiold,lindo,xpress,xpressold) 'lmp1 and lmp3 models take long to solve to global optimality' (47,252).antigone (24,173).baron 321.minos 'too many solves that run into 10min timelimit' 47.lindo (85,383).scip 'every or many solves run into 10min timelimit' 357.(xpress,xpressold) /; set exsm(s,solver) exclusion list for model solver combination; exsm(exm,solver) = yes; exsm(s,exS) = yes; exsm(s,solver)$exsmd(s,solver) = yes; * do not use NLPEC for any model without an MPEC/RMPEC exsm(s,'NLPEC')$[not (test(s,'MPEC') or test(s,'RMPEC'))] = yes; * BCH Models only with Cplex, and SBB exsm(s,solver)$(as('BCH',s)) = yes; exsm(s,'CPLEX')$(as('BCH',s)) = no; $if %runall%==yes $goTo dorunall exsm(s,solver)$exsmw(s,solver)=yes; exsm(s,solver)$exsml(s,solver)=yes; $label dorunall *--------! Weak test lists !--------* set weakm(s) exclusion list for model / 357 'sddp with GUSS returns (1,14) or (4,14)' 398 'gussex1 returns (1,14) because of SkipBaseCase=1' 423 'guss2dim returns (1,14) because of SkipBaseCase=1' 424 'obstacle returns (1,14) because of SkipBaseCase=1' /; set weakS(solver) 'list of weakly-checked solvers' / /; set weakMSd(s,solver) model solver combination that deserve weak check / (224,229,236,237,257*261,265, 266,388,425).(antigone,baron) 'cannot handle trigonometric functions' 111.(antigone,baron,copt,gurobi,gurobiold,scip) 'cannot handle errorf' (299,300,301,302,303,305,393).( antigone,baron,copt,gurobi,gurobiold,lindo, scip,xpress,xpressold) 'cannot handle gamma, loggamma, betareg, beta, or centropy' 265.(copt,scip,xpress,xpressold) 'cannot handle mod' 217.(antigone,baron,copt,gurobiold,xpress,xpressold) 'cannot handle signpower' (109,163,270,351,385,386).(baron,highs,mosek) 'cannot handle SOS' (23,68,259,265,426).(gurobi,gurobiold) 'function abs not supported' (184,228).miles 'Failure to converge, similar to #808, wontfix' 123.(ipopt,ipopth) 'NLP relaxation too difficult for Ipopt (run in DICOPT, SBB)' 110.ipopt 'search direction becomes too small' 110.conopt3 'initial function value too large for some instances (now leads to exit with 6/5)' (205,350).alphaecp 'MIP infeasible before finding feasible solution (14/4)' 250.snopt 'NLP relaxation too difficult for SNOPT (within SBB or DICOPT)' 239.snopt 'numerical issues within SNOPT' (236,265).minos 'current point cannot be improved' /; set weakMSw(s,solver) 'should not be here - waiting on a fix' / (123,125,223,238,250,346,380).pathnlp 'fails to solve various models (if MINLP, then as subsolver of SBB), #4182' /; set weakMSl(s,solver) off limits / (140,142,146).(path,miles) 'iterlim exceeded which on purpose is set to 0' (125,204,205).dicopt 'DICOPT hits maxcycles limit before finding feasible point' 226.dicopt 'MIP relaxation becoming infeasible with some subsolver' /; set weakMS(s,solver) 'list of weakly-checked model-solver combinations'; weakMS(weakm,solver) = yes; weakMS(s,weakS) = yes; weakMS(s,solver)$weakMSd(s,solver) = yes; $if %runall%==yes $goTo dorunallw weakMS(s,solver)$weakMSw(s,solver)=yes; weakMS(s,solver)$weakMSl(s,solver)=yes; $label dorunallw *--------! Stdout/Stderr test skip lists !--------* set noso(s) skip model for test of stdout lines / 197*200 'DECIS writes to stdout' 310 'GAMS Transfer Python future warnings from pandas 2.2 use, #6176' /; set nose(s) skip model for test of stderr lines / 329 'possibly some error messages from file cleanup when grid solves reach 100s timelimit' /; set noso2(solver) skip solver for test of stdout lines / $if %system.buildcode% == DEG shot 'cannot turn off CPLEX output completely' /; set nose2(solver) skip solver for test of stderr lines / $if %system.buildcode% == DEG shot 'cannot turn off CPLEX output completely' /; $if exist %sysenv.USRSLVTESTSKIPS% $include %sysenv.USRSLVTESTSKIPS% *--------! Option file lists !--------* $if not set optdir $set optdir slv_optionfiles $call rm -rf %optdir% && mkdir %optdir% $set optdirS %optdir%%SLASH% parameter useopt(s,solver) option file number for model solver combination / 385.mosek 385 /; parameter useopt2(s,solver,solver) option file number for model solver combination / /; parameter useopt3(s,solver,solver,solver) option file number for model solver combination / *minos cycles, #1700 206.sbb.minos.%system.mip% 899 /; $echo expand frequency 500 > %optdirS%minos.899 $onEcho > %optdirS%sbb.899 rootsolver minos subsolver minos.899 $offEcho * use tighter feastol for MIP solves to avoid problems MIP optimal value decreasing after adding cut * (some linearizations have large coefs, so that optimal value can vary quite a bit with default feastol) useopt3('206','dicopt',solver,'copt') = 206; $onEcho > %optdirS%dicopt.206 mipoptfile 206 $offEcho $onEcho > %optdirS%copt.206 FeasTol 1e-8 $offEcho * use as tight as possible integer tolerance for Mosek on bidpwl model * some test in the model expects that if one has constraints * x(b) = ... + 100000*BidPwlBin(b,3) + BidPwlSeg(b,3) + .... and BidPwlSeg(b,3) <= 50000*BidPwlBin(b,3), * then x(b) will be within 1e-6 of 0, even though BidPwlBin=1e-10, BidPwlSeg=5e-6, x=1.5e-5 is perfectly feasible, too * mosek does not allow to tighten the integrality tolerance below 1e-9, but setting it to 1e-9 seems to help already $onEcho > %optdirS%mosek.385 MSK_DPAR_MIO_TOL_ABS_RELAX_INT 1e-9 $offEcho parameter useopt4(s,solver,solver,solver,solver) option file number for model solver combination / /; parameter useopt5(s,solver,solver,solver,solver,solver) option file number for model solver combination / /; $offEmpty *--------! Create tester file !--------* sets ttt(t) temp subset of model types sss(solver) temp subset of solvers lic(solver) subset of licensed solvers; lic(solver) = sum(ssc$LicenseCodes(ssc), sc(solver,ssc)); lic(solver) $= sc(solver,'00'); alias(ttt,t1,t2,t3,t4,t5),(sss,s1,s2,s3,s4,s5); $call rm -f slvtest.inc file tester /'slvtest.inc'/, fx, pf /'pfile.txt'/; put tester; tester.lcase=1; tester.ap=1; tester.pw=500; fx.lcase=1; pf.lcase=1; * Uncomment next line to do a shorter test involving runs only with solver selected in compile time variable solvertest * Or set environment variable GSOLVERTEST to a solvername *$set solvertest conopt $if setEnv GSOLVERTEST $if not "%sysenv.GSOLVERTEST%" == "" $set solvertest %sysenv.GSOLVERTEST% put '*' / '* %system.gstring%' / '* %system.date% %system.time%' / '*' / '* SLVTEST u1=%gams.u1%' / '*' / '$onDollar' / '$echo "*" >> %trace%0' / '$echo "*" >> %trace%1' / '$echo "* %system.gstring%" >> %trace%0' / '$echo "* %system.gstring%" >> %trace%1' / '$echo "* %system.date% %system.time%" >> %trace%0' / '$echo "* %system.date% %system.time%" >> %trace%1' / '$echo "*" >> %trace%0' / '$echo "*" >> %trace%1' $if set solvertest / '$echo "* Ran with solvertest=%solvertest%" >> %trace%0' $if set solvertest / '$echo "* Ran with solvertest=%solvertest%" >> %trace%1' / '$echo "* Solvers tested:'; loop(solver$Solvers(solver), put ' 'solver.tl:0); put '" >> %trace%0' / '$echo "* Solvers tested:'; loop(solver$Solvers(solver), put ' 'solver.tl:0); put '" >> %trace%1' put / '$echo "*" >> %trace%0'; put / '$echo "*" >> %trace%1'; put / / '$set err 0'; put / '$set GAMStime 0'; put / '$set DECIStime 0'; loop(solver$Solvers(solver), put / '$set 'solver.tl:0'time 0'; ); put / '$set GAMScalls 0'; put / '$set DECIScalls 0'; loop(solver$Solvers(solver), put / '$set 'solver.tl:0'calls 0'; ); put / / '$echo Runs with more than %TESTLIM% seconds > overtime.gms' put / '$echo -------------------------------- >> overtime.gms' put / / '$echo Resource Usage per Run > resused_run.txt' put / '$echo ----------------------- >> resused_run.txt' $set mainsolver "'s1.tl:0'" $set solve1 "'t1.tl:0'='s1.tl:0'" $set solve2 "%solve1% 't2.tl:0'='s2.tl:0'" $set solve3 "%solve2% 't3.tl:0'='s3.tl:0'" $set solve4 "%solve3% 't4.tl:0'='s4.tl:0'" $set solve5 "%solve4% 't5.tl:0'='s5.tl:0'" $set folder0 "%PREFIX%_slv_'m.tl:0'" $set folder1 "%folder0%_'t1.tl:0'_'s1.tl:0'" $set folder2 "%folder1%_'t2.tl:0'_'s2.tl:0'" $set folder3 "%folder2%_'t3.tl:0'_'s3.tl:0'" $set folder4 "%folder3%_'t4.tl:0'_'s4.tl:0'" $set folder5 "%folder4%_'t5.tl:0'_'s5.tl:0'" $set restart1 "--c1='s1.tl:0'" $set restart2 "%restart1% --c2='s2.tl:0'" $set restart3 "%restart2% --c3='s3.tl:0'" $set restart4 "%restart3% --c4='s4.tl:0'" $set restart5 "%restart4% --c5='s5.tl:0'" *create slvcreate file $onEchoV > %slvcreate% put *Remove test folder if exists and create new / / '$call rm -rf %1' / '$call mkdir %1' * Copy model and related files into test folder / '$call cd %1 && gamslib -q 'm.tl:0 * Write JobStart into small txt file and create parameter file / '$echo JobStart 'm.tl:0' > %1%SLASH%slvtest.txt'isWeak:0:0 / '$echo lo=%gams.lo% al=0 ao=0 threads=%gams.threads% reslim=600 optcr=0.01 workspace=%MYWORKSPACE% jt='m.tl:0' trace=slvtest.txt'isWeak:0:0' %2 u1="%2" > %1%SLASH%pf.txt' / '$if not 'optfilenr:0:0'==0 $echo optfile='optfilenr:0:0' >> %1%SLASH%pf.txt' / '$if not 'optfilenr:0:0'==0 $call cp -f %optdir%/* %1' * Start run in test folder and save stdout and stderr $escape = / '$set before %=system.tcomp%=' / '$call cd %1 && timeout -s INT -k 2h 1h gams 'm.tl:0' pf=pf.txt 1>stdout.txt 2>stderr.txt' / '$set after %=system.tcomp%=' $escape % / '$eval time %after% - %before%' / '$echo %time% , $call =gams slvtest lo=%gams.lo% --prefix=%PREFIX% --test='m.tl:0' u1="ord(s)='s.tl:0'" --runall=%runall% %3 >> resused_run.txt' / '$eval %4time %%4time% + %time%' / '$eval %4calls %%4calls% + 1' * Apend content of small txt file to general one / '$call cat %1%SLASH%slvtest.txt'isWeak:0:0' >> slvtest.txt'isWeak:0:0'' * Remove stderr.txt and stdout.txt if empty / '$call cd %1 && test -s stderr.txt || rm -f stderr.txt' / '$call cd %1 && test -s stdout.txt || rm -f stdout.txt' * Remove stdout.txt/stderr.txt if test is skipped / '$if 'k:0:0'==1 $call rm -f %1%SLASH%stdout.txt' / '$if 'k2:0:0'==1 $call rm -f %1%SLASH%stderr.txt' * Create single test file / '$echo "$call =gams slvtest.txt'isWeak:0:0' a=gt ps=0 pw=255 lo=%gams.lo% o=slvtest.rep'isWeak:0:0' tl='trl:0:0'" > %1%SLASH%tracetest.gms' / '$echo "$if errorlevel 1 $echo error in trace level test >> trcerr.txt" >> %1%SLASH%tracetest.gms' * Run single test / '$call cd %1 && gams tracetest.gms lo=%gams.lo%' * Check three possible error files and jump to keepxxx if one exists / '$if exist %1%SLASH%trcerr.txt $goTo keep'cnt:0:0 / '$if exist %1%SLASH%stderr.txt $goTo keep'cnt:0:0 / '$if exist %1%SLASH%stdout.txt $goTo keep'cnt:0:0 * else remove folder and goto dontkeepxxx / '$echo "$call rm -rf %1" >> removedirs.gms' / '$goTo dontkeep'cnt:0:0 * if keep, create failures_slv.gms / '$label keep'cnt:0:0 / '$echo $call =gams slvtest lo=%gams.lo% --prefix=%PREFIX% --fail=%fail2% --test='m.tl:0' u1="ord(s)='s.tl:0'" --runall=%runall% %3 >> %1%SLASH%onetest.gms' / '$echoN $call =gams slvtest lo=%gams.lo% --prefix=%PREFIX% --fail=%fail2% --test='m.tl:0' u1="ord(s)='s.tl:0'" --runall=%runall% %3 >> %fail%' / '$if exist %1%SLASH%trcerr.txt $echoN " --ftrace=1" >> %fail%' / '$if exist %1%SLASH%stderr.txt $echoN " --fstderr=1" >> %fail%' / '$if exist %1%SLASH%stdout.txt $echoN " --fstdout=1" >> %fail%' / '$ifE %time%>%TESTLIM% $echo * %time% secs used by >> overtime.gms' / '$ifE %time%>%TESTLIM% $echo $call =gams slvtest lo=%gams.lo% --prefix=%PREFIX% --test='m.tl:0' u1="ord(s)='s.tl:0'" --runall=%runall% %3 >> overtime.gms' / '$eval err %err% + 1' / '$echo " --dir=%1 --keepfail=1" >> %fail%' / '$label dontkeep'cnt:0:0 ; $offEcho Set SolverCapabilitiesX(solver,t) restricted capability set; SolverCapabilitiesX(solver,t) = SolverCapabilities(solver,t); * for almost or all of the general nonlinear models, reformulation into a conic problem will fail SolverCapabilitiesX('mosek','nlp') = no; SolverCapabilitiesX('mosek','dnlp') = no; SolverCapabilitiesX('mosek','rminlp') = no; SolverCapabilitiesX('mosek','minlp') = no; display solvers, SolverCapabilitiesX; scalar isWeak, skip, cnt /0/, trl, k, k2, optfilenr; loop(sm(s,m)$(not notest(s) and %cond% and not exm(s)), ttt(t) = test(s,t); sss(solver)$Solvers(solver) = sum(ttt, SolverCapabilitiesX(solver,ttt)) and (lic(solver) or not big(s)); * Take care of big MPSGE models sss(solver)$(big(s) and ts('mpsge',s) and not LicenseCodes("GE") and SolverCapabilitiesX(solver,'MCP')) = no; $if set solvertest continue$(not sss('%solvertest%')); // skip model no use of solver %solvertest% put tester / / / '$log ===> executing ' m.tl:0 '.gms'; put / '$echo "*This file keeps track of which dirs to delete" > removedirs.gms' if(card(ttt)=0, isWeak = 0; trl$isWeak = %weaktl%; trl$(not isWeak) = %gams.tl%; cnt = cnt+1; k = noso(s); k2 = nose(s); optfilenr = 0; $batInclude %slvcreate% "%folder0%_gams" "" "" "GAMS" elseif(ts('decis',s) and not big(s) and Solvers('decisc')), isWeak = 0; trl$isWeak = %weaktl%; trl$(not isWeak) = %gams.tl%; cnt = cnt+1; k = noso(s); k2 = nose(s); optfilenr = 0; $batInclude %slvcreate% "%folder0%_decis" "" "" "DECIS" elseif card(ttt)=1, loop(SolverCapabilitiesX(s1,t1)$(not exsm(s,s1) and %cond1%), $if set solvertest continue$(not sameas('%solvertest%',s1)); // skip run %solvertest% not involved isWeak = weakMS(s,s1); trl$isWeak = %weaktl%; trl$(not isWeak) = %gams.tl%; cnt = cnt+1; k = noso(s) or noso2(s1); k2 = nose(s) or nose2(s1); optfilenr = useopt(s,s1); $batInclude %slvcreate% "%folder1%" "%solve1%" "%restart1%" "%mainsolver%" ) elseif card(ttt)=2, loop((s1,t1)$(SolverCapabilitiesX(s1,t1) and not exsm(s,s1) and %cond1%), loop((s2,t2)$(SolverCapabilitiesX(s2,t2) and not exsm(s,s2) and %cond2% and (oval(t1) 600s $if not set licensed skip = skip or (sameas(s1,'sbb') and sameas(s2,'ipopt') and sameas(s3, 'cplex') and sameas(s,'117')); $if not set licensed skip = skip or (sameas(s1,'sbb') and sameas(s2,'ipopth') and sameas(s3,'cplex') and sameas(s,'296')); $if not set licensed skip = skip or (sameas(s1,'dicopt') and sameas(s2,'conopt3') and sameas(s3,'mosek') and sameas(s,'205')); $if not set licensed skip = skip or (sameas(s1,'dicopt') and sameas(s2,'minos') and sameas(s,'123')); $if not set licensed skip = skip or (sameas(s1,'dicopt') and sameas(s2,'knitro') and sameas(s,'125')); $if not set licensed skip = skip or (sameas(s1,'dicopt') and sameas(s2,'knitro') and sameas(s,'204')); $if not set licensed skip = skip or (sameas(s1,'dicopt') and (sameas(s2,'ipopt') or sameas(s2,'ipopth')) and sameas(s3,'mosek') and sameas(s,'204')); if (not skip, trl$isWeak = %weaktl%; trl$(not isWeak) = %gams.tl%; cnt = cnt+1; k = noso(s) or noso2(s1) or noso2(s2) or noso2(s3); k2 = nose(s) or nose2(s1) or nose2(s2) or nose2(s3); optfilenr = useopt3(s,s1,s2,s3); $batInclude %slvcreate% "%folder3%" "%solve3%" "%restart3%" "%mainsolver%" ) ))) elseif card(ttt)=4, loop((s1,t1)$(SolverCapabilitiesX(s1,t1) and not exsm(s,s1) and %cond1%), loop((s2,t2)$(SolverCapabilitiesX(s2,t2) and not exsm(s,s2) and %cond2% and (oval(t1)> %fail%' put / '$call echo %err% failures in 'cnt:0:0' runs: check %fail%' put / '$echo Resource Usage per Solver > resused_slv.txt' put / '$echo -------------------------- >> resused_slv.txt' put / '$echo GAMS used %GAMStime% sec in %GAMScalls% runs >> resused_slv.txt'; put / '$echo DECIS used %DECIStime% sec in %DECIScalls% runs >> resused_slv.txt'; loop(solver$Solvers(solver), put / '$echo 'solver.tl:12' used %'solver.tl:0'time% sec in %'solver.tl:0'calls% runs >> resused_slv.txt'; ); put / / '$call grep "call" resused_run.txt | sort -nr > resused_run_sorted.txt'; putclose tester;