scensol6.gms : Test execute_loadhandle for GUSS/GRID

Description

There are different ways to collect the handles of Grid jobs. This tests makes
sure that function execute_loadhandle works when GUSS and Grid are used
together.

Contributor: Lutz Westermann, March 2015


Small Model of Type : GAMS


Category : GAMS Test library


Main file : scensol6.gms

$title Test execute_loadhandle for GUSS/GRID (SCENSOL6,SEQ=680)

$onText
There are different ways to collect the handles of Grid jobs. This tests makes
sure that function execute_loadhandle works when GUSS and Grid are used
together.

Contributor: Lutz Westermann, March 2015
$offText


$call gamslib -q gussgrid

$onEcho >> gussgrid.gms

resultantx(s,i,j) = 0;

loop(cpu,
   gs(s) = scpu(cpu,s);
   Solve transport using lp minimizing z scenario dict;
   h(cpu) = transport.handle );    // save instance handle
option sys1=1;
* we use the handle parameter to indicate that the solution and the scenario
* results have been collected. By default (change with option solveopt) we do
* a merge of the solution and scenario results
repeat
   loop(cpu$(h(cpu)<>0 and handlestatus(h(cpu))=2),
      transport.handle = h(cpu);
      execute_loadhandle transport;
      h(cpu) = 0 ) ;    // indicate that we have loaded the solution
   display$sleep(card(h)*0.2) 'was sleeping for some time';
until card(h) = 0 or timeelapsed > 30;  // wait until all models are loaded

option xcollected<resultantx;
abort$(card(xcollected)<>card(ScenariosToRun)) 'not all scenarios collected with execute_loadhandle',
                                                xcollected, resultantx;
$offEcho

$include gussgrid.gms