diff --git a/dev/getting_started_with_julia/index.html b/dev/getting_started_with_julia/index.html index 1b6ab35..6f6011c 100644 --- a/dev/getting_started_with_julia/index.html +++ b/dev/getting_started_with_julia/index.html @@ -14,4 +14,4 @@ julia> DataFrame(a=[1,2],b=[3,4])

You should get an error or a BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195"

Copy the contents of previous code block into a file called Project.toml and place it in an empty folder named newproject. It is important that the file is named Project.toml. You can create a new folder from the REPL with

julia> mkdir("newproject")

To install all the packages registered in this file you need to activate the folder containing your Project.toml file

(@v1.8) pkg> activate newproject

and then instantiating it

(newproject) pkg> instantiate

The instantiate command will download and install all listed packages and their dependencies in just one click.

Getting help in package mode

You can get help about a particular package operator by writing help in front of it

(@v1.8) pkg> help activate

You can get an overview of all package commands by typing help alone

(@v1.8) pkg> help

Package operations in Julia code

In some situations it is required to use package commands in Julia code, e.g., to automatize installation and deployment of Julia applications. This can be done using the Pkg package. For instance

julia> using Pkg
-julia> Pkg.status()

is equivalent to call status in package mode.

(@v1.8) pkg> status

Conclusion

We have learned the basics of how to work with Julia. If you want to further dig into the topics we have covered here, you can take a look and the following links

+julia> Pkg.status()

is equivalent to call status in package mode.

(@v1.8) pkg> status

Conclusion

We have learned the basics of how to work with Julia. If you want to further dig into the topics we have covered here, you can take a look and the following links

diff --git a/dev/index.html b/dev/index.html index 2558f85..95bb335 100644 --- a/dev/index.html +++ b/dev/index.html @@ -2,4 +2,4 @@ Home · XM_40017

Programming Large-Scale Parallel Systems (XM_40017)

Welcome to the interactive lecture notes of the Programming Large-Scale Parallel Systems course at VU Amsterdam!

What

This page contains part of the course material of the Programming Large-Scale Parallel Systems course at VU Amsterdam. We provide several lecture notes in jupyter notebook format, which will help you to learn how to design, analyze, and program parallel algorithms on multi-node computing systems. Further information about the course is found in the study guide (click here) and our Canvas page (for registered students).

Note

This page contains only part of the course material. The rest is available on Canvas. In particular, the lecture notes in this public webpage do not fully cover all topics in the final exam.

How to use this page

You have two main ways of running the notebooks:

  • Download the notebooks and run them locally on your computer (recommended)
  • Run the notebooks on the cloud via mybinder.org (high startup time).

You also have the static version of the notebooks displayed in this webpage for quick reference. At each notebook page you will find a green box with links to download the notebook or to open in on mybinder.

How to run the notebooks locally

To run a notebook locally follow these steps:

  • Install Julia (if not done already). More information in Getting started.
  • Download the notebook.
  • Launch Julia. More information in Getting started.
  • Execute these commands in the Julia command line:
julia> using Pkg
 julia> Pkg.add("IJulia")
 julia> using IJulia
-julia> notebook()
  • These commands will open a jupyter in your web browser. Navigate in jupyter to the notebook file you have downloaded and open it.

Authors

This material is created by Francesc Verdugo with the help of Gelieza Kötterheinrich. Part of the notebooks are based on the course slides by Henri Bal.

License

All material in this page that is original to this course may be used under a CC BY 4.0 license.

Acknowledgment

This page was created with the support of the Faculty of Science of Vrije Universiteit Amsterdam in the framework of the project "Interactive lecture notes and exercises for the Programming Large-Scale Parallel Systems course" funded by the "Innovation budget BETA 2023 Studievoorschotmiddelen (SVM) towards Activated Blended Learning".

+julia> notebook()

Authors

This material is created by Francesc Verdugo with the help of Gelieza Kötterheinrich. Part of the notebooks are based on the course slides by Henri Bal.

License

All material in this page that is original to this course may be used under a CC BY 4.0 license.

Acknowledgment

This page was created with the support of the Faculty of Science of Vrije Universiteit Amsterdam in the framework of the project "Interactive lecture notes and exercises for the Programming Large-Scale Parallel Systems course" funded by the "Innovation budget BETA 2023 Studievoorschotmiddelen (SVM) towards Activated Blended Learning".

