0% found this document useful (0 votes)
180 views14 pages

BCS702 Parallel Computing Notes

The document covers the fundamentals of parallel hardware and software, detailing classifications of parallel computers such as SIMD and MIMD systems, and their respective interconnection networks. It discusses the complexities of parallel software development, including synchronization, shared and distributed memory, and GPU programming. Key challenges like cache coherence and race conditions are also highlighted, along with solutions for effective parallel programming.

Uploaded by

KIRAN KUMAR D
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
180 views14 pages

BCS702 Parallel Computing Notes

The document covers the fundamentals of parallel hardware and software, detailing classifications of parallel computers such as SIMD and MIMD systems, and their respective interconnection networks. It discusses the complexities of parallel software development, including synchronization, shared and distributed memory, and GPU programming. Key challenges like cache coherence and race conditions are also highlighted, along with solutions for effective parallel programming.

Uploaded by

KIRAN KUMAR D
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

BCS702 – Module 1 Notes

Parallel Hardware and Parallel Software


Table of Contents
1. Parallel Hardware
1.1 Classifications of Parallel Computers
1.2 SIMD Systems
1.3 MIMD Systems
1.4 Interconnection Networks
1.5 Cache Coherence
1.6 Shared vs Distributed Memory
2. Parallel Software
2.1 Caveats
2.2 Coordinating Processes/Threads
2.3 Shared Memory
2.4 Distributed Memory
2.5 GPU Programming
1. Parallel Hardware
Parallel hardware enables multiple computations to run simultaneously. It is essential in
modern computing to improve performance, especially in data-heavy tasks like simulations
and image processing.
1.1 Classifications of Parallel Computers
Flynn’s Taxonomy classifies computers based on the number of instruction and data
streams:

- SISD: Single instruction, single data

- SIMD: Single instruction, multiple data

- MIMD: Multiple instruction, multiple data

Another classification is based on memory access:

- Shared memory: Cores access common memory

- Distributed memory: Each core has its own memory and uses messages to communicate
1.2 SIMD Systems
SIMD (Single Instruction, Multiple Data) systems apply one instruction to many data points
simultaneously.

Used in image processing, simulations, and vector math operations.

Limitation: All data streams must execute the same instruction.

Vector processors and GPUs are examples of SIMD systems.


1.3 MIMD Systems
MIMD systems use independent processors with separate instruction streams and data sets.

Processors run asynchronously, suitable for complex and diverse tasks.

MIMD includes:

- Shared-memory systems (e.g., multicore CPUs)

- Distributed-memory systems (e.g., clusters of computers)


1.4 Interconnection Networks
These connect processors and memory in a parallel system.

Shared-memory systems use buses and crossbars.

Distributed-memory systems use rings, meshes, hypercubes, and omega networks.

Key terms:

- Latency: Delay before data starts transferring

- Bandwidth: Rate at which data transfers


1.5 Cache Coherence
Problem: When multiple processors cache the same variable, updates by one processor may
not be seen by others.

Solutions:

- Snooping: Cores monitor a shared bus for updates

- Directory-based: Each memory block tracks which cores have cached it

False Sharing: Performance issue when different threads update variables in the same cache
line.
1.6 Shared vs Distributed Memory
Shared-memory: Easier to program, but harder to scale due to bus limitations.

Distributed-memory: Harder to program, but scales better with more processors.


2. Parallel Software
Writing software for parallel systems involves more complexity than serial programs.

Programmers need to manage synchronization, communication, and potential errors like


race conditions.
2.1 Caveats
Not all problems can be parallelized.

Some are 'embarrassingly parallel' (e.g., processing independent images), while others
require complex coordination.
2.2 Coordinating Processes/Threads
Threads/processes must be synchronized to avoid errors.

Load balancing and communication minimization are key.

Parallelizing is the act of converting a serial program to run in parallel.


2.3 Shared Memory
Uses threads that access a common memory space.

Thread types:

- Dynamic (created/destroyed as needed)

- Static (created once and reused)

Issues:

- Nondeterminism: Output may vary by run

- Race conditions: Conflicting writes to the same variable

Solutions: Mutexes (locks), semaphores, and monitors.


2.4 Distributed Memory
Processes use message-passing to share data.

Message-passing APIs include send() and receive() functions.

MPI (Message Passing Interface) is the most popular API.

Drawback: Requires significant program restructuring.


2.5 GPU Programming
GPUs are used for parallel tasks like image processing and simulations.

GPU programming is heterogeneous:

- Code runs on both CPU (host) and GPU (device)

