From the course: Parallel and Concurrent Programming with C++ Part 2

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Computational graph

Computational graph - C++ Tutorial

From the course: Parallel and Concurrent Programming with C++ Part 2

Start my 1-month free trial

Computational graph

- The key to parallel programing is determining which steps within a program can be executed in parallel, and then figuring out how to coordinate them. And one tool to help model how steps in a program relate to each other is a computational graph. Consider the steps to make a very simple salad. I'll need to chop some lettuce, chop some tomatoes, mix those chopped ingredients together, and then finally add salad dressing. Each of those steps represents a task, which is a unit of execution or a unit of work. I can draw those tasks as nodes in a graph and use arrows to indicate progression form one task to the next. A task cannot begin executing until all of the tasks with arrows feeding into it have completed. When those four tasks are arranged sequentially like this, they represent a single path of execution, which could be implemented as a single thread or process. If I do those steps in that order, I'll make a…

Contents