Interactive Batch Jobs

From Hpc

Jump to: navigation, search

The following text assumes familiarity with the contents of the documents BatchSystemIntroduction and BatchSystemNetworking.

Interactive jobs with the batch system

In addition to submitting work for automatic execution, the batch system supports interactive sessions. The only differences between an interactive batch session and an 'ordinary' one, are that

  • Output and error messages are not placed in files after job termination
  • Only the #PBS resource specifications of the batch script is used; all commands in the file are ignored.
  • Programs may interact with the user during their run time
  • Programs may connect to an X11-server and open windows with graphical user interfaces

In order to get an interactive batch job, create a batch script file listing your requirements (or use one you already have), and submit it with the command

qsub -I MyScript.pbs

When the job starts, your session will be set to a shell in which you can run commands on the node which would normally execute your batch script. You can then use this shell freely, running programs and connecting to the allocated node set within an environment identical to that of an ordinary batch script. The batch job will terminate when the interactive session exits (e.g. with the exit command).

Quick and dirty interactive sessions

For a one-time resource specification which will not be used again, it is possible to omit the creation of a file, and simply specify resource demands on the command line. E.g., the command

qsub -I -l nodes=1 -q express -N interactive_job

will directly submit an interactive single-node job named "interactive_job" to the express queue.