Performance World [ Performance World Home | Board | Tools | PerformanceLib | Links | Gams World Forum | Search | Contact ]

Termination Routine for Ensuring Solvers Terminate at Resource Time Limit

Sometimes experimental solvers do not terminate in the prespecified time limit or at all. Running batches of models with such a solver (e.g. for performance testing) requires frequent attention (to terminate the hanging process). The GAMS/AWK program schulz.gms scans the list of processes and checks if the time (elapsed/CPU time/...) exceedes the preset limit. If the time is exceeded 'schulz' sends a terminate signal to the process. If the process still doesn't terminate and remains in the list of processes, the 'schulz' sends a more effective signal

Use of schulz.gms on Windows type operating systems requires two external programs, PsList and PsKill, available for free from Sysinternals. Download and place these into your GAMS system directory.

Users of UNIX variants need not download these as UNIX systems alreay have equivalent utilities.

Below are descriptions on how to use the utility and its command line options.

Download:





Using schulz.gms

The solver termination utility makes use of the --option to initialize environment variables from the command line. You must have a GAMS system 20.1 or later installed. See the GAMS 20.1 release notes for details on this feature.

The general command for schulz.gms is:


   >>gams schulz --watch=(process to watch) --time=(type of time monitored)
              --sleep=(frequency of checking in sec) 
              --resseq=(list of times where action is required - in seconds separated by a colon :)
              --sigseq=(list of corresponding signals to send to the processes - separated by a colon :) 


The options --trace1 and --trace2 are required inputs. All of the other --options are optional, that is if ommitted they are set to default options as described in the next section. A sample call is:

   >>gams schulz --watch ^gms --time etime --sleep 60 --resseq 120:180:240 
              --sigseq 2:1:9 
   

These are the schulz.gms default parameters. A 'schulz' job is terminated with Ctrl-C.

Top



List of schulz.gms --options and defaults


Required Inputs:

Option Input Type Description Default
--watch Text Process names to watch. Argument is a regular expression. ^gms
--time Text Type of time that should be monitored (PC: etime/cputime/kerneltime, Unix: every 'time' column accessible with -o for ps) (in seconds) etime
--sleep Integer Frequency of checking (in seconds) 60
--resseq Integers, seperated by : List of times where action is required (in seconds separated by :) 120:180:240
--sigseq Integers, seperated by : List of corresponding signals to send to the processes (separated by :). Try "man signal" on Unix for more information. 2:1:9

Top