Indiana University
University Information Technology Services
  
What are archived documents?
Login>>
Login

Login is for authorized groups (e.g., UITS, OVPIT, and TCC) that need access to specialized Knowledge Base documents. Otherwise, simply use the Knowledge Base without logging in.

Close

In Unix, how do I avoid errors with interactive commands when I submit batch jobs?

Note: Big Red is scheduled to be retired from service September 30, 2013. Indiana University is replacing it with Big Red II, the fastest university-owned supercomputer in the nation, capable of performing one quadrillion floating-point operations per second (1 petaflop). For more, see Big Red II at Indiana University. No new Big Red accounts will be created after May 3, 2013. If you have a Big Red account as of May 3, you will still be able to access and use Big Red until your account is migrated to Big Red II. If you have questions or concerns contact the High Performance Systems group.

Batch queuing systems, such as LoadLeveler, TORQUE, and Portable Batch System (PBS), use certain shell scripts (e.g., .profile, .cshrc, or .login) to initialize batch jobs. When a job is set to run in batch mode, any interactive commands (or commands that require a terminal, such as stty) in those shell scripts will fail and produce error messages. To avoid such errors, you can modify your shell script with an if statement that skips specific commands whenever a batch queuing system is in use. The script you modify and the syntax of the particular if statement you create will depend on the shell and computer you are using.

For example, if you are using the sh, ksh, or bash shell on Big Red at Indiana University, insert the following if statement into your .profile file:

if [ "$LOADLBATCH" != "yes" ] then <stty or other interactive commands> fi

The above if statement checks for the LOADLBATCH environment variable; if the variable isn't defined, then stty (and any other commands you specify) will execute.

For more about running batch jobs on Big Red, see Batch jobs on Big Red.

Alternatively, if you are using the csh shell on a system that uses PBS for job submission, insert the following if statement into your .login file:

if ( ! "$PBS_ENVIRONMENT" ) then <stty or other interactive commands> endif

The above if statement checks for the PBS environment variable ($PBS_ENVIRONMENT); if the variable isn't defined, then stty (and any other commands you specify) will execute.

For information about job schedulers on Extreme Science and Engineering Discovery Environment (XSEDE) digital services, see On XSEDE compute systems, what applications are used for scheduling jobs?

This document was developed with support from National Science Foundation (NSF) grant OCI-1053575. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the NSF.

This is document actj in domains all and xsede-all.
Last modified on February 12, 2013.

I need help with a computing problem

  • Fill out this form to submit your issue to the UITS Support Center.
  • Please note that you must be affiliated with Indiana University to receive support.
  • All fields are required.



Please provide your IU email address. If you currently have a problem receiving email at your IU account, enter an alternate email address.

I have a comment for the Knowledge Base

  • Fill out this form to submit your comment to the IU Knowledge Base.
  • If you are affiliated with Indiana University and need help with a computing problem, please use the I need help with a computing problem section above, or contact your campus Support Center.