MISO education

This course builds on your experience writing numerical code in Fortran. It aims to help you read and modify MISO’s C++ code, and add your own computations. We start from what you know about variables, arrays, loops, and subroutines. We assume no knowledge of Fortran derived types, pointers, or C++.

MISO is available on GitHub (https://github.com/is-isee/MISO). Follow the source paths shown in the text (such as miso/include/miso/execution.hpp) from the folder where you cloned MISO. Replace /path/to/MISO in the command examples with the location where you placed MISO.

Main text

The course has 4 parts and 11 chapters. We start by writing small computations in C++, learn arrays and parallel computing, build a heat conduction program, and then read MISO’s time evolution.

I. Preparation

  1. Development Environment and CMake — Set up the tools on Ubuntu or Mac, and learn how CMake works and how to build MISO.

II. C++ Basics

  1. Variables, Functions, and Control Flow — Write short serial computations, and split the work into functions and files.

  2. References, Pointers, and Lifetime — Trace which variables are read and written, and how long they remain usable.

  3. Classes and Structs — Bundle data and operations together, and learn initialization and cleanup.

  4. Inheritance and CRTP — Put common processing in a base class, and supply the parts specific to each problem in derived classes.

  5. Templates — Read and write functions and classes that are specialized on a type (Real) or a place of computation (Backend).

III. Parallel Computing in MISO

  1. Arrays, Lambdas, and Parallel Loops on the CPU — Prepare arrays and compute with for_each and reduce.

  2. Domain Decomposition with MPI — Divide the domain, exchange neighboring values, and compute global sums.

  3. Computing and Transferring Data on a GPU (CUDA) — Distinguish the place of computation from memory, and run the same lambda on the GPU.

IV. Capstone Practice and Reading the Core Code

  1. Heat Conduction Calculation — Combine finite differences, time integration, and boundary handling, and parallelize the serial version.

  2. Reading MISO’s Time Evolution — Map the small computations you wrote yourself onto the division of roles in MISO itself.

With only the CPU on Ubuntu or Mac, you can work through Chapters 1–8 → the serial and MPI parts of Chapter 10 → Chapter 11. You can read Chapter 9 even without a GPU.

The answers to the in-chapter exercises are collapsed under “Answer and explanation”. Assignments that build a complete program are collected in the Practice List, and the relevant places in the text point to them.

Reference material to consult when needed

The reference list collects the glossary, the Fortran correspondence table, a quick reference of symbols, how to test and compare results, and GPU troubleshooting. You do not need to read it through before reading the main text.