- Data must be transferred between host and device

Popular platforms: CUDA and OpenCL

Common questions

Powered by AI

SIMD architecture is particularly suited for tasks like image processing because it can apply the same instruction to multiple data points simultaneously, which is efficient for pixel-by-pixel operations across large images . This parallelism is well-suited for vector math operations and accelerates computations that deal with large datasets efficiently . However, SIMD systems face limitations as they require all data streams to execute the same instruction, which can be inefficient for processes that require diverse operations or decision-making across data elements .

Cache coherence challenges in parallel computing arise when multiple processors cache the same variable, leading to potential inconsistencies if one processor updates the data and others do not see this update . Typical solutions include snooping and directory-based approaches. Snooping involves processors monitoring a shared communication line for updates, while directory-based methods involve tracking the cores that cache each memory block to ensure synchronization . Issues like false sharing, where different processors inadvertently affect each other's caches by sharing the same cache line, also need to be addressed .

Shared memory systems, where all processors access a common memory space, simplify programming due to easy data sharing and global memory access but face scalability challenges due to congestion and limitations of the bus communication . Conversely, distributed memory systems, where each processor has its own memory and communicates using message-passing techniques, offer better scalability by reducing congestion and allowing more independence between processors . However, they require more complex programming to handle explicit data exchange and task synchronization .

Programmers writing parallel software face challenges such as synchronization, communication overhead, race conditions, and nondeterministic behavior . Strategies to address these include using synchronization primitives like mutexes, semaphores, and monitors to manage access to shared resources and prevent race conditions . Additionally, employing load balancing to distribute work evenly across processors and minimizing communication can reduce overhead . Careful program design and testing are crucial to managing nondeterminism and ensuring consistent output .

MIMD architecture supports the execution of diverse tasks within parallel computing systems by allowing processors to operate independently with separate instruction streams and data sets, enabling asynchronous operation . This flexibility makes MIMD systems suitable for handling complex problems that require varying computational operations and data manipulations simultaneously. MIMD can incorporate both shared-memory and distributed-memory systems, offering versatility in application from multi-core CPUs to computer clusters .

In shared memory parallelism, dynamic threads offer flexibility as they can be created and destroyed as needed, allowing for adaptive resource usage based on the computational demands . This can optimize resource allocation and performance for varying workloads. However, managing dynamic threads can introduce overhead and complexity in ensuring synchronization and avoiding race conditions . Static threads, on the other hand, are created once and reused, simplifying management and reducing overhead but potentially leading to inefficiencies if the number of threads does not align with workload demands, as resources can be underutilized or overallocated .

CUDA and OpenCL are both frameworks for GPU programming but differ fundamentally in their design and application which impacts parallel task management. CUDA, developed by NVIDIA, is tailored specifically to NVIDIA GPUs, enabling optimizations unique to their architecture . In contrast, OpenCL is a more open standard that can be used across different types of hardware platforms, thus providing broader compatibility . This diversity affects how tasks are managed, as CUDA might allow more fine-tuning on NVIDIA devices whereas OpenCL provides more flexibility across various systems but may not be as optimized for any single architecture .

Message-passing interfaces like MPI help manage distributed memory systems by enabling processes to communicate and share data explicitly through defined messages, thus maintaining the independence of each processor's memory . This explicit communication facilitates scalability and flexibility in system architecture. However, MPI introduces challenges such as the requirement for significant program restructuring to manage the data flow and synchronization manually. Programmers must handle message exchanges, which can increase complexity and the likelihood of errors in program execution .

Flynn's Taxonomy classifies computers based on the number of instruction streams and data streams they can process simultaneously under four categories: SISD (Single Instruction, Single Data), SIMD (Single Instruction, Multiple Data), MIMD (Multiple Instruction, Multiple Data), and MISD (Multiple Instruction, Single Data). These classifications affect the performance of parallel computing by determining how efficiently different algorithms can be processed. For example, SIMD is suitable for tasks such as image processing where the same operation is applied to many data points simultaneously, whereas MIMD is more versatile and suited for complex tasks requiring different operations and data .

Interconnection networks influence performance by dictating the latency and bandwidth through which data transfers happen within parallel computing systems. In shared-memory systems, buses and crossbar switches are typical, which can limit scalability due to shared communication paths . Distributed-memory systems use more complex networks like rings, meshes, hypercubes, and omega networks, which facilitate more direct communication paths between processors and help distribute traffic evenly, thus enhancing scalability . Choices in network topology affect how quickly and efficiently data can be transferred, impacting overall computational performance and scalability .

You might also like