Download presentation
Presentation is loading. Please wait.
Published byDamon Marshall Modified over 9 years ago
1
OMPi: A portable C compiler for OpenMP V2.0 Elias Leontiadis George Tzoumas Vassilios V. Dimakopoulos University of Ioannina
2
EWOMP 20031 OMPi - University of Ioannina Presentation Introduction OMPi OMPi Performance Conclusions
3
EWOMP 20032 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
4
EWOMP 20033 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
5
EWOMP 20034 OMPi - University of Ioannina Presentation Introduction OMPi OMPi Performance Conclusions
6
EWOMP 20035 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
7
EWOMP 20036 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
8
EWOMP 20037 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
9
EWOMP 20038 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;... }
10
EWOMP 20039 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
11
EWOMP 200310 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()
12
EWOMP 200311 OMPi - University of Ioannina Presentation Introduction OMPi OMPi Performance Conclusions
13
EWOMP 200312 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
14
EWOMP 200313 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
15
EWOMP 200314 OMPi - University of Ioannina Compilers OdinMP/CCp v1.02 Omni v1.4a Intel C/C++ compiler (ICC) v7.1 Mipspro v7.3
16
EWOMP 200315 OMPi - University of Ioannina Compilation times for 2-CPU Linux system 0 10 20 30 40 50 60 70 btlusp seconds odin omni ompi icc Compilation times for the SGI Origin 2000 system 0 20 40 60 80 100 120 140 160 180 200 btlusp seconds odin omni ompi mipspro NAS parallel benchmarks Compilation Time
17
EWOMP 200316 OMPi - University of Ioannina NAS parallel benchmarks SGI Origin 2000 (execution time) 10 20 30 40 50 60 70 80 90 100 110 12345678 seconds number of threads bt.W ompi omni mipspro
18
EWOMP 200317 OMPi - University of Ioannina NAS parallel benchmarks SGI Origin 2000 0 1 2 3 4 5 6 7 8 9 10 12345678 seconds number of threads ompi omni mipspro cg.W
19
EWOMP 200318 OMPi - University of Ioannina NAS parallel benchmarks SGI Origin 2000 1.5 2 2.5 3 3.5 4 4.5 5 5.5 6 12345678 seconds number of threads ft.W ompi omni mipspro
20
EWOMP 200319 OMPi - University of Ioannina NAS parallel benchmarks SGI Origin 2000 20 40 60 80 100 120 140 160 12345678 seconds number of threads lu.W ompi omni mipspro
21
EWOMP 200320 OMPi - University of Ioannina NAS parallel benchmarks Sun E-1000 200 300 400 500 600 700 800 900 1000 1234 seconds number of threads bt.W ompi omni 10 20 30 40 50 60 70 80 90 1234 seconds number of threads cg.W ompi omni 10 15 20 25 30 35 40 1234 seconds ft.W ompi omni 200 400 600 800 1000 1200 1400 1600 1800 2000 1234 seconds number of threads lu.W ompi omni
22
EWOMP 200321 OMPi - University of Ioannina EPCC microbenchmarks SGI (overheads)
23
EWOMP 200322 OMPi - University of Ioannina EPCC microbenchmarks SUN
24
EWOMP 200323 OMPi - University of Ioannina Presentation Introduction OMPi OMPi Performance Conclusions
25
EWOMP 200324 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
26
EWOMP 200325 OMPi - University of Ioannina Current status Target solaris threads, sproc Improve overheads (e.g. ordered) Improve produced code (optimizations) Profiling code
27
Thank you http://www.cs.uoi.gr/~ompi
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.