conopt02.gms : CONOPT test suite - multi-thread test

Description

Tests multi-threaded function evaluation of CONOPT4.

Contributor: Renke Kuhlmann, February 2021


Small Model of Type : GAMS


Category : GAMS Test library


Main file : conopt02.gms

$title 'CONOPT test suite - multi-thread test' (CONOPT02,SEQ=852)
$if not '%GAMS.nlp%' == '' $set solver %GAMS.nlp%
$if not set solver         $set solver conopt4
$onText
Tests multi-threaded function evaluation of CONOPT4.

Contributor: Renke Kuhlmann, February 2021
$offText

$if not set DEMOSIZE      $set DEMOSIZE   0
$if not %DEMOSIZE% == 0   $exit

Set i / 1*100000 /;
Variable x(i), z;
Equation e(i), obj;

e(i)$(ord(i)>1).. sqrt(x(i) - x(i-1)) =E= 1;
obj.. z =E= x('100000');

x.lo(i) = 1e-4;
x.up(i) = 10;
x.l(i) = 1;
x.fx('1') = 0;

Model m / all /;
option threads = 2;
Solve m using NLP minimizing z;

abort$(m.modelstat <> %modelStat.optimal% and m.modelstat <> %modelStat.locallyOptimal%) 'Wrong model status';
abort$(m.solvestat <> %solveStat.normalCompletion%) 'Wrong solve status';
abort$(abs(z.l - 1) > 1e-6) 'Wrong optimal objective';
abort$(sum(i, abs(x.l(i) - 1) > 1e-6) > 1) 'Wrong optimal solution';