{
"cells": [
{
"cell_type": "markdown",
"id": "2e15ced8",
"metadata": {},
"source": [
"
\n",
"\n",
"### Programming large-scale parallel systems"
]
},
{
"cell_type": "markdown",
"id": "e8549215",
"metadata": {},
"source": [
"# Jacobi method"
]
},
{
"cell_type": "markdown",
"id": "6e0ef563",
"metadata": {},
"source": [
"## Contents\n",
"\n",
"In this notebook, we will learn\n",
"\n",
"- How to paralleize a Jacobi method\n",
"- How the data partition can impact the performance of a distributed algorithm\n",
"- How to use latency hiding\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "1dc78750",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"jacobi_2_check (generic function with 1 method)"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"using Printf\n",
"\n",
"function answer_checker(answer,solution)\n",
" if answer == solution\n",
" \"🥳 Well done! \"\n",
" else\n",
" \"It's not correct. Keep trying! 💪\"\n",
" end |> println\n",
"end\n",
"gauss_seidel_1_check(answer) = answer_checker(answer,\"c\")\n",
"jacobi_1_check(answer) = answer_checker(answer, \"d\")\n",
"jacobi_2_check(answer) = answer_checker(answer, \"b\")"
]
},
{
"cell_type": "markdown",
"id": "d4cb59d5",
"metadata": {},
"source": [
"## The Jacobi method for the Laplace equation\n",
"\n",
"\n",
"The [Jacobi method](https://en.wikipedia.org/wiki/Jacobi_method) is a numerical tool to solve systems of linear algebraic equations. One of the main applications of the Jacobi method is to solve boundary value problems (BVPs). I.e., given the values at the boundary (of a grid), the Jacoby method will find the interior values that fulfill a certain equation.\n",
"\n"
]
},
{
"cell_type": "markdown",
"id": "6a2bdbc6",
"metadata": {},
"source": [
"