Child pages
  • Getting Started
Skip to end of metadata
Go to start of metadata

Batch script mode

Batch scripts are files which contain series of instructions to be interpreted and executed, one line at a time; they can be thought of as a pre-arranged series of terminal commands. The normal way of using our HPC facilities is through batch scripts and our resource manager, LSF. We can perform simple operations while connected to the HPC machines, but CPU-intensive tasks will demand that we submit them through a batch script.

We recommend using Linux as the operative system in your local machine. Other Unix-based systems (such as iOS) are also widely compatible. Connecting from a Windows machine is more complicated and will need a ssh/sftp client such as PuTTY.

To log onto our machines from a terminal:

ssh -p2122

If you are going to transfer files you can use scp or sftp.

scp -P 2122 [local files][path to your folder]
sftp -P 2122

You can also use FileZilla as a cross-platform sftp client.

To launch a batch job, you need to produce a shell script. You can use terminal editor vim:

vim yourscript.lsf 

You can find examples of LSF scripts for many applications in their application pages.

To submit a job to the queue system, use

bsub < yourscript.lsf

You can also specify LSF parameters as command options (command-line options override script options), for instance

bsub -q short -m pirineus < yourscript.lsf

To check the status of your jobs, use


Each job in the LSF queue system is identified by a JobID number. To view more details about a job, use

bjobs -l [JobID]

You can also cancel a pending or running job:

bkill [JobID]

To log-out from the machine, type "exit" or press Control+D.

Interactive mode

Interactive mode allows us to introduce instructions from the terminal in real time, and follow their execution, as opposed to instructions in a batch file. Interactive mode is most suited to compiling, testing and debugging your code, or for complex sets of instructions where you need to inspect the intermediate results or states. Unlike normal logging-in, interactive sessions do spend computational hours, according to the CPU time they use.

To run an interactive session, first connect to the login nodes:

ssh -p2122

A wrapper is provided for the command to launch an interactive session, "interactiu". It is essentially similar to a bsub command, so you can use any of the standard command-line options for bsub. For instance:

interactiu -n 4 -m pirineus -q short

will run an interactive session, using 4 CPUs, on pirineus, on the short queue. This is the typical set up for compilation.

Please note that interactive sessions are still jobs managed by the LSF system, and that they will be on queue until suitable resources can be gathered - make sure to check queue and host availability to avoid endlessly waiting for your interactive session to go through.

To exit the interactive session, simply use


If you plan on compiling, please use the corresponding modules (in the Tools section). To see the modules available in a certain machine use

module avail

For instance, to work with Intel Composer 2015 on pirineus, we'd use

module load intel/comp_xe_2015

And, to correctly set up the environment variables,

source /prod/intel/composer_xe_2015/composer_xe_2015.2.164/bin/ intel64

Intel compilers and tools are now ready to use.

  • No labels