This is an old revision of the document!
How do I run GAMS in the background?
gams trnsport &
does not seem to work.
That is correct. GAMS writes directly to /dev/tty and a background job does not have access to that. The following command will do the job:
gams -lo 0 trnsport &
The log option flag tells GAMS not to write anything to the screen. An even better way is to use a small script called “gamsbatch” that reads:
#!/bin/csh -f set basename=$1:r gams $* -ll 1 -lo 2 -lf $basename.log &
This will write what normally goes to the screen to a log file instead. For example, if called as “gamsbatch trnsport”, transport.log will be created. Many GAMS systems contain this script. If not, it can be created and made executable by using “chmod +x gamsbatch”.
On some systems after you log out even background processes will get killed. On those systems use:
nohup gamsbatch trnsport
Now it is safe to log off and go home.