|
Running Jobs in the Background on GalileoWhen 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:
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.
|