Kahibaro
Discord Login Register

Operating Systems and the Linux Environment

Goals of this Chapter

By the end of this chapter, you should be able to:

Details for topics that have their own sections later (e.g., “Environment modules” under both this chapter and “Reproducibility and Software Environments”) will only be introduced here and explored more fully in their dedicated chapters.

Operating Systems in HPC: Why Linux?

Most modern HPC systems run a variant of Linux. This is not accidental; it follows from several practical needs in large-scale computing:

In practice, HPC clusters are usually built on top of specialized Linux distributions or derivatives (e.g., CentOS/AlmaLinux/Rocky Linux, Ubuntu LTS, SUSE, or vendor-specific HPC stacks). They are tuned for:

Working in a Linux Shell on HPC Systems

HPC users typically interact with the system via a shell (command-line interface), not a graphical desktop. Even if you have used Linux on a laptop with a graphical desktop, an HPC cluster is usually accessed as a remote text-based environment.

Remote Access: SSH

To reach the HPC system, you normally connect from your local machine to a login node using ssh (Secure Shell). A typical connection command has the form:

ssh username@cluster.example.edu

Key characteristics:

Graphical or file transfer tools often use SSH under the hood (e.g., scp, sftp, or GUI tools like WinSCP or MobaXterm).

The Shell Environment

When you log in, you are placed in a shell such as bash or zsh.

Key ideas relevant for HPC:

Filesystems and Directory Structures in HPC Linux

While the detailed operation of parallel filesystems is covered elsewhere, it is important to understand how directories are typically organized on a Linux-based HPC cluster and what this implies for your day-to-day work.

Key Directories

Some common top-level directories:

The exact names and policies vary between clusters; always consult your site’s documentation.

Your Home Directory

Common properties on HPC clusters:

Working (Scratch) Directories

High-performance work often happens in a scratch or work space:

A common workflow is:

  1. Prepare job scripts and small inputs in your home or project directory.
  2. Copy or link data to a scratch area.
  3. Run computational jobs there.
  4. Copy essential results back to home or project space.

Permissions and Multi-User Considerations

Linux access control on HPC systems is a key part of the multi-user environment:

Typical patterns:

Details of Linux permissions and advanced group management belong in more basic Linux tutorials, but as an HPC user, you must be aware that:

Basic Linux Command Line Usage in an HPC Context

You will commonly use a subset of Linux commands focused on:

The specific command names and behavior are standard Linux; what is particular to HPC is how and where you use them.

Navigation and File Management

Core commands you will likely use daily:

Some HPC-specific considerations:

Viewing and Editing Text Files

Most of your interaction with code and job scripts will be via text files. Common tools include:

On HPC clusters, you often edit:

Because many clusters are accessed over relatively slow network connections:

Managing Processes on Login Nodes

While full job scheduling is covered later, there are some important rules and common commands on Linux login nodes:

Common commands:

For any long or CPU-intensive work, you should use the job scheduler instead of running directly on the login node.

Software Installation Concepts on HPC Linux

Unlike a personal Linux machine, an HPC cluster usually does not allow users to install software system-wide with sudo or the system package manager. Instead, software management is structured differently to support:

System-Wide vs User-Level Software

Two broad levels of software on an HPC Linux system:

  1. System-provided software (managed by administrators):
    • Core compilers.
    • MPI libraries.
    • Math and scientific libraries.
    • Popular applications (e.g., GROMACS, LAMMPS, VASP, etc., depending on the site).
    • Job scheduler commands.
  2. User-installed software (within your home or project directories):
    • You build and install software in a directory you control, such as:
      • ~/software
      • /project/mygroup/software
    • You adjust your environment (PATH, LD_LIBRARY_PATH, etc.) to use these.

Interaction between these levels is typically managed through environment modules.

Package Managers and Build Systems

Although you cannot use system package managers like apt or yum on the cluster (because you lack administrative privileges), you may see:

Compilers and build systems (e.g., make, cmake) are standard Linux tools, but used in combination with environment modules and job-scheduler-friendly workflows.

Environment Modules (Overview)

Environment modules provide a flexible way to select which compilers, libraries, and applications you want to use in your current shell session. They are particularly important in HPC because:

Common module systems include:

Typical commands:

Internally, modules adjust environment variables such as:

This chapter only introduces the concept. A later chapter on Environment modules and on Reproducibility and Software Environments will cover:

The Linux Environment in Batch and Interactive Jobs

Once you start using the job scheduler (discussed later), you interact with Linux in two main modes:

In both cases, job scripts often:

The Linux environment inside these jobs is closely related to your login environment, but not identical:

Understanding these differences is crucial for debugging problems where applications behave differently when run interactively vs under the scheduler.

Best Practices for Working in the Linux HPC Environment

To use the Linux environment on an HPC system effectively and politely:

These habits make it easier to transition from basic Linux usage to more advanced HPC workflows that rely on job scheduling, parallel programming, and performance optimization.

Views: 22

Comments

Please login to add a comment.

Don't have an account? Register now!