BCS702 Parallel Computing Notes
BCS702 Parallel Computing Notes
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 .