GLPK/Unix Batch Execution

These scripts demonstrate running batch jobs on the Unix command line. For the sake of generality, the demonstration is divided into two parts. The first part creates a set of problem instances which are then run in a set of batch queues in the second part.

Part one consists of four scripts, tst1, tst2a, tst2b and tst3. tst1 is an awk script which creates a set of points on a line with errors in both the X and Y values. tst3 calls tst1 and either tst2a or tst2b a number of times creating a set of data files in MathProg format.

These examples are from a Solaris system where the awk(1) of The AWK Programming Language by Aho, Weinberger and Kernighan is called nawk. On other systems, this is simply awk and the prior implementation of awk is called oawk for old awk. Many Linux systems use the Gnu implementation, gawk. So minor editing of references to nawk may be required.

All of these will work with suitable minor changes on Solaris, Linux, FreeBSD, OpenBSD, MacOS X and also on Windows with the addition of one of the Unix environments such as Cygwin.

tst4 gets a list of jobs based on the file extension .dat, splits the list into 4 groups and runs them in background queues. There are many options for implementing batch queues on Unix. This is a minimalist example suited to the needs of an individual researcher using a single multicore workstation. Should you need to run a large number of long running jobs on a cluster, more full featured queueing systems should be considered.

All of the console output from glpsol is directed to log files for each queue named Q0.log, Q1.log, etc.

The MathProg model is a minor modification of cf12a.mod from the examples directory of the distribution.