Jump to ratings and reviews
Rate this book

Scientific Programming and Computer Architecture

Rate this book
A variety of programming models relevant to scientists explained, with an emphasis on how programming constructs map to parts of the computer. What makes computer programs fast or slow? To answer this question, we have to get behind the abstractions of programming languages and look at how a computer really works. This book examines and explains a variety of scientific programming models (programming models relevant to scientists) with an emphasis on how programming constructs map to different parts of the computer's architecture. Two themes emerge: program speed and program modularity. Throughout this book, the premise is to get under the hood, and the discussion is tied to specific programs.

The book digs into linkers, compilers, operating systems, and computer architecture to understand how the different parts of the computer interact with programs. It begins with a review of C/C++ and explanations of how libraries, linkers, and Makefiles work. Programming models covered include Pthreads, OpenMP, MPI, TCP/IP, and CUDA. The emphasis on how computers work leads the reader into computer architecture and occasionally into the operating system kernel. The operating system studied is Linux, the preferred platform for scientific computing. Linux is also open source, which allows users to peer into its inner workings. A brief appendix provides a useful table of machines used to time programs. The book's website has all the programs described in the book as well as a link to the html text.

624 pages, Hardcover

Published July 28, 2017

1 person is currently reading
7 people want to read

About the author

Divakar Viswanath

2 books1 follower

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
0 (0%)
4 stars
1 (33%)
3 stars
2 (66%)
2 stars
0 (0%)
1 star
0 (0%)
Displaying 1 of 1 review
Profile Image for Tech Nossomy.
422 reviews6 followers
January 13, 2024
A book on scientific computing, or rather writing performant source code for scientific / engineering software programs. Its target audience are indeed scientists and engineers with some programming experience. A big contribution of the book is an implementation of a program that measures clock cycles of C/C++ programs.

Textually the book is sporadically unpolished, and aside from many repetitions, there are also other shortcomings:
* Sparse mentions are made of optimisation features offered by some compilers, such as -O1, -O2 etc., and what would motivate which choice is not revealed.
* The final chapter gives a recommendation for graphically displaying software output:
"One solution is to use a simple C++ class that outsources all the plotting to Python."
The author is making the point here that rather than properly learning a tool that performs its intended task (say gnuplot), it is suggested to use a second language instead, which is poor programming practice.
* Flops does not stand for "floating point operations", but floating point operations per second. As a result, GFlops is not "Gigaflops per second" either, strictly speaking.
* Stylistically the book could have benefited from the use of LateX, including the use of the letter "j" for the imaginary unit.
* Also using a monospace font for source code would have helped for legibility.
* The fastest supercomputers in the world are listed in the TOP500, not variously "Top 500" or "TOP 500". By the way, these days they are called high-performance computers as opposed to supercomputers.
* Libraries such as GSL or Boost are not discussed. For example, while the author is somewhat dismissive of Fortran, the NAG library is not discussed.
* Maintainability of code or even legibility of code is not discussed. There is a famous example popularised by Donald Knuth who presented an example of a pseudo-random number generator that was quite performant, but no one understood the code. The point is that code is far more read than it is written and well-designed and well-written code has a role in developing an ecosystem of performant code.
* Unknown to the author at the time, the Xeon Phi MIC was manufactured for a few short years and its support in both C compilers and the Linux kernel is gradually being abandoned. This fact largely removes the need for having chapter 7.
* Also unknown to the author is the advent of the Zen series of processors by the company AMD. This would have opened up an opportunity to make the text far less Intel-centric.

The book is freely available on various websites, such as OApen.
Displaying 1 of 1 review

Can't find what you're looking for?

Get help and learn more about the design.