OMPi: A portable C compiler for OpenMP V2.0 Elias Leontiadis George Tzoumas Vassilios V. Dimakopoulos University of Ioannina.

Slides:



Advertisements
Similar presentations
OpenMP.
Advertisements

Introductions to Parallel Programming Using OpenMP
The OpenUH Compiler: A Community Resource Barbara Chapman University of Houston March, 2007 High Performance Computing and Tools Group
NewsFlash!! Earth Simulator no longer #1. In slightly less earthshaking news… Homework #1 due date postponed to 10/11.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Chapter 4: Threads.
1 OpenMP—An API for Shared Memory Programming Slides are based on:
1 Tuesday, November 07, 2006 “If anything can go wrong, it will.” -Murphy’s Law.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 4: Threads CS 170 TY, Sept 2011.
Computer Architecture II 1 Computer architecture II Programming: POSIX Threads OpenMP.
1 ITCS4145/5145, Parallel Programming B. Wilkinson Feb 21, 2012 Programming with Shared Memory Introduction to OpenMP.
1 School of Computing Science Simon Fraser University CMPT 300: Operating Systems I Ch 4: Threads Dr. Mohamed Hefeeda.
OpenMPI Majdi Baddourah
A Very Short Introduction to OpenMP Basile Schaeli EPFL – I&C – LSP Vincent Keller EPFL – STI – LIN.
Introduction to OpenMP Introduction OpenMP basics OpenMP directives, clauses, and library routines.
Programming with Shared Memory Introduction to OpenMP
CS470/570 Lecture 5 Introduction to OpenMP Compute Pi example OpenMP directives and options.
1 Copyright © 2010, Elsevier Inc. All rights Reserved Chapter 5 Shared Memory Programming with OpenMP An Introduction to Parallel Programming Peter Pacheco.
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.
Lecture 8: Caffe - CPU Optimization
OpenMP - Introduction Süha TUNA Bilişim Enstitüsü UHeM Yaz Çalıştayı
Measuring Synchronisation and Scheduling Overheads in OpenMP J. Mark Bull EPCC University of Edinburgh, UK
4.1 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 4: Threads Overview Multithreading Models Thread Libraries  Pthreads  Windows.
OpenMP – Introduction* *UHEM yaz çalıştayı notlarından derlenmiştir. (uhem.itu.edu.tr)
Work Replication with Parallel Region #pragma omp parallel { for ( j=0; j
High-Performance Parallel Scientific Computing 2008 Purdue University OpenMP Tutorial Seung-Jai Min School of Electrical and Computer.
1 The Portland Group, Inc. Brent Leback HPC User Forum, Broomfield, CO September 2009.
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 (
Threaded Programming Lecture 2: Introduction to OpenMP.
1 OS Review Processes and Threads Chi Zhang
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,
Special Topics in Computer Engineering OpenMP* Essentials * Open Multi-Processing.
CPE779: Shared Memory and OpenMP Based on slides by Laxmikant V. Kale and David Padua of the University of Illinois.
Chapter 4: Threads 羅習五. Chapter 4: Threads Motivation and Overview Multithreading Models Threading Issues Examples – Pthreads – Windows XP Threads – Linux.
1 Chapter 5: Threads Overview Multithreading Models & Issues Read Chapter 5 pages
OpenMP An API : For Writing Portable SMP Application Software Rider NCHC GTD.
Introduction to threads
Chapter 4: Threads.
Chapter 4: Threads.
Introduction to OpenMP
SHARED MEMORY PROGRAMMING WITH OpenMP
Shared Memory Parallelism - OpenMP
Chapter 4: Multithreaded Programming
Chapter 4: Threads.
Threads.
SHARED MEMORY PROGRAMMING WITH OpenMP
Chapter 4: Threads.
CS427 Multicore Architecture and Parallel Computing
Introduction to OpenMP
Shared-Memory Programming
Computer Science Department
Chapter 4: Threads 羅習五.
Chapter 4: Threads Overview Multithreading Models Thread Libraries
Chapter 4: Threads.
Introduction to High Performance Computing Lecture 20
Chapter 4: Threads.
Programming with Shared Memory Introduction to OpenMP
Chapter 4: Threads.
Chapter 4: Threads.
Chapter 4: Threads.
Chapter 4: Threads.
Chapter 4: Threads.
Chapter 4: Threads.
Parallel Computing Explained How to Parallelize a Code
Chapter 4: Threads.
Chapter 4: Threads.
Chapter 4 Threads!!!.
Chapter 4: Threads & Concurrency
Presentation transcript:

OMPi: A portable C compiler for OpenMP V2.0 Elias Leontiadis George Tzoumas Vassilios V. Dimakopoulos University of Ioannina

EWOMP OMPi - University of Ioannina Presentation  Introduction  OMPi  OMPi Performance  Conclusions

EWOMP OMPi - University of Ioannina The OpenMP specification High level API for parallel programming in a shared memory environment Fortran  Version 1.0, October 1997  Version 1.1, November 1999  Version 2.0, November 2000 C/C++  Version 1.0, October 1998  Version 2.0, March 2002 New features such as  timing routines  copyprivate and num_threads clauses  variable reprivatization  static threadprivate

EWOMP OMPi - University of Ioannina OpenMP compilers Commercial compilers for specific machines  SUN, SGI, Intel, Fujitsu, etc. OpenMP compiler projects (usually portable)  Nanos  OdinMP/CCp  Intone project  Omni

EWOMP OMPi - University of Ioannina Presentation  Introduction  OMPi  OMPi Performance  Conclusions

EWOMP OMPi - University of Ioannina OMPi Portable C compiler for OpenMP Adheres to V.2.0 Produces ANSI C code with POSIX threads library calls Written entirely in C

EWOMP OMPi - University of Ioannina Compilation process C source file OMPi generated C file system C compiler (cc) object files object file OMPi library system linker a.out

EWOMP OMPi - University of Ioannina Code transformations parallel construct  code is moved into a (thread) function a struct is declared containing pointers to non-global shared variables private variables are redeclared locally in the function body  original code is replaced by code that creates a team of threads executing the function  master thread executes the function, too

EWOMP OMPi - University of Ioannina Example int a; /* global */ int main() { int b, c; #pragma omp parallel num_threads(3) \ private(c) { c = b + a;... } int a; typedef struct { /* shared vars structure */ int (*b); /* b is shared, non-global */ } par0_t; int main() { int b, c; _omp_initialize(); { /* declare par0_vars, the shared var struct */ _OMP_PARALLEL_DECL_VARSTRUCT(par0); /* par0_vars->b will point to real b */ _OMP_PARALLEL_INIT_VAR(par0, b); /* Run the threads */ _omp_create_team(3, _OMP_THREAD, par0_thread, (void *) &par0_vars); _omp_destroy_team(_OMP_THREAD->parent); } void *par0_thread(void *_omp_thread_data) { int _dummy = _omp_assign_key(_omp_thread_data); int (*b) = &_OMP_VARREF(par0, b); int c; c = (*(b)) + a;... }

EWOMP OMPi - University of Ioannina Work sharing constructs sections construct  a switch-case block is created  the code of each section is moved into a case of the switch block  any thread may execute any section for construct  each thread computes the bounds of the next chunk to execute  then, if a chunk is available, executes the for-loop within the computed bounds

EWOMP OMPi - University of Ioannina Threads  a pool of threads is created when the program starts, all threads are sleeping  initial pool size is number of CPUs or $OMP_NUM_THREADS  user can request a specific number of threads by using the num_threads clause or omp_set_num_threads()

EWOMP OMPi - University of Ioannina Presentation  Introduction  OMPi  OMPi Performance  Conclusions

EWOMP OMPi - University of Ioannina Benchmarks NAS parallel benchmarks  OpenMP C version of ported by Omni group (v2.3)  Results for Class W Edinburgh University microbenchmarks (EPCC)  Measure synchronization overheads

EWOMP OMPi - University of Ioannina Platforms SGI origin 2000 system  48 MIPS R10000 CPUs  IRIX 6.5 Compaq proliant ML 570  2 Intel Xeon CPUs  Redhat Linux 9.0 SUN E-1000 Server  4 Sparc CPUs  Solaris 5.7

EWOMP OMPi - University of Ioannina Compilers OdinMP/CCp v1.02 Omni v1.4a Intel C/C++ compiler (ICC) v7.1 Mipspro v7.3

EWOMP OMPi - University of Ioannina Compilation times for 2-CPU Linux system btlusp seconds odin omni ompi icc Compilation times for the SGI Origin 2000 system btlusp seconds odin omni ompi mipspro NAS parallel benchmarks Compilation Time

EWOMP OMPi - University of Ioannina NAS parallel benchmarks SGI Origin 2000 (execution time) seconds number of threads bt.W ompi omni mipspro

EWOMP OMPi - University of Ioannina NAS parallel benchmarks SGI Origin seconds number of threads ompi omni mipspro cg.W

EWOMP OMPi - University of Ioannina NAS parallel benchmarks SGI Origin seconds number of threads ft.W ompi omni mipspro

EWOMP OMPi - University of Ioannina NAS parallel benchmarks SGI Origin seconds number of threads lu.W ompi omni mipspro

EWOMP OMPi - University of Ioannina NAS parallel benchmarks Sun E seconds number of threads bt.W ompi omni seconds number of threads cg.W ompi omni seconds ft.W ompi omni seconds number of threads lu.W ompi omni

EWOMP OMPi - University of Ioannina EPCC microbenchmarks SGI (overheads)

EWOMP OMPi - University of Ioannina EPCC microbenchmarks SUN

EWOMP OMPi - University of Ioannina Presentation  Introduction  OMPi  OMPi Performance  Conclusions

EWOMP OMPi - University of Ioannina Conclusions C compiler for OpenMP V.2.0 Written in C, generated code uses pthreads Tested on Linux, Solaris, Irix Performance satisfactory, comparable with native compilers

EWOMP OMPi - University of Ioannina Current status Target solaris threads, sproc Improve overheads (e.g. ordered) Improve produced code (optimizations) Profiling code

Thank you