PGAS is a parallel programming model that aims to improve programmer productivity while still achieving high performance. It assumes a global memory address space that is logically partitioned, with each process or thread having a portion of memory local to it. Two languages that use this model are Chapel and X10. PGAS combines aspects of shared memory and distributed memory models - it allows data to be accessed globally like shared memory but exploits data locality like distributed memory. While it hides communication details, it does not eliminate communication latency. PGAS seeks to balance ease of programming with scalability.
2. Programming model
What is programming model?
– A view of data and execution
– Where architecture and applications meet
OR
– The logical interface between architecture and applications
Why Programming models necessary?
– Write applications that run effectively across architectures
– Design new architectures that can effectively support legacy
applications
3. What is PGAS Programming model?
■ a parallel programming model that aims to improve
programmer productivity
■ at the same time aiming for high performance
■ It is also known as DSM (Distributed shared memory model)
OR
• A partitioned global address space (PGAS) is a parallel
programming model. It assumes a global memory address
space that is logically partitioned and a portion of it is local to
each process, thread, or processing
element.Two programming languages that use this model are
Chapel and X10.
4. Shared Memory Model
■ Manipulating shared data
may require synchronization
■ Does not allow locality
exploitation
■ Example: Open MP
■ Simple statements
– Read remote memory via
an expression
– Write remote memory
through assignment
5. Continue…
■ Drawbacks
– Primary disadvantage is the lack of scalability between memory and CPUs. Adding
more CPUs can geometrically increases traffic on shared memory-CPU path and for
cache coherent system geometrically increases traffic associated with
cache/memory management.
– It becomes increasingly difficult and expensive to design and produce shared
memory machines with ever increasing number of processors
■ Advantages
– Global address space provides a user friendly programming perspective to memory
– Ease of programming
– Lower latency
– Easier to use Hardware control caching
6. Distributed Memory Model
■ In distributed memory
machines, each processor has
its own individual memory
location and has no direct
knowledge about other
processors memory.
■ For data sharing, it must be
passed from one processor to
another as message since
there is no shared memory
7. Continue…
■ Drawbacks
– the data and task decomposition are factors that mostly have to be
dealt with explicitly
– The access to data that are not in the local memory belonging to a
particular processor have to be obtained from non-local memory (or
memories)
■ Advantages
– Since each processor controls its own memory, it is impossible for one
process to overwrite a variable controlled by another process
– It is faster and has directly accessible local memory
– Each process owns private variables in the shared address space
(making better use of cache), “communication” consists of copying
variables in RAM.
8. Distributed Shared memory Model
■ Similar to shared Memory
Paradigm
■ Memory Mi has affinity to
threadThi
■ Helps exploiting locality of
references
■ Simple statements
■ Example: UPC and
Titanium
9. Continue…..
■ Drawbacks:
– It is prone to thrashing problem
– The advantage of parallelism can not be availed in this method also.
– Must provide additional protection against simultaneous accesses to shared data
■ Advantage:
– No communication cost are incurred when a process accesses data currently held
locally
– It allows the applications to take advantage of data access locality
– Generally cheaper than using a multiprocessor system
– Programs are more portable due to the common programming interfaces
10. Shared memory vs. distributed memory vs.
distributed shared memory
■ The advantage of shared memory is that it offers a unified address
space in which all data can be found.
■ The advantage of distributed memory is that it excludes race
conditions, and that it forces the programmer to think about data
distribution.
■ The advantage of distributed (shared) memory is that it is easier to
design a machine that scales with the algorithm
Distributed shared memory hides the mechanism of communication, it
does not hide the latency of communication.