N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER Comparing Cray Tasking and OpenMP NERSC User Services Overview of Cray Tasking Overview of OpenMP.

Slides:



Advertisements
Similar presentations
N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER TotalView on the T3E and IBM SP Systems NERSC User Services June 12, 2000.
Advertisements

NPACI Parallel Computing Institute August 19-23, 2002 San Diego Supercomputing Center S an D IEGO S UPERCOMPUTER C ENTER N ATIONAL P ARTNERSHIP FOR A DVANCED.
Parallel Processing with OpenMP
Introduction to Openmp & openACC
N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER 1 Mixed Language Programming on Seaborg Mark Durst NERSC User Services.
Introductions to Parallel Programming Using OpenMP
S an D IEGO S UPERCOMPUTER C ENTER N ATIONAL P ARTNERSHIP FOR A DVANCED C OMPUTATIONAL I NFRASTRUCTURE NPACI Parallel Computing Seminars San Diego Supercomputing.
NewsFlash!! Earth Simulator no longer #1. In slightly less earthshaking news… Homework #1 due date postponed to 10/11.
1 Programming Explicit Thread-level Parallelism  As noted previously, the programmer must specify how to parallelize  But, want path of least effort.
Parallel Programming On the IUCAA Clusters Sunu Engineer.
PARALLEL PROGRAMMING WITH OPENMP Ing. Andrea Marongiu
Scientific Programming OpenM ulti- P rocessing M essage P assing I nterface.
DISTRIBUTED AND HIGH-PERFORMANCE COMPUTING CHAPTER 7: SHARED MEMORY PARALLEL PROGRAMMING.
Computer Architecture II 1 Computer architecture II Programming: POSIX Threads OpenMP.
Parallel Programming by Tiago Sommer Damasceno Using OpenMP
Introduction to OpenMP For a more detailed tutorial see: Look at the presentations.
1 ITCS4145/5145, Parallel Programming B. Wilkinson Feb 21, 2012 Programming with Shared Memory Introduction to OpenMP.
CSCI-6964: High Performance Parallel & Distributed Computing (HPDC) AE 216, Mon/Thurs 2-3:20 p.m. Pthreads (reading Chp 7.10) Prof. Chris Carothers Computer.
OpenMPI Majdi Baddourah
N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER 1 Comparison of Communication and I/O of the Cray T3E and IBM SP Jonathan Carter NERSC User.
Introduction to OpenMP Introduction OpenMP basics OpenMP directives, clauses, and library routines.
High Performance Computation --- A Practical Introduction Chunlin Tian NAOC Beijing 2011.
1 Parallel Programming With OpenMP. 2 Contents  Overview of Parallel Programming & OpenMP  Difference between OpenMP & MPI  OpenMP Programming Model.
Budapest, November st ALADIN maintenance and phasing workshop Short introduction to OpenMP Jure Jerman, Environmental Agency of Slovenia.
CS470/570 Lecture 5 Introduction to OpenMP Compute Pi example OpenMP directives and options.
Shared Memory Parallelization Outline What is shared memory parallelization? OpenMP Fractal Example False Sharing Variable scoping Examples on sharing.
Shared Memory Parallelism - OpenMP Sathish Vadhiyar Credits/Sources: OpenMP C/C++ standard (openmp.org) OpenMP tutorial (
Introduction to OpenMP
Executing OpenMP Programs Mitesh Meswani. Presentation Outline Introduction to OpenMP Machine Architectures Shared Memory (SMP) Distributed Memory MPI.
Parallel Programming in Java with Shared Memory Directives.
Chapter 17 Shared-Memory Programming. Introduction OpenMP is an application programming interface (API) for parallel programming on multiprocessors. It.
MPI3 Hybrid Proposal Description
ICOM 5995: Performance Instrumentation and Visualization for High Performance Computer Systems Lecture 7 October 16, 2002 Nayda G. Santiago.
N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER 1 Porting from the Cray T3E to the IBM SP Jonathan Carter NERSC User Services.
Lecture 8: OpenMP. Parallel Programming Models Parallel Programming Models: Data parallelism / Task parallelism Explicit parallelism / Implicit parallelism.
O PEN MP (O PEN M ULTI -P ROCESSING ) David Valentine Computer Science Slippery Rock University.
OpenMP – Introduction* *UHEM yaz çalıştayı notlarından derlenmiştir. (uhem.itu.edu.tr)
S AN D IEGO S UPERCOMPUTER C ENTER N ATIONAL P ARTNERSHIP FOR A DVANCED C OMPUTATIONAL I NFRASTRUCTURE On pearls and perils of hybrid OpenMP/MPI programming.
N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER Evolution of the NERSC SP System NERSC User Services Original Plans Phase 1 Phase 2 Programming.
04/10/25Parallel and Distributed Programming1 Shared-memory Parallel Programming Taura Lab M1 Yuuki Horita.
CS 838: Pervasive Parallelism Introduction to OpenMP Copyright 2005 Mark D. Hill University of Wisconsin-Madison Slides are derived from online references.
Hybrid MPI and OpenMP Parallel Programming
Work Replication with Parallel Region #pragma omp parallel { for ( j=0; j
OpenMP fundamentials Nikita Panov
High-Performance Parallel Scientific Computing 2008 Purdue University OpenMP Tutorial Seung-Jai Min School of Electrical and Computer.
Introduction to OpenMP
Introduction to OpenMP Eric Aubanel Advanced Computational Research Laboratory Faculty of Computer Science, UNB Fredericton, New Brunswick.
Shared Memory Parallelism - OpenMP Sathish Vadhiyar Credits/Sources: OpenMP C/C++ standard (openmp.org) OpenMP tutorial (
MPI and OpenMP.
Threaded Programming Lecture 2: Introduction to OpenMP.
High Performance on the J90 Systems David Turner & Tom DeBoni NERSC User Services Group April 1999.
Introduction to Pragnesh Patel 1 NICS CSURE th June 2015.
3/12/2013Computer Engg, IIT(BHU)1 OpenMP-1. OpenMP is a portable, multiprocessing API for shared memory computers OpenMP is not a “language” Instead,
CPE779: More on OpenMP Based on slides by Laxmikant V. Kale and David Padua of the University of Illinois.
CPE779: Shared Memory and OpenMP Based on slides by Laxmikant V. Kale and David Padua of the University of Illinois.
NPACI Parallel Computing Institute August 19-23, 2002 San Diego Supercomputing Center S an D IEGO S UPERCOMPUTER C ENTER N ATIONAL P ARTNERSHIP FOR A DVANCED.
OpenMP An API : For Writing Portable SMP Application Software Rider NCHC GTD.
Introduction to OpenMP
SHARED MEMORY PROGRAMMING WITH OpenMP
Shared Memory Parallelism - OpenMP
SHARED MEMORY PROGRAMMING WITH OpenMP
Computer Engg, IIT(BHU)
Introduction to OpenMP
Computer Science Department
DNA microarrays. Infinite Mixture Model-Based Clustering of DNA Microarray Data Using openMP.
Introduction to OpenMP
Parallel Computing Explained How to Parallelize a Code
Shared-Memory Paradigm & OpenMP
Programming Parallel Computers
Presentation transcript:

N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER Comparing Cray Tasking and OpenMP NERSC User Services Overview of Cray Tasking Overview of OpenMP Directives Comparison Mixing OpenMP with MPI

N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER June, 2000Cray Tasking vs. OpenMP - User Services Group 2 Cray Shared-Memory Multiprocessors 1982: X-MP –1, 2, or 4 processors 1985: Cray-2 –4 processors 1988: Y-MP –8 processors “Cray for the 90s”: C90 –16 processors

N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER June, 2000Cray Tasking vs. OpenMP - User Services Group 3 Cray Tasking Microtasking –Parallel loops Macrotasking –Parallel regions Autotasking –Emphasis on “auto”

N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER June, 2000Cray Tasking vs. OpenMP - User Services Group 4 History of OpenMP Defined by OpenMP Architecture Review Board –Compaq/DEC, HP, IBM, Intel, SGI/Cray, Sun, etc. Endorsed by software and application vendors –Absoft, The Portland Group, etc. –ANSYS, Fluent, Livermore Software, NAG, etc. Fortran, C, and C++ bindings –Fortran specification released late 1997 –C and C++ specification released late 1998 See for complete details

N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER June, 2000Cray Tasking vs. OpenMP - User Services Group 5 Scope of OpenMP Shared-memory explicit parallelism –No automatic parallelism –Some research into extending to distributed-memory environments Directives, environment variables, runtime library routines

N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER June, 2000Cray Tasking vs. OpenMP - User Services Group 6 Cray Tasking Syntax sentinel directive [argument …] [, directive …] sentinel –cdir$ or !dir$ ( cmic$ and !mic$ are obsolete) Fixed format source –“normal” Fortran column rules Free format source –sentinel begins anywhere on a line, but must be the first text –sentinel followed by anything other than space implies continuation Multiple directives are comma-delimited –if a directive has required arguments, no other directives allowed

N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER June, 2000Cray Tasking vs. OpenMP - User Services Group 7 OpenMP Syntax prefix directive [clause[[,] clause]…] Fixed format source –prefix: !$OMP, C$OMP, or *$OMP –“normal” Fortran source rules Free format source –prefix: !$OMP –sentinel begins anywhere on a line, but must be the first text –“normal” Fortran source rules

N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER June, 2000Cray Tasking vs. OpenMP - User Services Group 8 Directive Correspondence Autotasking DOALL GUARD ENDGUARD PARALLEL ENDPARALLEL DOPARALLEL ENDDO CASE ENDCASE OpenMP PARALLEL DO CRITICAL END CRITICAL PARALLEL END PARALLEL DO END DO SECTIONS END SECTIONS

N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER June, 2000Cray Tasking vs. OpenMP - User Services Group 9 Simple Parallel Loop !MIC$ DOALL PRIVATE(I) SHARED(X,Y,Z) !$OMP PARALLEL DO DO I = 1, N Z(I)=LOG(SIN(X(I))**2+COS(Y(I))**4) END DO !$OMP END PARALLEL DO

N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER June, 2000Cray Tasking vs. OpenMP - User Services Group 10 Directive Correspondence Autotasking DOALL GUARD ENDGUARD PARALLEL ENDPARALLEL DOPARALLEL ENDDO CASE ENDCASE OpenMP PARALLEL DO CRITICAL END CRITICAL PARALLEL END PARALLEL DO END DO SECTIONS END SECTIONS

N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER June, 2000Cray Tasking vs. OpenMP - User Services Group 11 Parallel Loop With Critical Section !MIC$ DOALL PRIVATE(I) SHARED(X,Y,Z,T) !$OMP PARALLEL DO DO I = 1, N Z(I) = LOG(SIN(X(I))**2 + COS(Y(I))**4) !MIC$ GUARD !$OMP CRITICAL T = T + Z(I) !MIC$ ENDGUARD !$OMP ENDCRITICAL END DO !$OMP END PARALLEL DO

N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER June, 2000Cray Tasking vs. OpenMP - User Services Group 12 Directive Correspondence Autotasking DOALL GUARD ENDGUARD PARALLEL ENDPARALLEL DOPARALLEL ENDDO CASE ENDCASE OpenMP PARALLEL DO CRITICAL END CRITICAL PARALLEL END PARALLEL DO END DO SECTIONS END SECTIONS

N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER June, 2000Cray Tasking vs. OpenMP - User Services Group 13 Parallel Regions !MIC$ PARALLEL PRIVATE(X) SHARED(Y) !$OMP PARALLEL PRIVATE(X) !$OMP DO X = 3.0 !MIC$ GUARD !$OMP CRITICAL Y = Y !MIC$ ENDGUARD !$OMP ENDCRITICAL !MIC$ ENDPARALLEL !$OMP END DO !$OMP END PARALLEL

N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER June, 2000Cray Tasking vs. OpenMP - User Services Group 14 Directive Correspondence Autotasking DOALL GUARD ENDGUARD PARALLEL ENDPARALLEL DOPARALLEL ENDDO CASE ENDCASE OpenMP PARALLEL DO CRITICAL END CRITICAL PARALLEL END PARALLEL DO END DO SECTIONS END SECTIONS

N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER June, 2000Cray Tasking vs. OpenMP - User Services Group 15 Generalized Parallel Loop SUM = 0.0 !MIC$ PARALLEL PRIVATE(XSUM,I) SHARED(SUM,A,N) XSUM = 0.0 !MIC$ DOPARALLEL DO I = 1, N XSUM = XSUM + A(I) ENDDO !MIC$ GUARD SUM = SUM + XSUM !MIC$ ENDGUARD !MIC$ ENDDO !MIC$ ENDPARALLEL

N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER June, 2000Cray Tasking vs. OpenMP - User Services Group 16 Generalized Parallel Loop (cont.) SUM = 0.0 !$OMP PARALLEL PRIVATE(XSUM) XSUM = 0.0 !$OMP DO DO I = 1, N XSUM = XSUM + A(I) ENDDO !$OMP CRITICAL SUM = SUM + XSUM !$OMP END CRITICAL !$OMP END DO !$OMP END PARALLEL

N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER June, 2000Cray Tasking vs. OpenMP - User Services Group 17 Directive Correspondence Autotasking DOALL GUARD ENDGUARD PARALLEL ENDPARALLEL DOPARALLEL ENDDO CASE ENDCASE OpenMP PARALLEL DO CRITICAL END CRITICAL PARALLEL END PARALLEL DO END DO SECTIONS END SECTIONS

N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER June, 2000Cray Tasking vs. OpenMP - User Services Group 18 Parallel Blocks !MIC$ PARALLEL !$OMP PARALLEL !MIC$ CASE !$OMP SECTIONS !$OMP SECTION CALL SUBA !MIC$ CASE !$OMP SECTION CALL SUBB !MIC$ ENDCASE !$OMP END SECTIONS !MIC$ ENDPARALLEL !$OMP END SECTIONS

N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER June, 2000Cray Tasking vs. OpenMP - User Services Group 19 Mixing OpenMP and MPI INCLUDE ’mpi.h' CALL MPI_INIT(IERR) CALL MPI_COMM_RANK(MPI_COMM_WORLD,MYID,IERR) CALL MPI_COMM_SIZE(MPI_COMM_WORLD,NP,IERR) PRINT *,'PROCESS ',MYID,' OF ',NP,' IS ALIVE' !$OMP PARALLEL PRIVATE(NTHREADS, TID) TID = OMP_GET_THREAD_NUM() PRINT *,'HI;THREAD=',TID,' PROCESS=',MYID IF (TID.EQ. 0) THEN NTHREADS = OMP_GET_NUM_THREADS() PRINT *,'NTHREADS=',NTHREADS,’MYID=',MYID END IF !$OMP END PARALLEL CALL MPI_FINALIZE(IERR) END

N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER June, 2000Cray Tasking vs. OpenMP - User Services Group 20 Mixing OpenMP and MPI (cont.) % mpxlf_r smp.f -qsmp ** hi === End of Compilation 1 === Compilation successful for file smp.f. % setenv XLSMPOPTS "parthds=2" %./a.out -nodes 2 Process 1 of 2 is alive Process 0 of 2 is alive HI;THREAD=0 PROCESS=0 NTHREADS=2 MYID=0 HI;THREAD=1 PROCESS=0 HI;THREAD=0 PROCESS=1 NTHREADS=2 MYID=1 HI;THREAD=1 PROCESS=1