HelpdeskNewsWelcome!hhahn @ 2005-05-01 12:54:13Welcome to the new Helpdesk! Though not much has changed, it has been re-organized a little and better integrated with the HOWTOs content at an easier-to-remember URL. We hope you find the changes are an improvement. |
Running Jobs in the BackgroundMany of the programs available on our systems for bioinformatics can take a considerable amount of time to run. Some may take days or even weeks to complete their analysis. For this reason, it may be desirable to place such jobs "in the background." This is a way of running a program that allows you to continue working on other tasks (or even log out) while still keeping the program running. Furthermore, backgrounded jobs are not dependent on your session remaining open, so even if your computer crashes, your job will continue uninterrupted. NOTE! Due to problematic interactions between OpenMosix kernels and threading used by perl/python/java, you may experience strange and random segfaults when running programs written in these languages. Please use the -g option to bgrun for such programs to prevent them from running on OpenMosix nodes. There is one consideration you should keep in mind when you're planning to run a job in the background - is it interactive or non-interactive? Interactive jobs require you to provide input after you enter the command. An example of an interactive job is the passwd command - after you enter the command, you have to answer some prompts (ie your password). A non-interactive job is one that doesn't require any further input after entering the command. An example is the ls command - after you enter the command, it does its thing, and then ends.
Non-interactive Jobs
Non-interactive jobs are easy to run in the background and there are several ways to go about it. The best method for most cases is to use the
After invoking the command, you will be given some information about the job you just submitted, including the identifier and where the output of the program (if any) will go.
You can check on the status of your submitted jobs by entering the following command:
If your command generates output normally, you can also preview that output by looking at the output file using the
When the job has completed running, you will no longer see the job listed via the Once the job is running in the cluster queue, you do not have to remained logged in. You can log out and your job will continue to run.
The Interactive JobsInteractive jobs are harder to run in the background, since if they are running in the background, there is no way for it to receive input from you. However, some interactive programs can be made to run in a non-interactive way. Some, for example, allow you to answer all prompts as a series of command-line options. If this is possible, then you should investigate the options required to do this and then run the command non-interactively.
Other commands can accept input from a file instead of from your direct input. In these cases, you would put all of the answers you would type during the interactive run into file and then "pipe" these answers into the program via input redirection, eg
If there is no way to make a program run in a non-interactive fashion, you can essentially background your entire session using the At this point, you can log out.
To re-attach your session, enter By hhahn at 2005-02-09 16:20 | printer-friendly version
|