MPI 1. CSCI 4850/5850 High-Performance Computing Spring 2018

Similar documents
MPI 2. CSCI 4850/5850 High-Performance Computing Spring 2018

MPI 3. CSCI 4850/5850 High-Performance Computing Spring 2018

MPI 5. CSCI 4850/5850 High-Performance Computing Spring 2018

Distributed Memory Programming with Message-Passing

15-440: Recitation 8

Holland Computing Center Kickstart MPI Intro

30 Nov Dec Advanced School in High Performance and GRID Computing Concepts and Applications, ICTP, Trieste, Italy

Message Passing Programming. Introduction to MPI

Introduction to parallel computing concepts and technics

Parallel Computing: Overview

Introduction to MPI. Ekpe Okorafor. School of Parallel Programming & Parallel Architecture for HPC ICTP October, 2014

CS4961 Parallel Programming. Lecture 16: Introduction to Message Passing 11/3/11. Administrative. Mary Hall November 3, 2011.

Számítogépes modellezés labor (MSc)

Parallel Programming. Libraries and Implementations

Part One: The Files. C MPI Slurm Tutorial - Hello World. Introduction. Hello World! hello.tar. The files, summary. Output Files, summary

Parallel Programming

UBDA Platform User Gudie. 16 July P a g e 1

High Performance Computing Course Notes Message Passing Programming I

Compilation and Parallel Start

MPI 8. CSCI 4850/5850 High-Performance Computing Spring 2018

MULTI GPU PROGRAMMING WITH MPI AND OPENACC JIRI KRAUS, NVIDIA

CS 426. Building and Running a Parallel Application

Introduction to the Message Passing Interface (MPI)

Hybrid MPI and OpenMP Parallel Programming

Introduction to MPI. SHARCNET MPI Lecture Series: Part I of II. Paul Preney, OCT, M.Sc., B.Ed., B.Sc.

Message Passing Interface

Slides prepared by : Farzana Rahman 1

MPI and comparison of models Lecture 23, cs262a. Ion Stoica & Ali Ghodsi UC Berkeley April 16, 2018

Message Passing Interface. most of the slides taken from Hanjun Kim

Parallel Programming Overview

MPI and OpenMP (Lecture 25, cs262a) Ion Stoica, UC Berkeley November 19, 2016

The Message Passing Interface (MPI) TMA4280 Introduction to Supercomputing

JURECA Tuning for the platform

CS 470 Spring Mike Lam, Professor. Distributed Programming & MPI

To connect to the cluster, simply use a SSH or SFTP client to connect to:

Message Passing Interface

1 Overview. KH Computational Physics QMC. Parallel programming.

A few words about MPI (Message Passing Interface) T. Edwald 10 June 2008

An Introduction to MPI

The Message Passing Model

Practical Introduction to Message-Passing Interface (MPI)

CS 470 Spring Mike Lam, Professor. Distributed Programming & MPI

Introduction to MPI. May 20, Daniel J. Bodony Department of Aerospace Engineering University of Illinois at Urbana-Champaign

Parallel Programming. Libraries and implementations

Our new HPC-Cluster An overview

COSC 6374 Parallel Computation. Message Passing Interface (MPI ) I Introduction. Distributed memory machines

MPI Mechanic. December Provided by ClusterWorld for Jeff Squyres cw.squyres.com.

Parallel Computing Paradigms

MPI Program Structure

Computing with the Moore Cluster

Parallel Programming Libraries and implementations

High performance computing. Message Passing Interface

To connect to the cluster, simply use a SSH or SFTP client to connect to:

Message-Passing Programming with MPI

CS4961 Parallel Programming. Lecture 18: Introduction to Message Passing 11/3/10. Final Project Purpose: Mary Hall November 2, 2010.

Parallel hardware. Distributed Memory. Parallel software. COMP528 MPI Programming, I. Flynn s taxonomy:

MPI MPI. Linux. Linux. Message Passing Interface. Message Passing Interface. August 14, August 14, 2007 MPICH. MPI MPI Send Recv MPI

Introduction to Parallel and Distributed Systems - INZ0277Wcl 5 ECTS. Teacher: Jan Kwiatkowski, Office 201/15, D-2

CSE 160 Lecture 18. Message Passing

Introduction to Parallel Programming

Threaded Programming. Lecture 9: Alternatives to OpenMP

mith College Computer Science CSC352 Week #7 Spring 2017 Introduction to MPI Dominique Thiébaut

Don t reinvent the wheel. BLAS LAPACK Intel Math Kernel Library

Introduction to Parallel Programming with MPI

Introduction to OpenMP. OpenMP basics OpenMP directives, clauses, and library routines