diff --git a/dev/notebook-html/jacobi_method.html b/dev/notebook-html/jacobi_method.html index f5a2dda..0f06c36 100644 --- a/dev/notebook-html/jacobi_method.html +++ b/dev/notebook-html/jacobi_method.html @@ -8491,6 +8491,32 @@ d) Yes, because there are no writes to the send buffer in this iteration. +
+
+ + +
+
+
+ + +
+
diff --git a/dev/notebook-html/julia_async.html b/dev/notebook-html/julia_async.html index c035f6a..d25d50c 100644 --- a/dev/notebook-html/julia_async.html +++ b/dev/notebook-html/julia_async.html @@ -8392,6 +8392,32 @@ d) 3 seconds +
+
+ + +
+
+
+ + +
+
diff --git a/dev/notebook-html/julia_basics.html b/dev/notebook-html/julia_basics.html index 2314b2e..89ff75d 100644 --- a/dev/notebook-html/julia_basics.html +++ b/dev/notebook-html/julia_basics.html @@ -9459,6 +9459,32 @@ a.anchor-link { +
+
+ + +
+
+
+ + +
+
diff --git a/dev/notebook-html/julia_distributed.html b/dev/notebook-html/julia_distributed.html index eea5d29..639af60 100644 --- a/dev/notebook-html/julia_distributed.html +++ b/dev/notebook-html/julia_distributed.html @@ -9052,7 +9052,19 @@ d) 32 -
+
+
+
+ + +
+
diff --git a/dev/notebook-html/julia_tutorial.html b/dev/notebook-html/julia_tutorial.html index 2fbf050..3950af2 100644 --- a/dev/notebook-html/julia_tutorial.html +++ b/dev/notebook-html/julia_tutorial.html @@ -7834,6 +7834,32 @@ MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195"
+
+
+ + +
+
+
+ + +
+
diff --git a/dev/notebook-html/matrix_matrix.html b/dev/notebook-html/matrix_matrix.html index d0a1e62..32ade23 100644 --- a/dev/notebook-html/matrix_matrix.html +++ b/dev/notebook-html/matrix_matrix.html @@ -8776,7 +8776,19 @@ See the following code:

