Figure 7 shows a matrix multiplication example demonstrating the use of the Bayanihan BSP programming interface. Here, we use a single BSPMainWork subclass with separate bsp_main() and bsp_run() methods. The initVars() method is called in both the worker and main work objects before running bsp_run() and bsp_main(). The algorithm used is based on one of the MPI example programs in [12], where each process i from 1 to n is given a copy of the matrix B and row i-1 of A, and computes row i-1 of the product C.