int sum;... sum = sum + c?

OpenMP 4. CSCI 4850/5850 High-Performance Computing Spring 2018

PCAP Assignment I. 1. A. Why is there a large performance gap between many-core GPUs and generalpurpose multicore CPUs. Discuss in detail.

Message Passing Interface

Message-Passing Programming with MPI. Message-Passing Concepts

Parallel programming MPI

P a g e 1. HPC Example for C with OpenMPI

Lecture 3 Message-Passing Programming Using MPI (Part 1)

AgentTeamwork Programming Manual

ME964 High Performance Computing for Engineering Applications

Supercomputing in Plain English Exercise #6: MPI Point to Point

What is Hadoop? Hadoop is an ecosystem of tools for processing Big Data. Hadoop is an open source project.

MPI-Hello World. Timothy H. Kaiser, PH.D.

Parallel Programming in C with MPI and OpenMP

MPI-Hello World. Timothy H. Kaiser, PH.D.

CS 6230: High-Performance Computing and Parallelization Introduction to MPI

MPI introduction - exercises -

MPI Message Passing Interface

Introduction to MPI. Ricardo Fonseca.

Practical Introduction to Message-Passing Interface (MPI)

Working with Shell Scripting. Daniel Balagué

Blue Waters Programming Environment

Simple examples how to run MPI program via PBS on Taurus HPC

Introduction to MPI. Branislav Jansík

Tech Computer Center Documentation

ACEnet for CS6702 Ross Dickson, Computational Research Consultant 29 Sep 2009

Parallel Programming. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Part One: The Files. C MPI Slurm Tutorial - TSP. Introduction. TSP Problem and Tutorial s Purpose. tsp.tar. The C files, summary

Parallel Programming in C with MPI and OpenMP

MPI MESSAGE PASSING INTERFACE

HPC Parallel Programing Multi-node Computation with MPI - I

Outline. Overview Theoretical background Parallel computing systems Parallel programming models MPI/OpenMP examples

GPU 1. CSCI 4850/5850 High-Performance Computing Spring 2018

Parallel Computing and the MPI environment

OpenMP 2. CSCI 4850/5850 High-Performance Computing Spring 2018

Transcription:

MPI 1 CSCI 4850/5850 High-Performance Computing Spring 2018 Tae-Hyuk (Ted) Ahn Department of Computer Science Program of Bioinformatics and Computational Biology Saint Louis University

Learning Objectives Recap the architecture of distributed memory system and get started MPI. 2

Shared Memory System There is a single shared address space for all processors. All processors share the same view of memory. 3

Distributed Memory System Each processor has its own private memory. A network connects all the processors. 4

Current System 3-tier parallelism, hybrid architecture. 5

Node Parallelism One process per node. Private memory. Communication between nodes: Message-passing. Basic operations: send, receive. Collective operations. 6

Core Parallelism One thread per core. Shared-memory. Synchronization between cores: Basic operations: fork, join. Bulk-synchronous parallel (BSP). 7

Accelerator Parallelism Massively parallel thread architecture. Shared memory. Offload mechanism to spawn kernel on accelerator. Manage memory copy operations. 8

Research of Parallel Programming Researches -> programming models, languages, and libraries a prototype available and encourage use by others Users: commitment, support, portability Not all research groups can provide this Failure to achieve critical mass of users can limit impact of research MPI and only few others succeeded 9

Standardization The community has resorted to community- based standards MPI OpenMP CUDA, OpenCL OpenACC Portable, portable, and portable 10

Standardization Benefits Multiple implementations promote competition Vendors get clear direction on where to devote effort Users get portability for applications Wide use consolidates the research, Prepares community for next round of research 11

Message-Passing Paradigm A parallel program is decomposed into processes, called ranks. Each rank holds a portion of the program s data into its private memory. Communication among ranks is made explicit through messages. Channels honor first-in-first-out (FIFO) ordering. Message passing is for communication among processes, which have separate address spaces (vs share addr.) 12

Single-Program Multiple-Data (SPMD) All processes run the same program, each accesses a different portion of data. All processes are launched simultaneously. Communication: Point-to-point messages. Collective communication operations. Inter-process communication consists of synchronization Interaction: movement of data from one process s address space to another s; SPMD (VS SIMD, MIMD) processors run a personal copy of a program 13

Features of Message Passing Simplicity: the basics of the paradigm are traditional communication operations. Generality: can be implemented on most parallel architectures. Performance: the implementation can match the underlying hardware. Scalability: the same program can be deployed on larger systems. 14