-
+
+
+
+ + +
+
diff --git a/dev/notebook-html/mpi_tutorial.html b/dev/notebook-html/mpi_tutorial.html index 8cba885..0320790 100644 --- a/dev/notebook-html/mpi_tutorial.html +++ b/dev/notebook-html/mpi_tutorial.html @@ -7828,7 +7828,19 @@ But it will probably not work since the version of mpiexec needs to
-
+
+
+
+ + +
+
diff --git a/dev/notebook-html/solutions.html b/dev/notebook-html/solutions.html index feb570d..6ba0eca 100644 --- a/dev/notebook-html/solutions.html +++ b/dev/notebook-html/solutions.html @@ -7438,13 +7438,111 @@ a.anchor-link {
+ + +
+
+
+ + +
+
+
+ + +
+
diff --git a/dev/notebooks/jacobi_2D/index.html b/dev/notebooks/jacobi_2D/index.html index 40efd44..12da0c3 100644 --- a/dev/notebooks/jacobi_2D/index.html +++ b/dev/notebooks/jacobi_2D/index.html @@ -18,4 +18,4 @@ var myIframe = document.getElementById("notebook"); iFrameResize({log:true}, myIframe); }); - + diff --git a/dev/notebooks/jacobi_method.ipynb b/dev/notebooks/jacobi_method.ipynb index 83018fc..5b57582 100644 --- a/dev/notebooks/jacobi_method.ipynb +++ b/dev/notebooks/jacobi_method.ipynb @@ -938,6 +938,26 @@ "source": [ "# TODO" ] + }, + { + "cell_type": "markdown", + "id": "6d3430ad", + "metadata": {}, + "source": [ + "# License\n", + "\n", + "TODO: replace link to website\n", + "\n", + "This notebook is part of the course [Programming Large Scale Parallel Systems](http://localhost:8000/) at Vrije Universiteit Amsterdam and may be used under a [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) license." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3d72ff47", + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { diff --git a/dev/notebooks/jacobi_method/index.html b/dev/notebooks/jacobi_method/index.html index a369129..22ab2c3 100644 --- a/dev/notebooks/jacobi_method/index.html +++ b/dev/notebooks/jacobi_method/index.html @@ -18,4 +18,4 @@ var myIframe = document.getElementById("notebook"); iFrameResize({log:true}, myIframe); }); - + diff --git a/dev/notebooks/julia_async.ipynb b/dev/notebooks/julia_async.ipynb index 6ba7813..9fab7f6 100644 --- a/dev/notebooks/julia_async.ipynb +++ b/dev/notebooks/julia_async.ipynb @@ -754,11 +754,31 @@ " sleep(i)\n", "end" ] + }, + { + "cell_type": "markdown", + "id": "a5d3730b", + "metadata": {}, + "source": [ + "# License\n", + "\n", + "TODO: replace link to website\n", + "\n", + "This notebook is part of the course [Programming Large Scale Parallel Systems](http://localhost:8000/) at Vrije Universiteit Amsterdam and may be used under a [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) license." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f9863011", + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { "kernelspec": { - "display_name": "Julia 1.9.0", + "display_name": "Julia 1.9.1", "language": "julia", "name": "julia-1.9" }, @@ -766,7 +786,7 @@ "file_extension": ".jl", "mimetype": "application/julia", "name": "julia", - "version": "1.9.0" + "version": "1.9.1" } }, "nbformat": 4, diff --git a/dev/notebooks/julia_async/index.html b/dev/notebooks/julia_async/index.html index 76e3368..e73a270 100644 --- a/dev/notebooks/julia_async/index.html +++ b/dev/notebooks/julia_async/index.html @@ -18,4 +18,4 @@ var myIframe = document.getElementById("notebook"); iFrameResize({log:true}, myIframe); }); - + diff --git a/dev/notebooks/julia_basics.ipynb b/dev/notebooks/julia_basics.ipynb index 61fdb37..993708d 100644 --- a/dev/notebooks/julia_basics.ipynb +++ b/dev/notebooks/julia_basics.ipynb @@ -1585,11 +1585,31 @@ "source": [ "# Implement here" ] + }, + { + "cell_type": "markdown", + "id": "357e0490", + "metadata": {}, + "source": [ + "# License\n", + "\n", + "TODO: replace link to website\n", + "\n", + "This notebook is part of the course [Programming Large Scale Parallel Systems](http://localhost:8000/) at Vrije Universiteit Amsterdam and may be used under a [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) license." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f8d92f25", + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { "kernelspec": { - "display_name": "Julia 1.9.0", + "display_name": "Julia 1.9.1", "language": "julia", "name": "julia-1.9" }, @@ -1597,7 +1617,7 @@ "file_extension": ".jl", "mimetype": "application/julia", "name": "julia", - "version": "1.9.0" + "version": "1.9.1" } }, "nbformat": 4, diff --git a/dev/notebooks/julia_basics/index.html b/dev/notebooks/julia_basics/index.html index 2a09d8e..de90882 100644 --- a/dev/notebooks/julia_basics/index.html +++ b/dev/notebooks/julia_basics/index.html @@ -18,4 +18,4 @@ var myIframe = document.getElementById("notebook"); iFrameResize({log:true}, myIframe); }); - + diff --git a/dev/notebooks/julia_distributed.ipynb b/dev/notebooks/julia_distributed.ipynb index 1699025..72db93d 100644 --- a/dev/notebooks/julia_distributed.ipynb +++ b/dev/notebooks/julia_distributed.ipynb @@ -1296,10 +1296,22 @@ "We have seen the basics of distributed computing in Julia. The programming model is essentially an extension of tasks and channels to parallel computations on multiple machines. The low-level functions are `remotecall` and `RemoteChannel`, but there are other functions and macros like `pmap` and `@distributed` that simplify the implementation of parallel algorithms." ] }, + { + "cell_type": "markdown", + "id": "9a49ad48", + "metadata": {}, + "source": [ + "# License\n", + "\n", + "TODO: replace link to website\n", + "\n", + "This notebook is part of the course [Programming Large Scale Parallel Systems](http://localhost:8000/) at Vrije Universiteit Amsterdam and may be used under a [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) license." + ] + }, { "cell_type": "code", "execution_count": null, - "id": "49d094e4", + "id": "8e36ae43", "metadata": {}, "outputs": [], "source": [] @@ -1307,7 +1319,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Julia 1.9.0", + "display_name": "Julia 1.9.1", "language": "julia", "name": "julia-1.9" }, @@ -1315,7 +1327,7 @@ "file_extension": ".jl", "mimetype": "application/julia", "name": "julia", - "version": "1.9.0" + "version": "1.9.1" } }, "nbformat": 4, diff --git a/dev/notebooks/julia_distributed/index.html b/dev/notebooks/julia_distributed/index.html index 8a14f7e..a9c9108 100644 --- a/dev/notebooks/julia_distributed/index.html +++ b/dev/notebooks/julia_distributed/index.html @@ -18,4 +18,4 @@ var myIframe = document.getElementById("notebook"); iFrameResize({log:true}, myIframe); }); - + diff --git a/dev/notebooks/julia_intro/index.html b/dev/notebooks/julia_intro/index.html index 11b9e1d..8ea2a11 100644 --- a/dev/notebooks/julia_intro/index.html +++ b/dev/notebooks/julia_intro/index.html @@ -18,4 +18,4 @@ var myIframe = document.getElementById("notebook"); iFrameResize({log:true}, myIframe); }); - + diff --git a/dev/notebooks/julia_jacobi/index.html b/dev/notebooks/julia_jacobi/index.html index e1cea16..a491372 100644 --- a/dev/notebooks/julia_jacobi/index.html +++ b/dev/notebooks/julia_jacobi/index.html @@ -18,4 +18,4 @@ var myIframe = document.getElementById("notebook"); iFrameResize({log:true}, myIframe); }); - + diff --git a/dev/notebooks/julia_tutorial.ipynb b/dev/notebooks/julia_tutorial.ipynb index b6f56d9..1c98c21 100644 --- a/dev/notebooks/julia_tutorial.ipynb +++ b/dev/notebooks/julia_tutorial.ipynb @@ -485,6 +485,24 @@ "\n", "If you want to interact with the Julia community on discourse, sign in at https://discourse.julialang.org/" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# License\n", + "\n", + "TODO: replace link to website\n", + "\n", + "This notebook is part of the course [Programming Large Scale Parallel Systems](http://localhost:8000/) at Vrije Universiteit Amsterdam and may be used under a [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) license." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { diff --git a/dev/notebooks/julia_tutorial/index.html b/dev/notebooks/julia_tutorial/index.html index 964dd2d..1f1327c 100644 --- a/dev/notebooks/julia_tutorial/index.html +++ b/dev/notebooks/julia_tutorial/index.html @@ -18,4 +18,4 @@ var myIframe = document.getElementById("notebook"); iFrameResize({log:true}, myIframe); }); - + diff --git a/dev/notebooks/matrix_matrix.ipynb b/dev/notebooks/matrix_matrix.ipynb index f42a34b..242fb63 100644 --- a/dev/notebooks/matrix_matrix.ipynb +++ b/dev/notebooks/matrix_matrix.ipynb @@ -1109,10 +1109,22 @@ "println(\"Efficiency = \", 100*(T1/TP)/P, \"%\")" ] }, + { + "cell_type": "markdown", + "id": "8e171362", + "metadata": {}, + "source": [ + "# License\n", + "\n", + "TODO: replace link to website\n", + "\n", + "This notebook is part of the course [Programming Large Scale Parallel Systems](http://localhost:8000/) at Vrije Universiteit Amsterdam and may be used under a [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) license." + ] + }, { "cell_type": "code", "execution_count": null, - "id": "cd31d955", + "id": "86b7b044", "metadata": {}, "outputs": [], "source": [] diff --git a/dev/notebooks/matrix_matrix/index.html b/dev/notebooks/matrix_matrix/index.html index 24cd35a..04caf85 100644 --- a/dev/notebooks/matrix_matrix/index.html +++ b/dev/notebooks/matrix_matrix/index.html @@ -18,4 +18,4 @@ var myIframe = document.getElementById("notebook"); iFrameResize({log:true}, myIframe); }); - + diff --git a/dev/notebooks/mpi_tutorial.ipynb b/dev/notebooks/mpi_tutorial.ipynb index bcebddd..e142a42 100644 --- a/dev/notebooks/mpi_tutorial.ipynb +++ b/dev/notebooks/mpi_tutorial.ipynb @@ -374,10 +374,22 @@ "In this example, the root processor generates random data and then scatters it to all processes using MPI.Scatter. Each process calculates the average of its local data, and then the local averages are gathered using MPI.Gather. The root processor computes the global average of all sub-averages and prints it." ] }, + { + "cell_type": "markdown", + "id": "5e8f6e6a", + "metadata": {}, + "source": [ + "# License\n", + "\n", + "TODO: replace link to website\n", + "\n", + "This notebook is part of the course [Programming Large Scale Parallel Systems](http://localhost:8000/) at Vrije Universiteit Amsterdam and may be used under a [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) license." + ] + }, { "cell_type": "code", "execution_count": null, - "id": "fcf34823", + "id": "c9364808", "metadata": {}, "outputs": [], "source": [] diff --git a/dev/notebooks/mpi_tutorial/index.html b/dev/notebooks/mpi_tutorial/index.html index 9490e6e..3b6ff71 100644 --- a/dev/notebooks/mpi_tutorial/index.html +++ b/dev/notebooks/mpi_tutorial/index.html @@ -18,4 +18,4 @@ var myIframe = document.getElementById("notebook"); iFrameResize({log:true}, myIframe); }); - + diff --git a/dev/notebooks/notebook-hello/index.html b/dev/notebooks/notebook-hello/index.html index 0d19c56..2d4e71f 100644 --- a/dev/notebooks/notebook-hello/index.html +++ b/dev/notebooks/notebook-hello/index.html @@ -18,4 +18,4 @@ var myIframe = document.getElementById("notebook"); iFrameResize({log:true}, myIframe); }); - + diff --git a/dev/notebooks/solutions.ipynb b/dev/notebooks/solutions.ipynb index e94e8a9..240bc9b 100644 --- a/dev/notebooks/solutions.ipynb +++ b/dev/notebooks/solutions.ipynb @@ -1,13 +1,90 @@ { "cells": [ + { + "cell_type": "markdown", + "id": "f48b9a60", + "metadata": {}, + "source": [ + "# Solutions to Notebook Exercises\n", + "\n", + "## Julia Basics: Exercise 1" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a06fd02a", + "metadata": {}, + "outputs": [], + "source": [ + "function ex1(a)\n", + " j = 1\n", + " m = a[j]\n", + " for (i,ai) in enumerate(a)\n", + " if m < ai\n", + " m = ai\n", + " j = i\n", + " end\n", + " end\n", + " (m,j)\n", + "end" + ] + }, + { + "cell_type": "markdown", + "id": "175b6c35", + "metadata": {}, + "source": [ + "## Julia Basics: Exercise 2" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "bb289acd", + "metadata": {}, + "outputs": [], + "source": [ + "ex2(f,g) = x -> f(x) + g(x) " + ] + }, + { + "cell_type": "markdown", + "id": "86250e27", + "metadata": {}, + "source": [ + "## Julia Basics: Exercise 3" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "41b537ab", + "metadata": {}, + "outputs": [], + "source": [ + "function compute_values(n,max_iters)\n", + " x = LinRange(-1.7,0.7,n)\n", + " y = LinRange(-1.2,1.2,n)\n", + " values = zeros(Int,n,n)\n", + " for j in 1:n\n", + " for i in 1:n\n", + " values[i,j] = mandel(x[i],y[j],max_iters)\n", + " end\n", + " end\n", + " values\n", + "end\n", + "values = compute_values(1000,10)\n", + "using GLMakie\n", + "heatmap(x,y,values)" + ] + }, { "cell_type": "markdown", "id": "d6d12733", "metadata": {}, "source": [ - "# Solutions to Notebook Exercises\n", - "\n", - "## Matrix Multiplication : Implementation of Algorithm 3" + "## Matrix Multiplication : Exercise 1" ] }, { @@ -109,6 +186,26 @@ " jacobi_mpi(n,niters)\n", "end" ] + }, + { + "cell_type": "markdown", + "id": "47d88e7a", + "metadata": {}, + "source": [ + "# License\n", + "\n", + "TODO: replace link to website\n", + "\n", + "This notebook is part of the course [Programming Large Scale Parallel Systems](http://localhost:8000/) at Vrije Universiteit Amsterdam and may be used under a [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) license." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "968304a6", + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { diff --git a/dev/notebooks/solutions/index.html b/dev/notebooks/solutions/index.html index 2e60fbb..0915236 100644 --- a/dev/notebooks/solutions/index.html +++ b/dev/notebooks/solutions/index.html @@ -18,4 +18,4 @@ var myIframe = document.getElementById("notebook"); iFrameResize({log:true}, myIframe); }); - + diff --git a/dev/notebooks/tsp/index.html b/dev/notebooks/tsp/index.html index e40fe62..e175b3c 100644 --- a/dev/notebooks/tsp/index.html +++ b/dev/notebooks/tsp/index.html @@ -18,4 +18,4 @@ var myIframe = document.getElementById("notebook"); iFrameResize({log:true}, myIframe); }); - + diff --git a/dev/search/index.html b/dev/search/index.html index 4162ab8..1d3fd99 100644 --- a/dev/search/index.html +++ b/dev/search/index.html @@ -1,2 +1,2 @@ -Search · XM_40017

Loading search...

    +Search · XM_40017

    Loading search...