










































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!











































Blacklight, the SGI
® Altix
® UV
4096 cores
32 TB of memory
NUMAlink
® 5 interconnect
Vs
Titan, HPC Cluster, Oak Ridge National Lab.
299,008 cores
710 TB of memory
Gemini Interconnect
Attribution: 1) Blacklight presentation by Sanielevici, SG-WG Update, March 18, 2011. 2) Titan homepage
docsity.com
Process/Thread
Memory
4
Programming Models
Shared Memory
Cilk
OpenMP
Pthreads
Distributed Memory
interconnect
docsity.com
What are the most expensive operations when
programming distributed memory systems?
5
Distributed Memory
interconnect
docsity.com
7
UPC
shared int v1[N],v2[N], sum[N];
upc_forall (i=0; i<100; i++; i)
sum[i] = v1[i]+v2[i];
C
int v1[N], v2[N];
void main() {
for(i=0; i<N; i++)
sum[i]=v1[i]+v2[i];
}
MPI
int v1[N], v2[N], sum[N];
if(i_am_process0)
send_to_everyone_chunks_v12();
else
receive_from_process0_v12();
for(i=0; i<N/p; i++)
sum[i]=v1[i]+v2[i];
MPI_Gather(sum, ...,process_0, ...);
Addition of two vectors
docsity.com
8
—one-sided communication (GET/PUT)
—data distribution and locality control
—computation partitioning
—communication placement
—amenable to compiler-based communication optimization
HPF & OpenMP compilers
& runtimes must get this right
simpler than msg passing
lacking in OpenMP
docsity.com
—a few extra keywords
Language features
—partitioned global address space for shared data
—threads created at application launch
—a memory model
—synchronization primitives
—MYTHREAD specifies thread index (0..THREADS-1)
—# threads specified at compile-time or program launch
—synchronization primitives
—shared variables
—shared scalars have affinity to thread 0
—elements of shared arrays are allocated round robin among
memory modules co-located with each thread
Consider the following data layout directive
shared int y[ 2 * THREADS + 1 ];
For THREADS = 3,
Thread 0
y[3]
y[0]
y[4]
y[1]
Thread 1
z y[5]
y[2]
Thread 2
y[6]
Consider the following data layout directives
shared int x; // x has affinity to thread 0
shared int y[THREADS];
int z; // private
For THREADS = 3, we get the following layout
Thread 0
x
z
y[0]
z
y[1]
Thread 1
z z
y[2]
Thread 2
—default block size is 1 element
round robin allocation of block size chunks
— e.g., shared [2] int a[16]
a[0]
a[1]
a[6]
a[7]
a[2]
a[3]
a[8]
a[9]
a[4]
a[5]
a[10]
a[11]
a[12]
a[13]
a[14]
a[15]
Thread 0 Thread 1 Thread 2
block size
—contiguous memory layout of C multi-dimensional arrays
—blocking factor for shared layout
—shared [BLOCKSIZE] double grids[N][N];
N
N
Default
BLOCKSIZE=
Column Blocks
BLOCKSIZE=N/THREADS
Distribution by Row
BLOCKSIZE=N
— shared [3] int A[4][THREADS];
Thread 0 Thread 1 Thread 2 Thread 3
The mapping is not pretty for most blocking factors