What is Message Passing Interface (MPI)? A message-passing library specification extended message-passing model not a language or compiler specification not a specific implementation or product For parallel computers, clusters, and heterogeneous networks Full-featured Designed to provide access to advanced parallel hardware for end users, library writers, and tool developers 15

Message Passing Interface (MPI) Standard for operations in message passing. Led by MPI Forum (academia & industry). MPI-1 standard (1994) MPI-2 standard (1997) MPI-3 standard (2012) Implementations: Open-source: MPICH, OpenMPI. Proprietary: Cray, IBM, Intel. Languages: C/C++, Fortran, Python, Perl, Ruby, R, Java, CL, Haskell. There is no automatic sequential-equivalent to an MPI program. 16

Novel Features of MPI Communicators encapsulate communication spaces for library safety Datatypes reduce copying costs and permit heterogeneity Multiple communication modes allow precise buffer management Extensive collective operations for scalable global communication Process topologies permit efficient process placement, user views of process layout Good interface encourages portable tools 17

MPI is simple Many parallel programs can be written using just these six functions, only two of which are non-trivial: MPI_INIT MPI_FINALIZE MPI_COMM_SIZE MPI_COMM_RANK MPI_SEND MPI_RECV 18

MPI Ranks Ranks have private memory. Each rank has a unique identification number. Ranks are numbered sequentially: [0,n-1]. 19

MPI Primer Initialization: C: int MPI_Init(int *argc, char ***argv) C++: void MPI::Init(int& argc, char**& argv) Get communicator size: int MPI_Comm_size(MPI_Comm comm, int *size) int Comm::Get_size() const Get rank number: int MPI_Comm_rank(MPI_Comm comm, int *rank) int Comm::Get_rank() const Finalization: int MPI_Finalize(void) void Finalize() 20

C, Fortran, C++ Check https://www.open-mpi.org/doc/v2.0/ 21

MPI - Hello World! #include <iostream> #include <cstdlib> #include <mpi.h> #include <unistd.h> // has exit(), etc. // MPI header file // for sleep() using namespace std; int main(int argc, char **argv) { // initialize for MPI (should come before any other calls to // MPI routines) MPI::Init(argc, argv); // get number of processes int nprocs = MPI::COMM_WORLD.Get_size(); // get this process's number (ranges from 0 to nprocs - 1) int myid = MPI::COMM_WORLD.Get_rank(); double starttime, endtime; if (myid == 0) { starttime = MPI::Wtime(); } // print a greeting cout << "hello from process " << myid << " of " << nprocs << endl; sleep(5); if (myid == 0) { endtime = MPI::Wtime(); cout << "Elapsed time = " << endtime-starttime << endl; } // clean up for MPI MPI::Finalize(); } return EXIT_SUCCESS; 22

MPI How to build MPI binary? [ahnt@apex Lab1]$ mpicc bash: mpicc: command not found... [ahnt@apex Lab1]$ which mpicc /usr/bin/which: no mpicc in (/cm/shared/apps/slurm/15.08.6/sbin:/cm/shared/apps/slurm/15.08. 6/bin:/cm/local/apps/gcc/5.2.0/bin:/usr/local/bin:/usr/bin:/usr/ local/sbin:/usr/sbin:/sbin:/usr/sbin:/cm/local/apps/environmentmodules/3.2.10/bin:/home/ahnt/.local/bin:/home/ahnt/bin) [ahnt@apex Lab1]$ module list Currently Loaded Modulefiles: 1) gcc/5.2.0 2) slurm/15.08.6 [ahnt@apex Lab1]$ module availe [ahnt@apex Lab1]$ module add openmpi/gcc/64/1.10.1 [ahnt@apex Lab1]$ mpicc -o mpihelloworld mpihelloworld.cpp 23

Lab 1 Run mpi-helloworld at kepler.slu.edu https://sites.google.com/a/slu.edu/atg/getting-started Prepare a script to submit the mpi helloworld program. Submit the job and check the result. Useful SGE commands: qhost: You can see the status of available compute nodes qconf: Modify and check the current SGE configuration qconf sql: show a list of all queues qconf spl: show all parallel environments qsub: submit a batch job to Sun Grid Engine. qstat: show the status of Sun Grid Engine jobs and queues 24

Lab: Run mpi-helloworld at apex.slu.edu https://sites.google.com/a/slu.edu/atg/apex Prepare a script to submit the mpi helloworld program. Submit the job (sbatch) and check (squeue) the result. Useful SLURM commands: squeue lets you see whats in the SLURM queue squeue -u <username> as above but for a specific user scancel <jobid> cancels a certain job id scancel -u <username> cancels all jobs for a certain user 25