This guide is intended for users with no prior experience with Linux/Command Line Interface (CLI) or Cluster Computing. Refer to the User Guide for detailed information on using the Campus Cluster. New users may also benefit from viewing the Campus Cluster training videos.

Introduction

The basic building block of a Linux cluster is a node. The two primary types of nodes on a cluster are:

  • Compute nodes — these are the majority of nodes on a cluster and are the nodes that run user jobs
  • Head nodes — one or more on a cluster and where you login from your local computer (laptop/desktop)

User access to the compute nodes is only available via a batch job. This is typically a sequence of commands listed in a file called a batch script that can be executed without the intervention of the user. The batch script is a plain text file that starts with directives that describe the requirements of the job such as number of nodes and wall clock time, followed by the user’s commands to execute specific tasks or run a specific code. An interactive batch job provides a way to get interactive access to a compute node via a batch job. This is useful for testing and debugging purposes.

From the head nodes, the batch job is submitted to a queue to be scheduled to run when the compute node resources requested are available. Users can also check status, monitor progress, or delete batch jobs on the head nodes.

IMPORTANT: The head nodes on the Campus Cluster are a shared resource for all users of the system and their computational use should be limited to editing, compiling, and for short non-intensive runs. The administrators may terminate user processes on the head nodes that impact the system without warning. Users should do all production work by submitting jobs to the batch system.

Using the Campus Cluster

CC Diagram
CC User Head Node Compute Node
Connect to a head node from your local computer using an
ssh client.
  • All batch jobs run on the compute nodes.
  • Each investor group has a dedicated primary queue. There is also a shared secondary queue for opportunistic access to idle nodes, and a very short time test queue that provides quick turnaround time.

Access

Users with accounts on the Campus Cluster connect to the head nodes via SSH (Secure Shell) client using their official University of Illinois NetID and NetID password.

Linux and Mac have an ssh client installed by default. Windows does not, but a list of some popular ssh clients is available here and can be downloaded for use.

Below is a list of hostnames that provide round-robin access to head nodes of the Campus Cluster instances as indicated:

Access Method Hostnames Head Nodes
SSH cc-login.campuscluster.illinois.edu namehN
(ex. golubh1)

Note: In the examples within this beginner’s guide, My_NetID represents your official University of Illinois NetID.

SSH clients come in two formats:

    • Graphical User Interface (GUI) – when logging in from a Windows based machine.
      Windows GUI
    • Command Line Interface (CLI) – when logging in from a Linux/UNIX based system (Fedora, SuSE, Mac OS, etc…).

Linux CLI

Users are automatically connected to 1 of the 4 head nodes of the Campus Cluster and will see a similar prompt to the one listed below:

[My_NetID@golubh1 ~]$

after successfully logging into the Campus Cluster.

While logged into the Campus Cluster users interact with resources through the CLI. This means that users will need to issue commands on the command line to accomplish various tasks.

Working with the CLI

Since the Campus Cluster’s user environment is Linux based, it is essential to have a basic working knowledge of Linux to be able to compute successfully on the Campus Cluster. The information in the table below and the number available online tutorials can help new Linux users learn enough to get started.

Useful Unix/Linux Commands
Basic Comands Working with Files
Command Description Command Description
ls
ls -l
List directory contents
Detailed listing of directory contents
nano myfile Create a new (or edit an existing) file named myfile with a simple text editor
pwd Display the path of the current/working directory grep string myfile Display the lines in myfile that contain a matching pattern (string)
man command_name Display online help (manual page) for command_name cat myfile Display the entire contents of the file myfile
quota Display your home directory disk usage more myfile Display the contents of the file myfile, one page at a time
ps -u Display detailed information about your running processes cp myfile1 myfile2 Copy the file myfile1 to myfile2
exit or logout Log out of your current session mv myfile1 myfile2 Rename the file to myfile2
history Display a list of the commands you’ve recently run mv myfile mydir Move the file myfile into the directory mydir
date Display the system date and time rm myfile Delete the file myfile
mkdir mydir Create a directory named mydir
cd mydir Change the current directory to mydir
rmdir mydir Remove the directory mydir (if empty)

Linux Tutorials

Text Editing

Shell Scripting

Key word combinations such as Unix Tutorial, Linux Tutorial, Linux Text Editing, Shell Scripting, etc., can be used in any search engine to find additional information online.

Data Transfer

Users may have a need to move data between a local system and the Campus Cluster. On Windows systems, several SSH based clients provide functionality for file transfer (SCP/SFTP). The list of SSH Clients in the Data Transfer section of the Campus Cluster user guide indicates which ones support both file transfer and remote login functionality.

SCP/SFTP clients are also available in two formats: GUI and CLI.

GUI Data Transfer Examples

Generally GUI-based scp/sftp clients implement a drag and drop interface. (Recommended for beginning users)

Bitvise Tunnelier SFTP client

Bitvise Tunnelier SFTP GUI

SSH Secure Shell SFTP client

SSH Secure Shell SFTP GUI

CLI Data Transfer Examples

The CLI examples below display scp and sftp syntax for transferring files between the Campus Cluster and a local system.

scp example:

Transferring a file on your local system to your home directory on the Campus Cluster:

my_desktop% scp local_file My_NetID@cc-login.campuscluster.illinois.edu:~/

Transferring a file in your home directory on the Campus Cluster to your local system:

my_desktop% scp My_NetID@cc-login.campuscluster.illinois.edu:~/remote_file ./

