An Introduction to Linux Clusters
Course for the University of Costa Rica.
San Jose, Costa Rica.
Feb 27 – Mar 3 2006.
Instructor:
Edgar A. Leon, MS
Computer Science Department
University of New Mexico
Syllabus
This is a “hands on” course for building and programming a small cluster of Linux workstations. The course is divided into two parts: (1) Cluster Development, and (2) Cluster Programming and Applications.
Part I focuses on the development of a small Linux cluster. In this part I will cover:
- Installation, configuration and setup of a Linux cluster.
- Installation, set up and usage of a parallel programming environment.
Part II focuses on a programming environment for a Linux cluster. In this part I will cover:
- Parallel programming fundamentals for scientific computing.
- An introduction to the Message-Passing Interface standard (MPI) [MPI].
- Use the cluster to run real-world parallel applications.
Schedule
- Monday: Configuration and setup of a Linux cluster.
- Set up of master node and slave nodes. Most of the cluster's configuration reside in the master node (head node). Slave nodes obtain their configurations from the master.
- Class will be divided in small groups to configure a “mini-cluster”. Every mini-cluster will act as one parallel computer.
Requirement: Linux fundamentals
- Tuesday: Installation and set up of parallel programming environment.
- We will be using an MPI implementation [MPICH] and tools to create, build, launch and run parallel programs.
- Create, build and run a “hello world” program in the cluster.
- Assemble two small clusters of 4 to 8 nodes each depending on node availability.
Requirement: Linux fundamentals
- Wednesday: MPI Basics.
- Introduction to parallel programming
- What is MPI?
- Writing, compiling and running MPI programs
- Point-to-point operations
Requirement: C programming fundamentals
- Thursday: Intermediate MPI.
- Collective Operations
- MPI Groups, Contexts and Communicators
Requirement: MPI fundamentals
- Friday: Running Parallel Benchmarks and Applications.
- Build and run the NAS Parallel Benchmarks NPB2 [NPB].
- Build and run other parallel applications [FFTW].
Requirement: MPI fundamentals
Monday: Configuration and setup of a Linux cluster
- Hardware setup
- Divide class into groups.
- Every group will have one master node connected through cross-over cable to one client.
- Sofware setup
- Install Linux on all nodes.
- IP address assignment.
DHCP server/client. - Export users' profiles to clients.
Define users through LDAP server/client [LDAP]. - Authentication of remote users.
Use PAM to grant ssh access to LDAP users [LDAPAuth].
Tuesday: Installation and set up of parallel programming environment
- Sofware setup (cont.)
- Export user accounts.
NFS server setup//etc/fstabclient setup - Assign names to clients.
DNS,/etc/hosts - Configure password-less ssh.
Public/private key setup
- Putting the cluster together
- Divide class in two groups. Every group will set up a cluster of 4 to 8 nodes using the tools learned.
- Parallel programming environment
- Download MPICH
- Configure, build and install MPICH
- Build and run a simple MPI program
- Run the program in the whole cluster
Wednesday: MPI Basics
- Introduction to parallel programming
- Shared memory vs distributed memory
- SIMD, MIMD and SPMD
- Message-Passing
- Point-to-point and collective operations
- Cooperative vs one-sided operations
- MPI
- A specification not an implementation or library
- Six function MPI
MPI_InitMPI_FinalizeMPI_Comm_sizeMPI_Comm_rankMPI_SendMPI_Recv
- Collective Operations
MPI_Bcast
- Assignments
- Broadcast by ring [Gropp]
- Broadcast using MPI_Bcast
Thursday: Intermediate MPI
- MPI
- Collective Operations (cont)
MPI_ReduceMPI_AllreduceMPI_GatherMPI_ScatterMPI_Allgather
- Assignments [Pacheco]
- Dot Product
- Matrix-vector multiplication
- Matrix-matrix multiplication
Friday: Running Parallel Benchmarks and Applications
We will use two parallel applications.
- The NAS Parallel Benchmarks [NPB2]. NPB are a small set of programs designed to help evaluate the performance of parallel supercomputers. The benchmarks are derived from computational fluid dynamics (CFD) applications.
- [FFTW] is a C subroutine library for computing the discrete Fourier transform (DFT) in one or more dimensions, of arbitrary input size, and of both real and complex data.
References
- [MPICH] A Portable Implementation of MPI
- [Gropp] An MPI Tutorial
- [Pacheco] Parallel Programming with MPI. Peter S. Pacheco. Morgan Kaufmann.
- [LDAP] Using OpenLDAP
- [LDAPAuth] LDAP Authentication for Linux
- [NPB2] NAS Parallel Benchmarks
Links
- Building Linux Clusters. David Spector. O'Reilly.
- Using MPI. Portable Parallel Programming with the Message-Passing Interface.William Gropp, et.al.