SlideServe
Menu
Préférences
© SlideServe · v2026

Unified Parallel C

guri avatar
5 diapositives · 311 Views · Sep 19, 2014

Unified Parallel C. Farhad Kajabadi Dharmanna Pidagannavar Sandeep Menon. The PGAS Model (for UPC). Concurrent threads with a partitioned shared space - A datum may reference data in other partitions - Global arrays have fragments in multiple partitions.

Unified Parallel C - slide 1
01 / 5Unified Parallel C
1 / 17

Télécharger la présentation

Unified Parallel C
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Unified Parallel C Farhad Kajabadi Dharmanna Pidagannavar Sandeep Menon

  2. The PGAS Model (for UPC) Concurrent threads with a partitioned shared space - A datum may reference data in other partitions - Global arrays have fragments in multiple partitions Ref: http://upc.gwu.edu/tutorials.html

  3. UPC Memory Model • Each of the threads can access private space and shared space which is partitioned into portions each of which has affinity (or logical association). • UPC implementation typically maps a thread along with its private space and the shared memory portion that has affinity to that thread onto one node. • Place shared data close to threads that will need them the most, which can reduce remote memory accesses and increase performance.

  4. Example CODE //matrix_vect_mult1.c #include <upc_relaxed.h> #define N 1000*THREADS shared double A[N][N], X[N], Y[N]; void main() { int i,j; // Y has already been zeroed for(i=0; i<N; i++) if (i%THREADS==MYTHREAD) for (j=0; j<N; j++) Y[i] += X[j] * A[i][j]; } • #include <upc_relaxed.h> - tells the compiler that it can order shared accesses in any way if it sees that performance can be optimized • if (i%THREADS==MYTHREAD) - distributes the iterations onto the threads in a roundrobin fashion

  5. Data Distribution for Example Ref: UPC: Distributed Shared Memory Programming Ghazawi, Carlson, Sterling & Yelick (Wiley, May 2005) http://cnx.org/content/m20649/latest/ http://upc.lbl.gov/docs/