sftp example:

Transferring files between your local system and the Campus Cluster:

my_desktop% sftp My_NetID@cc-login.campuscluster.illinois.edu

sftp> put local_file
sftp> get remote_file

Command line interface usage on Windows based machines may require additional configuration steps or use of specially named commands for scp and sftp. The additional CLI configuration information or usage instructions can be found in the documentation for the specific ssh client.

Editors

Text editors are used for editing plain text files. The Campus Cluster has two text editing programs: vi (and an improved version called vim) and nano.

vi/vim is one of the most commonly used text editors, however we suggest users new to working in the Linux environment start off using nano to edit text files because it may be more similar to the way users edit text files on non-linux based machines. The general syntax to begin editing a file with nano is

nano file.txt

Editor example

Use the nano text editor to create a "hello world" C program. Type the following

    [My_NetID@taubh1 ~]$ nano hello.c

to open a blank text file name hello.c. Type the program exactly as it is shown below in your nano text editing session.

#include <stdio.h>

main()
{
  printf("Hello, C World!n");

 /* The sleep() function causes the program  */
 /* to wait 90 seconds before ending.  This  */
 /* line is optional.                        */
 sleep(90);

}

When you have completed entering the C program exit the nano text editing session by holding down the control(Ctrl) key and then pressing X, which is indicated by a "^X" in the bottom left hand corner of the nano session. Exiting a nano session after editing a text file will prompt to save the changes made to the text file. To save changes without exiting the nano session hold down the control(Ctrl) key and then press O.

The same syntax is used to edit a file with vim

vi file.txt

A newer version of vim (non-default) is available and accessed via the modulefile vim.

Building Applications

The GNU Compiler Collection (GCC) is available by default for compiling source code. The general syntax to compile source code and build an application (executable) is to type the compile command followed by the source code file. For example, to build an executable for a C program named myprogram.c the syntax would be

gcc myprogram.c

A successful build will generate an executable (binary) file named a.out
that can be executed (run) by typing

./a.out

Additional information can be found in the Programming Environment section of the Campus Cluster user guide.

Build Example

To build an application using the hello.c program that was created in the editor example above, type

    [My_NetID@taubh1 ~]$ gcc hello.c

An executable file will be created named a.out. To verify that the file exists, type

    [My_NetID@taubh1 ~]$ ls -l a.out

Batch Job Submission

The head nodes on the Campus Cluster are a shared resource for all users so their computationl use should be limited to compiling and building programs, and for short non-intensive runs. Users should do all production work by submitting jobs to the batch system.

To submit jobs on the Campus Cluster, users put together a job script: a plain text file that contains special lines that describe the resources needed for the batch job. Also contained in the job script are sequential commands to execute specific tasks or run a specific code.

The job script is submitted to the batch system using the qsub command.

Job Submission Example

Job Script Creation

Use the nano text editor to create a job script. Type the following

    [My_NetID@taubh1 ~]$ nano myjob.pbs

to open a blank text file named myjob.pbs. Type the job script exactly as it is shown below in your nano text editing session.

#!/bin/bash
#
#PBS -l walltime=00:05:00
#PBS -l nodes=1:ppn=12
#PBS -N myjob 
#PBS -q secondary
#
# End of embedded QSUB options
#

# Run the hello world executable (a.out)
./a.out

When you have completed entering the job script exit the nano text editing session by holding down the control(Ctrl) key and then pressing X, which is indicated by a "^X" in the bottom left hand corner of the nano session. Exiting a nano session after editing a text file will prompt to save the changes made to the text file. To save changes without exiting the nano session hold down the control(Ctrl) key and then press O.

Job Submission

To submit a job to the batch system using the job script created above, type

    [My_NetID@taubh1 ~]$ qsub myjob.pbs

A job identification string similar to the one shown below is printed to the screen as confirmation that the job was successfully submitted to the batch system

    201103.cc-mgmt1.campuscluster.illinois.edu

Additional information regarding batch job submissions and commands can be found in the Running Jobs section of the Campus Cluster user guide. To try other types of beginner examples (MPI, OpenMP or Hybrid), please view the README.helloworld file by typing

cat /projects/consult/examples/README.helloworld

on the command line.

Batch Commands

There are a number of commands/utilities available that will report details about a batch job. Depending on the command used, status details to output of a current running job may be viewed. The numeric portion of the job identification (JobID) string or the NetID can be used to view details about a batch job. Some examples of the available commands are as follows:

To display the status of all jobs in the batch system owned by you: qstat -u My_NetID

To display details of a specific job identified by JobID: qstat -f JobID

To remove a queued job or delete a running job identified by JobID: qdel JobID

Windows Linux Compatibility

There are some issues to be aware of when transitioning between Windows systems and the Campus Cluster.

  • Linux and Windows use different formats for line breaks in text files, which can cause problems when reading Windows Notepad edited files on the Campus Cluster. For the same reason, when reading Linux created text files in Windows, Notepad will present the file in a single line. We recommend using WordPad on Windows for editing text files when transitioning between Windows systems and the Campus Cluster.
  • Unlike Windows (and also Mac OS X), Linux file and directory (folder) names are case sensitive.
  • We recommend avoiding spaces in file or directory names on Linux since it can cause problems. An option is to use a character such as “_” or “.” in place of the space in the file name before transferring to the Campus Cluster. If you do have spaces in your file names, see
    Spaces and special characters in a file name for how to deal with them.