Docsity
Docsity

Prepara tus exámenes
Prepara tus exámenes

Prepara tus exámenes y mejora tus resultados gracias a la gran cantidad de recursos disponibles en Docsity


Consigue puntos base para descargar
Consigue puntos base para descargar

Gana puntos ayudando a otros estudiantes o consíguelos activando un Plan Premium


Orientación Universidad
Orientación Universidad


tutorial de open mp con lenguaje c, Diapositivas de Computación Distribuida

este es un tutorial en el que se encuentra conceptos relacionados a open mp

Tipo: Diapositivas

2022/2023

Subido el 11/10/2023

cristian-david-palacio-morelos
cristian-david-palacio-morelos 🇨🇴

2 documentos

1 / 89

Toggle sidebar

Esta página no es visible en la vista previa

¡No te pierdas las partes importantes!

bg1
The 14th Super Computing Camp – Cartagena de Indias - 2023
Robinson Rivas – OpenMP Tutorial
OpenMP Tutorial
Robinson Rivas Suárez
Universidad Central de Venezuela
INTRODUCTION TO OpenMP
Prof. Robinson Rivas-Suárez
UNIVERSIDAD CENTRAL DE VENEZUELA
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59

Vista previa parcial del texto

¡Descarga tutorial de open mp con lenguaje c y más Diapositivas en PDF de Computación Distribuida solo en Docsity!

OpenMP Tutorial

Robinson Rivas Suárez Universidad Central de Venezuela INTRODUCTION TO OpenMP Prof. Robinson Rivas-Suárez UNIVERSIDAD CENTRAL DE VENEZUELA

BsC in Computer Science (Maracaibo, Venezuela) Master in Computer Science (Caracas, Venezuela) Network Engineer (OIC, Japan)

Robinson

  • That’s really necessary?
  • Why to think about shared memory
  • OpenMP and new models of programming
  • Everyday platforms
  • New trends

Overview

  • Often, we professors teach our students that algorithms must be designed, planned and then programmed as much abstract as possible, i.e. only thinking on the problem to be solved rather than the computer that actually solves it.
  • This way of thinking is so-called abstract design

Back to school

People who are more than casually interested in computers should have at least some idea of what the underlying hardware is like. Otherwise the programs they write will be pretty weird ― Donald Knuth, The Art of Computer Programming, Volume 1: Fundamental Algorithms

An opinion

  • More than two processors using the same memory system, at least parts of the same memory system
  • It happens when there are many cores per processor. It was rare in the very early years, but it is really common today

Shared Memory

  • Think in a standard smartphone today. Tipically, ARM processors have 4 cores (even more)
  • So, computers we have in our pockets needs to be programmed in an efficient yet reliable way
  • HPC in terms of shared memory is not just for top 500 list supercomputers … it matters everywhere!!

Shared Memory

  • OpenMP is an standard set of instructions available for the most important HPC programming languages
  • It was originally proposed as an open specification in 1996
  • First official draft of the OpenMP consortium was released in 1997

OpenMP

OpenMP is managed by the nonprofit technology consortium OpenMP Architecture Review Board (or OpenMP ARB ), jointly defined by a group of major computer hardware and software vendors, including AMD, IBM, Intel, Cray, HP, Fujitsu, Nvidia, NEC, Red Hat, Texas Instruments, Oracle Corporation, and more. source: Wikipedia

  • Portability: code runs in any platform, since thread creation is encapsulated inside the actual O.S.
  • Programmer has not to control the thread behavior. It releases him/her from the heaviest part of thread management
  • Because is intended to work in shared memory, OpenMP does not deal with message passing. It eliminates the most common source of errors in parallel programming

Advantages of OpenMP

  • Higly scalable: performance usually goes better when code is executed in more cores
  • By design, OpenMP permits to keep the sequential code as it is. It allows to use the programs in different environments without need to recompile (on the same architecture)

Advantages of OpenMP

  • Debugging process is not that easy. OpenMP doesn’t have an efficient native error handling mechanism
  • By now, internal details of threads are hidden for programmer. It is of course an advantage for readyness and portability, but doesn’t allow programmers to do fine control to improve performance on specific architectures

OpenMP issues

  • Many tools has being designed to help with this. But are not part of the standard itself.
  • Some examples are profilers like Valgrind, VAMPIR, SCORE-P, etc
  • BSC (Barcelona-Spain)has developed a few useful tools to help better understanding of OpenMP parallel code

OpenMP issues

  • OpenMP doesn’t have memory-related instructions. You can’t deal with cache, memory layers or new architecture models. Everything is seem as plain shared memory (*)
  • Startup time for threads is high compared to sequential time for execution. So, if the problem is really small, OpenMP parallel version could be worst than sequential version (*) we’ll be back about this later

OpenMP issues

OpenMP is designed as a series of compiler directives plus an small suite of library functions. So:

  • OpenMP is NOT a library nor a set of pre-compiled code
  • OpenMP is NOT designed to run well in a distributed-memory environment

what OpenMP doesn’t is …