- عنوان کتاب: Parallel and High Performance Programming with Python (2nd Edition)
- نویسنده: Fabio Nelli
- حوزه: برنامهنویسی پایتون
- سال انتشار: 2026
- تعداد صفحه: 702
- زبان اصلی: انگلیسی
- نوع فایل: pdf
- حجم فایل: 10.1 مگابایت
ویرایش دوم کتاب «برنامهنویسی موازی و با کارایی بالا با پایتون» برای انعکاس چگونگی استفاده از محاسبات موازی و با کارایی بالا در دنیای امروز تهیه شده است. این کتاب رویکردهای بهروز شده، مثالهای دنیای واقعی و مقایسههای متفکرانه با ساختار اصلی را معرفی میکند. شش فصل جدید به نیازهای عملی که در طول زمان پدیدار شدهاند، از جمله محاسبات ابری و بدون سرور برای مقیاسپذیری الاستیک و اجرای مقرونبهصرفه، میپردازد. این کتاب الگوهای قابل استفاده مجدد مانند fan-out/fan-in، ذخیرهسازی استراتژیک و idempotency را در کنار چکلیستهای متمرکز بر تولید که شامل مشاهدهپذیری، کنترل هزینه و حساسیت دادهها میشود، ارائه میدهد. همچنین محدودیتهای دنیای واقعی، از جمله GIL، بارهای کاری I/O-bound، هزینههای shuffle، شروعهای سرد، سربار سریالسازی و محدودیتهای حافظه را به وضوح توضیح میدهد. این کتاب که به عنوان یک مرجع عملی طراحی شده است، مفاهیم و مسیرهای عملی را ارائه میدهد که خوانندگان میتوانند بلافاصله از آنها استفاده کنند و به متخصصان کمک میکند تا برای آیندهای که ترکیب مؤثر نرمافزار، داده، ابر و سختافزار ضروری است، آماده شوند. فصل 1: مقدمهای بر برنامهنویسی موازی این فصل تفاوت بین همزمانی و موازیسازی، نقش CPUها، هستهها، نخها و فرآیندها و تکامل فناوری که منجر به معماریهای موازی شده است را توضیح میدهد. چالشهای خاص در پایتون مانند قفل مفسر سراسری (GIL) به همراه استراتژیهایی برای غلبه بر آنها مورد بررسی قرار میگیرند. مدلهای کلیدی برنامهنویسی، مسائل همگامسازی و گذار از حافظه مشترک به سیستمهای توزیعشده نیز پوشش داده میشوند و با روشهایی برای ارزیابی عملکرد و مقیاسپذیری به پایان میرسند. فصل 2: برنامهنویسی موازی با نخها این فصل چندنخیسازی در پایتون را به عنوان راهی برای پیادهسازی اجرای موازی معرفی میکند. نحوه ایجاد و مدیریت نخها، مکانیسمهای موجود برای همگامسازی و چالشهای اشتراکگذاری منابع و شرایط رقابتی را توضیح میدهد. هم ابزارهای سطح بالا مانند concurrent.futures و هم ابزارهای سطح پایین مانند قفلها، سمافورها و رویدادها به طور کامل مورد بحث قرار میگیرند. رویکردهای عملی برای سفارشیسازی نخها و هماهنگی وظایف نیز ارائه شده است و ویژگیهای استاندارد پایتون را برای اجرای موازی ایمن و کارآمد برجسته میکند. فصل 3: برنامهنویسی موازی با فرآیندها این فصل ماژول چندپردازشی را معرفی میکند و نحوه ایجاد و مدیریت فرآیندها، توزیع کارآمد حجم کار و مدیریت ارتباط بین آنها از طریق صفها و لولهها را توضیح میدهد. همچنین کتابخانه mpi4py را برای محاسبات توزیعشده در مقیاس بزرگ پوشش میدهد و روشهای ارتباط نقطه به نقطه و جمعی را برجسته میکند. مقایسههایی بین نخبندی و چندپردازشی انجام میشود و تکنیکهای بهینهسازی پیشرفته، از جمله زمانبندی کار و مدیریت منابع، نیز برای بهبود مقیاسپذیری و عملکرد بررسی میشوند. فصل 4: برنامهنویسی ناهمزمان این فصل تفاوتهای بین مدلهای همزمان و ناهمزمان را توضیح میدهد و مزایا و معایب هر رویکرد را نشان میدهد. کتابخانه asyncio به عنوان چارچوب اصلی ارائه شده است و مفاهیمی مانند coroutineها، وظایف، futureها و حلقه رویداد در پایه آن قرار دارند. ویژگیهای پیشرفتهای مانند تکرارهای ناهمزمان، صفها و کتابخانههای جایگزین، همراه با محدودیتهایی در زمینههای I/O-intensive و CPU-bound معرفی میشوند. این فصل با استراتژیهای مدیریت خطا و الگوهای طراحی برای ساخت برنامههای مقیاسپذیر و انعطافپذیر به پایان میرسد. فصل ۵: پایتون توزیعشده این فصل اصول و بدهبستانهای برنامهنویسی توزیعشده را معرفی میکند و سه چارچوب کلیدی پایتون را ارائه میدهد: Celery، یک سیستم قوی برای صفهای وظیفه با ویژگیهای پیشرفته؛ Dramatiq، یک جایگزین سادهتر که برای ادغام سریع طراحی شده است؛ و SCOOP، یک کتابخانه سبک برای اجرای توزیعشده وظایف موازی. مثالهای عملی مانند روش مونت کارلو، کاربرد آنها را نشان میدهد. این فصل با مقایسه این چارچوبها از نظر معماری، عملکرد و مناسب بودن برای برنامههای مختلف به پایان میرسد. فصل ۶: برنامهنویسی GPU با پایتون این فصل مدل برنامهنویسی CUDA و استفاده از کتابخانههای پایتون مانند Numba و PyOpenCL را معرفی میکند. نحوه راهاندازی محیطهای توسعه GPU، نوشتن و اجرای هستهها، مدیریت کارآمد حافظه و محک زدن برنامههای مبتنی بر GPU را توضیح میدهد. مثالهای عملی، از جمله عملیات ماتریسی و محاسبات MapReduce، نشان میدهند که چگونه GPUها حجم کارهای علمی و دادهمحور را تسریع میکنند. فصل 7: کاربردهای محاسبات موازی این فصل نقش محاسبات با کارایی بالا (HPC) را در حل مسائل پیچیده برجسته میکند، مزایای توزیع حجم کار بین هزاران پردازنده را توضیح میدهد و کارایی و مقیاسپذیری حاصل از روشهای موازی را نشان میدهد. کاربردهای دنیای واقعی در حوزههایی مانند هواشناسی، زلزلهشناسی، اخترفیزیک، مهندسی، پزشکی، امور مالی و انرژی و همچنین در صنعت سرگرمی، جایی که موازیسازی موتورهای بازی، جلوههای بصری و انیمیشن سهبعدی را تقویت میکند، بررسی میشوند. فصل 8: محاسبات موازی برای علوم داده
This second edition of Parallel and High Performance Programming with Python was created to reflect how parallel and high-performance computing is practiced today. It introduces updated approaches, real-world examples, and thoughtful comparisons to the original structure. Six new chapters address practical needs that emerged over time, including cloud and serverless computing for elastic scaling and cost-efficient execution. The book presents reusable patterns such as fan-out/fan-in, strategic caching, and idempotency, alongside production-focused checklists covering observability, cost control, and data sensitivity. It also clearly explains real-world limitations, including the GIL, I/O-bound workloads, shuffle costs, cold starts, serialization overhead, and memory constraints. Designed as a hands-on reference, the book provides concepts and practical pathways that readers can apply immediately, helping professionals prepare for a future where effectively combining software, data, cloud, and hardware is essential. Chapter 1: Introduction to Parallel Programming The chapter explains the difference between concurrency and parallelism, the role of CPUs, cores, threads, and processes, and the technological evolution that led to parallel architectures. Specific challenges in Python such as the Global Interpreter Lock (GIL) are addressed along with strategies to overcome them. Key programming models, synchronization issues, and the transition from shared memory to distributed systems are also covered, concluding with methods for evaluating performance and scalability. Chapter 2: Parallel Programming with Threads This chapter introduces multithreading in Python as a way to implement parallel execution. It explains how threads are created and managed, the mechanisms available for synchronization, and the challenges of resource sharing and race conditions. Both high-level tools such as concurrent.futures and low-level primitives like locks, semaphores, and events are discussed thoroughly. Practical approaches for customizing threads and coordinating tasks are also presented, highlighting Python’s standard features for safe and efficient parallel execution. Chapter 3: Parallel Programming with Processes This chapter introduces the multiprocessing module, explaining how to create and manage processes, distribute workloads efficiently, and handle communication between them through queues and pipes. It also covers the mpi4py library for large-scale distributed computing, highlighting point-topoint and collective communication methods. Comparisons between threading and multiprocessing are made, and advanced optimization techniques, including job scheduling and resource management, are also explored to improve scalability and performance. Chapter 4: Asynchronous Programming This chapter explains the differences between synchronous and asynchronous models, showing the advantages and trade-offs of each approach. The asyncio library is presented as the core framework, with concepts such as coroutines, tasks, futures, and the event loop at its foundation. Advanced features such as asynchronous iterations, queues, and alternative libraries are introduced, along with limitations in I/O-intensive and CPU-bound contexts. The chapter concludes with error-handling strategies and design patterns for building scalable and resilient applications. Chapter 5: Distributed Python This chapter introduces the principles and trade-offs of distributed programming, and presents three key Python frameworks: Celery, a robust system for task queues with advanced features; Dramatiq, a simpler alternative designed for quick integration; and SCOOP, a lightweight library for distributed execution of parallel tasks. Practical examples such as the Monte Carlo method illustrate their use. The chapter concludes with a comparison of these frameworks in terms of architecture, performance and suitability for different applications. Chapter 6: GPU Programming with Python This chapter introduces the CUDA programming model, and the use of Python libraries such as Numba and PyOpenCL. It explains how to set up GPU development environments, write and run kernels, manage memory efficiently, and benchmark GPU-based applications. Practical examples, including matrix operations and MapReduce calculations, demonstrate how GPUs accelerate scientific and data-intensive workloads. Chapter 7: Parallel Computing Applications This chapter highlights the role of High-performance Computing (HPC) in solving complex problems, explains the benefits of distributing workloads across thousands of processors, and illustrates the efficiency and scalability achieved through parallel methods. Real-world applications are explored in domains such as meteorology, seismology, astrophysics, engineering, medicine, finance, and energy, as well as in the entertainment industry, where parallelism powers game engines, visual effects, and 3D animation. Chapter 8: Parallel Computing for Data Science This chapter introduces Pandas and its constraints, then presents Dask as a framework for scaling analysis on both single machines and distributed clusters. Practical platforms such as Kaggle and Saturn.io illustrate realworld workflows, while tools for monitoring, profiling, and optimizing performance are explored. Finally, GPU acceleration with Dask-CUDA and the RAPIDS ecosystem demonstrates how parallelism can further speed up machine learning and data processing tasks. Chapter 9: Parallel Computing for Artificial Intelligence Artificial intelligence (AI) depends on parallel computing to reach the scale required for training and deploying modern models. This chapter introduces the main branches of AI, including machine learning and deep learning, and shows how parallelism accelerates training, supports large datasets, and enables real-time inference. Libraries such as Scikit-learn with Dask-ML, as well as PyTorch and TensorFlow with GPU and distributed execution, are presented through practical examples, including dataset training and model visualization. Chapter 10: Future of Parallel Programming The future of parallel programming is shaped by emerging paradigms such as exascale and quantum computing, massively parallel AI, and distributed infrastructures. These advances are transforming both technology and professional opportunities, with direct implications for Python and modern AI frameworks. From edge computing and cyber-physical systems to breakthroughs in scientific simulations, parallelism is moving toward decentralized, scalable, and intelligent infrastructures. For Python to remain central, its ecosystem must evolve with stronger concurrency models, GPU integration, and scalable frameworks. Chapter 11: Modern Frameworks for Parallelism and Distribution: Ray and Modin Modern frameworks such as Ray and Modin extend Python’s capabilities for distributed and parallel computing. Ray provides a general-purpose system for scaling tasks and actors across clusters, supporting both traditional workloads and AI/ML applications. Modin builds on Ray to deliver a parallel alternative to Pandas, enabling large-scale data analysis with minimal code changes. The chapter also compares these frameworks with alternatives such as Dask and Celery, highlighting their strengths, trade-offs, and best-fit use cases. Chapter 12: PySpark The chapter introduces Spark’s execution model, and how PySpark allows parallel operations through a Pythonic interface. It covers MLlib for largescale machine learning, optimization strategies, and monitoring with the Spark UI. Real-time data pipelines are addressed with Spark Streaming and integrations with Kafka, HDFS, and cloud storage. Finally, GraphFrame is presented as a tool for graph analytics, supporting advanced applications like network analysis and recommendations. Chapter 13: Joblib This chapter explores how Joblib streamlines process-based parallelism for tasks that can be split into independent units, and how it integrates seamlessly with NumPy through memory mapping and serialization. Its caching mechanisms are highlighted as a way to optimize repetitive computations, making it valuable in data processing and machine learning workflows. Finally, the chapter examines Joblib’s limitations, particularly its narrower scope and lack of scalability compared to more advanced distributed frameworks. Chapter 14: Parallelization on Cloud and Serverless Systems This chapter introduces cloud-native tools that provide elastic scaling and distributed execution, with a focus on AWS Lambda, Google Cloud Functions, and Azure Functions. Practical examples include parallel file processing and data pipelines, while Kubernetes is presented as a key orchestration tool for containerized workloads. The discussion highlights cost, scalability, and complexity trade-offs between serverless and traditional approaches, concluding with real-world use cases where cloudbased parallelism improves efficiency, and reduces operational overhead. Chapter 15: Parallel Programming with FPGAs This chapter introduces their architecture and programming approaches in Python through tools such as PyOpenCL, PyCUDA, PYNQ, and AMD Vitis. Simulation frameworks such as MyHDL are discussed with examples like vector addition and FPGA-based parallel tasks. A comparison with GPUs highlights the trade-off between efficiency, flexibility, and development complexity. The chapter concludes with advanced applications of FPGAs in domains such as artificial intelligence, cryptography, and physical simulations. Chapter 16: Introduction to Quantum Computing and Quantum Architectures This chapter introduces the foundations of quantum gates and circuits, explains how Qiskit enables simulation and experimentation in Python, and presents visualization tools like Bloch’s Sphere for understanding qubit states. Core concepts such as quantum parallelism are illustrated through algorithms like Deutsch–Jozsa and Grover’s search. The chapter concludes with applications in quantum machine learning, including Quantum Neural Networks and hybrid quantum–classical approaches.
این کتاب را میتوانید از لینک زیر بصورت رایگان دانلود کنید:
Download: Parallel and High Performance Programming with Python





نظرات کاربران