Galileo Home Page  

Overview

User Guide

Available Software

FAQ

Help

About

     

Running Jobs in the Background on Galileo

When you are running a program that you expect to take a long time to complete, it's best to run it 'in the background'. This means that the program is no longer dependent on input from you, and no longer expects you to be watching its output. Thus, once the job has been put into the background, you are free to log out, and can log back in later and check on the progress of your job. There are several advantages to puting jobs in the background:
  • First of all, if a job is not running in the background it may be terminated prematurely by the system's autologout feature. Login sessions are automatically terminated if you don't type anything for two hours. If you have started running a program, and are just waiting for it to complete, the program will die when the system automatically logs you out. You can avoid this by running the program in the background.
  • Running your program in the background also lets you go on and do other things in your login session, without having to wait for the program to finish.
  • When a program is running in the background, you can easily log in from anywhere and check on its progress.
  • If a program is not running in the background, it may be terminated prematurely if anything interferes with your connection to Galileo. For example, a power outage in your lab, an accidentally-bumped power switch, or any of the all-too-usual problems that cause us to have to reboot our MS Windows and Apple Macintosh computers.
Here's how to run a job in the background. Let's take the most general case. Say you have a program called 'myprog' that (a) requires some arguments on the command line, (b) requires some input from the user when it's run and (c) produces some output at the terminal. If we were NOT running the job in the background, we might start it by typing:
		myprog arg1 arg2 arg3
	
(where 'arg1', etc., are the command-line arguments required by myprog), answering some questions and then waiting for the program to spit out its output. To run the program in the background, we would instead type something like this:
		myprog arg1 arg2 arg3 < myprog.input >& myprog.log &
	
The file myprog.input should contain any text that you would normally type in response to questions asked by 'myprog'. The file myprog.log will catch any error messages or other output that myprog would normally send to the terminal. The final '&' is the final requirement: this tells the operating system to spawn off a new process in the background for running myprog.

After you've done this, you can log out or go on to doing something else. You can log in later and check on the progress of your program by looking at the contents of the myprog.log file. To see if your job is still running, type 'show process userid', where 'userid' is your userid (e.g., 'mst3k'). This will give you a list of all your processes on all of Galileo's nodes. If you need to kill a process (because you've decided it's doing the wrong thing, for example), you can ssh to the node on which it's running, then use the command 'kill -9 pid' (where 'pid' is the process ID of the process you want to kill, as shown in the third column of the 'show process' output).

For some special notes about running Maple jobs in the background, look here. Similar considerations apply to Mathematica jobs.


 
 
For More Information about Galileo, contact Bryan Wright.