The OSCAR Cluster System

Slides:



Advertisements
Similar presentations
MPI Basics Introduction to Parallel Programming and Cluster Computing University of Washington/Idaho State University MPI Basics Charlie Peck Earlham College.
Advertisements

The OSCAR Cluster System Tarik Booker CS 370. Topics Introduction OSCAR Basics Introduction to LAM LAM Commands MPI Basics Timing Examples.
Chapter 3. MPI MPI = Message Passing Interface Specification of message passing libraries for developers and users –Not a library by itself, but specifies.
High Performance Computing
MPI Program Structure Self Test with solution. Self Test 1.How would you modify "Hello World" so that only even-numbered processors print the greeting.
1 Friday, October 06, 2006 Measure twice, cut once. -Carpenter’s Motto.
Introduction to MPI. What is Message Passing Interface (MPI)?  Portable standard for communication  Processes can communicate through messages.  Each.
Distributed Memory Programming with MPI. What is MPI? Message Passing Interface (MPI) is an industry standard message passing system designed to be both.
Parallel Programming in C with MPI and OpenMP
Comp 422: Parallel Programming Lecture 8: Message Passing (MPI)
Parallel & Cluster Computing MPI Basics Paul Gray, University of Northern Iowa David Joiner, Shodor Education Foundation Tom Murphy, Contra Costa College.
Parallel Processing1 Parallel Processing (CS 676) Lecture 7: Message Passing using MPI * Jeremy R. Johnson *Parts of this lecture was derived from chapters.
Director of Contra Costa College High Performance Computing Center
ECE 1747H : Parallel Programming Message Passing (MPI)
1 MPI: Message-Passing Interface Chapter 2. 2 MPI - (Message Passing Interface) Message passing library standard (MPI) is developed by group of academics.
Part I MPI from scratch. Part I By: Camilo A. SilvaBIOinformatics Summer 2008 PIRE :: REU :: Cyberbridges.
Sharif University of technology, Parallel Processing course, MPI & ADA Server Introduction By Shervin Daneshpajouh.
Parallel Programming with MPI Prof. Sivarama Dandamudi School of Computer Science Carleton University.
Message Passing Programming with MPI Introduction to MPI Basic MPI functions Most of the MPI materials are obtained from William Gropp and Rusty Lusk’s.
CS 838: Pervasive Parallelism Introduction to MPI Copyright 2005 Mark D. Hill University of Wisconsin-Madison Slides are derived from an online tutorial.
Message Passing Programming Model AMANO, Hideharu Textbook pp. 140-147.
Summary of MPI commands Luis Basurto. Large scale systems Shared Memory systems – Memory is shared among processors Distributed memory systems – Each.
MPI Introduction to MPI Commands. Basics – Send and Receive MPI is a message passing environment. The processors’ method of sharing information is NOT.
Parallel Programming with MPI By, Santosh K Jena..
Parallel Programming: Techniques and Applications Using Networked Workstations and Parallel Computers Chapter 2: Message-Passing Computing LAM/MPI at the.
Slides for Parallel Programming Techniques & Applications Using Networked Workstations & Parallel Computers 2nd Edition, by B. Wilkinson & M. Allen, ©
Parallel Programming & Cluster Computing MPI Collective Communications Dan Ernst Andrew Fitz Gibbon Tom Murphy Henry Neeman Charlie Peck Stephen Providence.
CSCI-455/522 Introduction to High Performance Computing Lecture 4.
Oct. 23, 2002Parallel Processing1 Parallel Processing (CS 730) Lecture 6: Message Passing using MPI * Jeremy R. Johnson *Parts of this lecture was derived.
Message Passing and MPI Laxmikant Kale CS Message Passing Program consists of independent processes, –Each running in its own address space –Processors.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Message-passing Model.
Running on GCB part1 By: Camilo Silva. Simple steps to run MPI 1.Use putty or the terminal 2.SSH to gcb.fiu.edu 3.Loggin by providing your username and.
Programming distributed memory systems: Message Passing Interface (MPI) Distributed memory systems: multiple processing units working on one task (e.g.
An Introduction to MPI (message passing interface)
1 HPCI Presentation Kulathep Charoenpornwattana. March 12, Outline Parallel programming with MPI Running MPI applications on Azul & Itanium Running.
1 Running MPI on “Gridfarm” Bryan Carpenter February, 2005.
2.1 Collective Communication Involves set of processes, defined by an intra-communicator. Message tags not present. Principal collective operations: MPI_BCAST()
Timing in MPI Tarik Booker MPI Presentation May 7, 2003.
3/12/2013Computer Engg, IIT(BHU)1 MPI-1. MESSAGE PASSING INTERFACE A message passing library specification Extended message-passing model Not a language.
-1.1- MPI Lectured by: Nguyễn Đức Thái Prepared by: Thoại Nam.
Implementing Processes and Threads CS550 Operating Systems.
Message Passing Interface Using resources from
1 ITCS4145 Parallel Programming B. Wilkinson March 23, hybrid-abw.ppt Hybrid Parallel Programming Introduction.
Chapter 4.
Introduction to parallel computing concepts and technics
MPI Basics.
CS4402 – Parallel Computing
Introduction to MPI.
MPI Message Passing Interface
CS 668: Lecture 3 An Introduction to MPI
Send and Receive.
CS 584.
MPI_Bcast Bcast stands for broadcast, and is used to send data from one process to all other processes. The format for this function is: MPI_Bcast(&msg_address,#_elements,MPI_Type,
MPI: The Message-Passing Interface
Send and Receive.
CS4961 Parallel Programming Lecture 16: Introduction to Message Passing Mary Hall November 3, /03/2011 CS4961.
Introduction to Message Passing Interface (MPI)
Message Passing Models
Lecture 14: Inter-process Communication
CSCE569 Parallel Computing
Lab Course CFD Parallelisation Dr. Miriam Mehl.
Introduction to parallelism and the Message Passing Interface
MPI MPI = Message Passing Interface
Introduction to Parallel Computing with MPI
Hardware Environment VIA cluster - 8 nodes Blade Server – 5 nodes
Distributed Memory Programming with Message-Passing
Parallel Processing - MPI
MPI Message Passing Interface
Some codes for analysis and preparation for programming
CS 584 Lecture 8 Assignment?.
Presentation transcript:

The OSCAR Cluster System

Topics Introduction OSCAR Basics Introduction to LAM LAM Commands MPI Basics Timing Examples

Welcome to OSCAR! Welcome to the free Linux-based clustered system Use multiple computers to create one powerful multi-processor system

Account Setup Fill in the sign-in sheet Receive account password (paper slip) Log in: Use SSH Only to log into: oscar.calstatela.edu

SSH (Secure Shell) Log In Use csxxx0studentxx as your account (where xx = your account number) student30 example:

Environment (LAM) Setup LAM (Local Access Minicomputer) is the implementation for MPI (Message Passing Interface). To run your parallel programs, you need to have this running.

Environment (LAM) Setup (2) After logging in to your account, type (assume ‘>’ is prompt): >ls You should have two files: hello.c and hosts We need to run LAM. Do this by typing: >lamboot hosts Note: to see more in-depth loading, type: >lamboot –v hosts Both methods are perfectly fine.

Environment (LAM) Setup (3) LAM should have taken a while to load. (We are starting a LAM process daemon on each node) After done, verify LAM is running by typing: >ps –ux This is merely a list of the processes running on your account. LAM is now setup and running on your account. (running lam process)

LAM Troubleshooting If anything happens with your LAM process (i.e. LAM no longer shows up on your process list) use the previous steps to start your LAM process again. If something is wrong with your LAM process (i.e. LAM is loaded, in the process list, but refuses to run, or runs indefinitely), use the “lamhalt” command, simply: >lamhalt

Compiling a Parallel Program Included in your account is the ‘hello.c’ program. We’ll use this as a test program for LAM/MPI. We will be using the MPI C compiler. Use the command: >mpicc hello.c This will compile your parallel program. To specify the output file, type: >mpicc hello.c -o hello This compiles hello.c into the executable called ‘hello.’

Running Your Parallel Program Running a program through MPI is a bit different than other interfaces. You must use the ‘mpirun’ command and specify the number of nodes used. The typical usage is: >mpirun N hello ‘hello’ is the previous executable from the last slide. The ‘N’ (UPPERCASE!) says to use all nodes. Note that we don’t have to use all nodes. Try typing: >mpirun n0-5 hello (this uses only the nodes between 0 and 5) (Also try >mpirun n4,5,6 hello)

The MPI Program Let’s look at hello.c The two most important functions are: MPI_Init(MPI_COMM_WORLD); MPI_Finalize(); These functions initialize and close the parallel environment (respectively).

LAM Commands LAM is our specific implementation of MPI LAM comes with additional non-MPI commands (for node management) Most not necessary, but useful

lamboot lamboot(hostfile) Starts LAM Environment Use –v flag for verbose boot >lamboot –v hosts

lamhalt Shuts down lam environment >lamhalt

mpirun Runs an mpi program >mpirun N hello

lamclean If your program terminates “badly,” use lamclean to delete old processes and allocated resources. >lamclean

wipe Stronger version of lamhalt that kills every node on lam >wipe

laminfo Detailed information list for LAM environment >laminfo

lamnodes List all nodes in the LAM environment >lamnodes

lamshrink Remove a node from the LAM environment (without rebooting) Ex: >lamshrink n3 (Note: This also invalidates node n3, or leaves an empty slot in its place)

lamgrow Add a node to the LAM environment (without rebooting) >lamgrow oscarnode3 Also: >lamgrow –n 3 oscarnode3 (Adds oscarnode3 to the previously empty n3 slot. Note the space between n and 3!)

lamexec Run a non-MPI program in the LAM environment >lamexec {non-MPI program}

Termination Order of Bad Programs In the event of a bad termination (program takes up too much memory, doesn’t stop, etc.) use this order of termination: >lamclean (good) >lamhalt (better) >wipe (severe) >kill –9 [process_number] (nuclear)

Basic MPI Functions We Covered MPI_Init and MPI_Finalize MPI_Send MPI_Recv MPI_Bcast MPI_Reduce MPI_Barrier

Note: MPI is a Message Passing Interface Don’t necessarily use Shared Memory Instead, information is passed around nodes

MPI_Send Send a variable to another node MPI_Send(variable, number of variables to send, MPI Data type, node that receives message, MPI Tag, group communicator) Ex: MPI_Send(&value, 1, MPI_INT, 2, 0, MPI_COMM_WORLD)

MPI_Recv Receive a variable from another node MPI_Recv(variable, number of variables to send, MPI Data type, node sending message, message tag, group communicator, MPI status indicator) Ex: MPI_Recv(&value, 1, MPI_INT, 0, 0,MPI_COMM_WORLD, &status (Note: You must create an MPI_Status variable when using this function)

MPI_Bcast Broadcasts a variable to all nodes MPI_Bcast(variable, number of variables, Data type of variable, node that sent broadcast, nodes to send messages to) Ex: MPI_Bcast(&value, 1, MPI_INT, 0, MPI_COMM_WORLD)

MPI_Reduce Collect data at a node Converge information with a specific operation MPI_Reduce(variable to send, variable that receives, number of values to receive, MPI Data type, reduction operation, node receiving data, communicator to use) Ex: MPI_Reduce(&nodePi, &pi, 1, MPI_FLOAT, MPI_SUM, 0, MPI_COMM_WORLD) There are many types of reduction operators (not only summation); you can even create your own

MPI_Barrier Use a barrier in MPI MPI_Barrier(communicator) Ex: MPI_Barrier(MPI_COMM_WORLD)

Programming Examples Ring Arctan (Using Gregory’s formula) Pi (Using Euler’s formula) Music Program Mandelbrot Program

The Ring Pass a variable, one at a time, to each node in the universe (environment) Value Value

Code Example int main(int argc, char** argv) { int size, node; int value; MPI_Status status; MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD, &size); MPI_Comm_rank(MPI_COMM_WORLD, &node); if(node == 0) printf("Value:"); scanf("%d", &value); MPI_Send(&value, 1, MPI_INT, node+1, 0, MPI_COMM_WORLD); } else MPI_Recv(&value, 1, MPI_INT, node-1, 0, MPI_COMM_WORLD, &status); if(node < size - 1) printf("Node %d has %d in value. \n", node, value); MPI_Finalize(); return 0;

Ring Code Example (2) #include <stdio.h> #include <mpi.h> int main(int argc, char** argv) { int size, node; int value; MPI_Status status; MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD, &size); MPI_Comm_rank(MPI_COMM_WORLD, &node);

Ring Code Example (3) Parent node Everyone else receives if(node == 0) { printf("Value:"); scanf("%d", &value); MPI_Send(&value, 1, MPI_INT, node+1, 0, MPI_COMM_WORLD); } else{ MPI_Recv(&value, 1, MPI_INT, node-1, 0, MPI_COMM_WORLD, &status); if(node < size - 1) printf("Node %d has %d in value. \n", node, value); MPI_Finalize(); return 0; Parent node Everyone else receives All nodes but parent and last node send

Let’s Run Ring example…

Computing arctan (tan-1) of x Using Gregory’s Formula arctan(x) = x - x3/3 + x5/5 - x7/7 + x9/9 - … Let’s use MPI to program this formula

Arctan code int main(int argc, char** argv) { int size, node; //MPI variable placeholders int i, j,x; // Loop counters double init_value; double angle = 0.0; double sum = 0.0; int terms; // Number of terms processed double finished_sum = 0.0; MPI_Status status; MPI_Init(&argc, &argv); // Start MPI environment MPI_Comm_size(MPI_COMM_WORLD, &size); //Get MPI size MPI_Comm_rank(MPI_COMM_WORLD, &node); //Get this node number

Arctan code (2) if(node == 0) { printf("Angle:"); scanf("%lf", &angle); printf("Number of arctan terms:"); scanf("%d", &terms); } MPI_Bcast(&terms, 1, MPI_INT, 0, MPI_COMM_WORLD); MPI_Bcast(&angle, 1, MPI_DOUBLE, 0, MPI_COMM_WORLD);

Arctan code (3) // Start processing arctan init_value = angle; double middle_sum; for(x=node; x<terms; x=x+size-1) { middle_sum = 0.0; double index = (double)x - 1.0; index = index + x; double temp = init_value; for(i = 0; i<(int)index - 1; ++i) temp = temp * init_value; middle_sum = temp / index; if(x % 2 == 0) middle_sum = middle_sum * -1.0; sum = sum + middle_sum; } if(node==0) sum = 0.0; MPI_Reduce(&sum, &finished_sum, 1, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD);

Arctan code (4) MPI_Barrier(MPI_COMM_WORLD); // Wait for all processes if(node == 0) printf(" Arctan of %lf = %.20lf\n",angle, finished_sum); MPI_Finalize(); return 0; }

Let’s run arctan example

Computing Pi Using Euler’s formula Let’s use MPI to compute this value Pi/4 = arctan(1/2) + arctan(1/3) Let’s use MPI to compute this value

Computing Pi (2) Arctan Code is the same Set barrier, then compute Run twice Set barrier, then compute 4 * [arctan(1/2) + arctan(1/3)]

OSCAR Cluster Has Countless Uses Any intense computation (mathematical, musical, graphical) can be solved in no time with OSCAR Cluster Check webpage for any information (questions, announcements, etc.)