Add questions to TSP and PDEs notebooks

This commit is contained in:
Gelieza K
2023-11-16 12:50:09 +01:00
parent 685d3db6a5
commit b628e017c1
4 changed files with 4466 additions and 67 deletions

View File

@@ -38,10 +38,21 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"id": "7e93809a",
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"tsp_check_4 (generic function with 1 method)"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"using Printf\n",
"function answer_checker(answer,solution)\n",
@@ -53,7 +64,8 @@
"end\n",
"tsp_check_1(answer) = answer_checker(answer, 16)\n",
"tsp_check_2(answer) = answer_checker(answer, 2)\n",
"tsp_check_3(answer) = answer_checker(answer, \"d\")"
"tsp_check_3(answer) = answer_checker(answer, \"d\")\n",
"tsp_check_4(answer) = answer_checker(answer, \"a\")"
]
},
{
@@ -810,6 +822,40 @@
"This avoids the performance issues of the previous approach: the workers are not idle since they get new work every time they finish a job. To avoid the search overhead, it is also important that the workers communicate the minimum distance each time they update their local minimum distance. "
]
},
{
"cell_type": "markdown",
"id": "81219a27",
"metadata": {},
"source": [
"<div class=\"alert alert-block alert-success\">\n",
" <b>Question:</b> To find the right <i> maxhops </i> level is a tradeoff between...\n",
"</div>\n",
" \n",
" a) Communication overhead (large maxhops) and load imbalance (small maxhops). \n",
" b) Search overhead (large maxhops) and load imbalance (small maxhops). \n",
" c) the number of workers (large maxhops) and the job size (small maxhops). \n",
" d) buffer for the job queue (large maxhops) and idle time of the coordinator process (small maxhops)."
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "0cf1ec88",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"It's not correct. Keep trying! 💪\n"
]
}
],
"source": [
"answer=\"x\" #Replace x with a,b,c, or d\n",
"tsp_check_4(answer)"
]
},
{
"cell_type": "markdown",
"id": "5e4fdbe1",
@@ -1157,12 +1203,16 @@
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "edbea7ac",
"cell_type": "markdown",
"id": "c789dc7a",
"metadata": {},
"outputs": [],
"source": []
"source": [
"# License\n",
"\n",
"\n",
"\n",
"This notebook is part of the course [Programming Large Scale Parallel Systems](https://www.francescverdugo.com/XM_40017) at Vrije Universiteit Amsterdam and may be used under a [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) license."
]
}
],
"metadata": {