May the source be with you, but remember the KISS principle ;-)
Home Switchboard Unix Administration Red Hat TCP/IP Networks Neoliberalism Toxic Managers
(slightly skeptical) Educational society promoting "Back to basics" movement against IT overcomplexity and  bastardization of classic Unix

Submitting interactive jobs (qsh)

News SGE Commands Recommended Links SGE cheat sheet Reference SGE Submit Scripts Submitting binaries in SGE
qstat qhost qping qacct qmod qalter qrsh
Creating and modifying SGE Queues Getting information about hosts Monitoring and Controlling Jobs Monitoring Queues Starting and Killing Daemons    
SGE hostgroups Creating and modifying SGE Queues SGE Execution Host Installation SGE Parallel Environment Tips Humor Etc

sge-howto – Universität Innsbruck

The submission of interactive jobs is useful in situations where a job requires some sort of direct intervention. This is usually the case for X-Windows applications or in situations in which further processing depends on your interpretation of immediate results. A typical example for both of these cases is a graphical debugging session.

Note: Interactive sessions are particularly helpful for getting acquainted with the system or when building and testing new programs.

The only supported method for interactive sessions on the cluster is currently to start an interactive X-Windows session via the SGE's qsh command. This will bring up an xterm from the executing node with the display directed either to the X-server indicated by your actual DISPLAY environment variable or as specified with the -display option. Try qsh -help for a list of allowable options to qsh. You can also force qsh to use the options specified in an optionfile with qsh -@ optionfile. A valid optionfile might contain the following lines:

# Name your job
-N my_name

# Export some of your current environment variables
-v var1[=val1],var2[=val2],...

# Use the current directory as working directory

Interactive jobs are not spooled if the necessary ressources are not available, so either your job is started immediately or you are notified to try again later. Also, interactive jobs will always fail if the implemented transient slot limits (see the section "Slot limitations" in the resource requirements and limitations tutorial for more information) are exceeded. In such cases, submit your interactive session with the option

qsh -now n [...]

Note: Make sure to end your interactive sessions as soon as they are no longer needed!

2.1 Interactive sequential jobs

Start an interactive session for a sequential program simply by executing


Prepare your session as needed, e.g. by loading all necessary modules within the provided xterm and then start your sequential program on the executing node.

2.2 Interactive parallel jobs

For a parallel program execute

qsh -pe parallel-environment number-of-slots

with the SGE's parallel environment of your choice (see the list of available parallel environments with qconf -spl) and the number of processes/threads you intend to use. This is no different from submitting a parallel job with qsub.
Start your parallel MPI program as depicted within the files for parallel MPI batch jobs above. For OpenMP jobs export the OMP_NUM_THREADS variable with export OMP_NUM_THREADS=$NSLOTS and start your job.