diff --git a/dev/LEQ/index.html b/dev/LEQ/index.html index e950576..bb245e1 100644 --- a/dev/LEQ/index.html +++ b/dev/LEQ/index.html @@ -14,4 +14,4 @@ var myIframe = document.getElementById("notebook"); iFrameResize({log:true}, myIframe); }); - + diff --git a/dev/asp/index.html b/dev/asp/index.html index ec2a863..c45054a 100644 --- a/dev/asp/index.html +++ b/dev/asp/index.html @@ -14,4 +14,4 @@ var myIframe = document.getElementById("notebook"); iFrameResize({log:true}, myIframe); }); - + diff --git a/dev/getting_started_with_julia/index.html b/dev/getting_started_with_julia/index.html index 041841a..b9b0bc1 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 calling 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 at the following links:

+julia> Pkg.status()

is equivalent to calling 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 at the following links:

diff --git a/dev/index.html b/dev/index.html index 7d13bcc..7e605c1 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

Material will be added incrementally to the website as the course advances.

Warning

This page will eventually contain only a part of the course material. The rest will be available on Canvas. In particular, the material in this public webpage does not fully cover all topics in the final exam.

How to use this page

You have two main ways of studying the notebooks:

  • Download the notebooks and run them locally on your computer (recommended). At each notebook page you will find a green box with links to download the notebook.
  • You also have the static version of the notebooks displayed in this webpage for quick reference.

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 on 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 on 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/jacobi_2D/index.html b/dev/jacobi_2D/index.html index a9b8576..a1c4747 100644 --- a/dev/jacobi_2D/index.html +++ b/dev/jacobi_2D/index.html @@ -14,4 +14,4 @@ var myIframe = document.getElementById("notebook"); iFrameResize({log:true}, myIframe); }); - + diff --git a/dev/jacobi_method/index.html b/dev/jacobi_method/index.html index c3934bb..4555b57 100644 --- a/dev/jacobi_method/index.html +++ b/dev/jacobi_method/index.html @@ -14,4 +14,4 @@ var myIframe = document.getElementById("notebook"); iFrameResize({log:true}, myIframe); }); - + diff --git a/dev/julia_async.ipynb b/dev/julia_async.ipynb index 45bd9f3..a50b4ca 100644 --- a/dev/julia_async.ipynb +++ b/dev/julia_async.ipynb @@ -25,7 +25,7 @@ "- Tasks\n", "- Channels\n", "\n", - "Understanding these concepts is important to learn later distributed computing." + "Understanding these concepts is important to learn distributed computing later." ] }, { @@ -171,7 +171,7 @@ "id": "d483d4d0", "metadata": {}, "source": [ - "How is this possible? Tasks run in the brackground and this particular task is sleeping for most of the time. Thus, it is possible to use the current Julia process for other operations while the tasks is sleeping." + "How is this possible? Tasks run in the background and this particular task is sleeping for most of the time. Thus, it is possible to use the current Julia process for other operations while the task is sleeping." ] }, { @@ -343,7 +343,7 @@ "source": [ "### Useful macro: `@async`\n", "\n", - "So far, we have created tasks using low-level functions, but there are more convenient ways of creating and scheduling tasks. For instance using the `@async` macro. This macro is used to run a piece of code asynchronously. Under the hood it puts the code in an anonymous function, creates a task, and schedules it. For instance, the next cell is equivalent to previous one." + "So far, we have created tasks using low-level functions, but there are more convenient ways of creating and scheduling tasks. For instance using the `@async` macro. This macro is used to run a piece of code asynchronously. Under the hood it puts the code in an anonymous function, creates a task, and schedules it. For instance, the next cell is equivalent to the previous one." ] }, { @@ -388,7 +388,7 @@ "\n", "### Sending data between tasks\n", "\n", - "Julia provides channels as a way to send data between tasks. A channel is like a FIFO queue in which tasks can put and take values from. In next example, we create a channel and a task that puts five values into the channel. Finally, the task closes the channel." + "Julia provides channels as a way to send data between tasks. A channel is like a FIFO queue which tasks can put values into and take values from. In the next example, we create a channel and a task that puts five values into the channel. Finally, the task closes the channel." ] }, { @@ -490,7 +490,7 @@ "source": [ "### Calls to `put!` and `take!` are blocking\n", "\n", - "Note that `put!` and `take!` are blocking operations. Calling `put!` blocks the tasks until another task calls `take!` and viceversa. Thus, we need at least 2 tasks for this to work. If we call `put!` and `take!` from the same task, it will result in a dead lock. We have added a print statement to previous example. Run it again and note how `put!` blocks until we call `take!`. " + "Note that `put!` and `take!` are blocking operations. Calling `put!` blocks the tasks until another task calls `take!` and viceversa. Thus, we need at least 2 tasks for this to work. If we call `put!` and `take!` from the same task, it will result in a dead lock. We have added a print statement to the previous example. Run it again and note how `put!` blocks until we call `take!`. " ] }, { @@ -536,7 +536,7 @@ "source": [ "### Buffered channels\n", "\n", - "We can be a bit more flexible and use a buffered channel. In this case, `put!` will block only if the channel is full and `take!` will block if the channel is empty. We repeat previous example, but with a buffered channel of size 2. Note that we can call `put!` until the channel is full. At this point, we need to wait to until we call `take!` which removes an item from the channel, making room for a new item." + "We can be a bit more flexible and use a buffered channel. In this case, `put!` will block only if the channel is full and `take!` will block if the channel is empty. We repeat the previous example, but with a buffered channel of size 2. Note that we can call `put!` until the channel is full. At this point, we need to wait to until we call `take!` which removes an item from the channel, making room for a new item." ] }, { diff --git a/dev/julia_async/index.html b/dev/julia_async/index.html index 5c1c9b8..ac746d0 100644 --- a/dev/julia_async/index.html +++ b/dev/julia_async/index.html @@ -14,4 +14,4 @@ var myIframe = document.getElementById("notebook"); iFrameResize({log:true}, myIframe); }); - + diff --git a/dev/julia_async_src/index.html b/dev/julia_async_src/index.html index 35f829d..27b6d75 100644 --- a/dev/julia_async_src/index.html +++ b/dev/julia_async_src/index.html @@ -7501,7 +7501,7 @@ a.anchor-link {
  • Tasks
  • Channels
  • -

    Understanding these concepts is important to learn later distributed computing.

    +

    Understanding these concepts is important to learn distributed computing later.

    @@ -7687,7 +7687,7 @@ a.anchor-link {
    -

    How is this possible? Tasks run in the brackground and this particular task is sleeping for most of the time. Thus, it is possible to use the current Julia process for other operations while the tasks is sleeping.

    +

    How is this possible? Tasks run in the background and this particular task is sleeping for most of the time. Thus, it is possible to use the current Julia process for other operations while the task is sleeping.

    @@ -7914,7 +7914,7 @@ a.anchor-link {
    -

    Useful macro: @async

    So far, we have created tasks using low-level functions, but there are more convenient ways of creating and scheduling tasks. For instance using the @async macro. This macro is used to run a piece of code asynchronously. Under the hood it puts the code in an anonymous function, creates a task, and schedules it. For instance, the next cell is equivalent to previous one.

    +

    Useful macro: @async

    So far, we have created tasks using low-level functions, but there are more convenient ways of creating and scheduling tasks. For instance using the @async macro. This macro is used to run a piece of code asynchronously. Under the hood it puts the code in an anonymous function, creates a task, and schedules it. For instance, the next cell is equivalent to the previous one.

    @@ -7967,7 +7967,7 @@ a.anchor-link {
    -

    Channels

    Sending data between tasks

    Julia provides channels as a way to send data between tasks. A channel is like a FIFO queue in which tasks can put and take values from. In next example, we create a channel and a task that puts five values into the channel. Finally, the task closes the channel.

    +

    Channels

    Sending data between tasks

    Julia provides channels as a way to send data between tasks. A channel is like a FIFO queue which tasks can put values into and take values from. In the next example, we create a channel and a task that puts five values into the channel. Finally, the task closes the channel.

    @@ -8096,7 +8096,7 @@ a.anchor-link {
    -

    Calls to put! and take! are blocking

    Note that put! and take! are blocking operations. Calling put! blocks the tasks until another task calls take! and viceversa. Thus, we need at least 2 tasks for this to work. If we call put! and take! from the same task, it will result in a dead lock. We have added a print statement to previous example. Run it again and note how put! blocks until we call take!.

    +

    Calls to put! and take! are blocking

    Note that put! and take! are blocking operations. Calling put! blocks the tasks until another task calls take! and viceversa. Thus, we need at least 2 tasks for this to work. If we call put! and take! from the same task, it will result in a dead lock. We have added a print statement to the previous example. Run it again and note how put! blocks until we call take!.

    @@ -8155,7 +8155,7 @@ a.anchor-link {
    -

    Buffered channels

    We can be a bit more flexible and use a buffered channel. In this case, put! will block only if the channel is full and take! will block if the channel is empty. We repeat previous example, but with a buffered channel of size 2. Note that we can call put! until the channel is full. At this point, we need to wait to until we call take! which removes an item from the channel, making room for a new item.

    +

    Buffered channels

    We can be a bit more flexible and use a buffered channel. In this case, put! will block only if the channel is full and take! will block if the channel is empty. We repeat the previous example, but with a buffered channel of size 2. Note that we can call put! until the channel is full. At this point, we need to wait to until we call take! which removes an item from the channel, making room for a new item.

    diff --git a/dev/julia_basics.ipynb b/dev/julia_basics.ipynb index 2e1490c..781b196 100644 --- a/dev/julia_basics.ipynb +++ b/dev/julia_basics.ipynb @@ -43,9 +43,9 @@ "Tip: Did you know that Jupyter stands for Julia, Python and R?\n", "\n", "\n", - "### How to start a Jupyter nootebook in Julia\n", + "### How to start a Jupyter notebook in Julia\n", "\n", - "To run a Julia Jupyther notebook, open a Julia REPL and type\n", + "To run a Julia Jupyter notebook, open a Julia REPL and type\n", "\n", "```julia\n", "julia> ]\n", @@ -449,7 +449,7 @@ "source": [ "\n", "
    \n", - "Question: Which will be the value of `x` in the last line ? (Think your answer before executing next cell to find out the result) \n", + "Question: What will be the value of `x` in the last line ? (Think your answer before executing next cell to find out the result) \n", "
    \n", "\n" ] @@ -478,7 +478,7 @@ "\n", "### Defining functions\n", "\n", - "Functions are defined as shown in next cell. The closing `end` is necessary. Do to forget it! However, the `return` is optional. The value of last line is returned by default. Indentation is recommended, but it is also optional. That's why the closing `end` is needed." + "Functions are defined as shown in next cell. The closing `end` is necessary. Do not forget it! However, the `return` is optional. The value of last line is returned by default. Indentation is recommended, but it is also optional. That's why the closing `end` is needed." ] }, { @@ -538,7 +538,7 @@ "id": "e4ca76a4", "metadata": {}, "source": [ - "Mathematical operators can also be broadcasted (like in Matlab). The following cell won't work. If we want to multiply element by element, we can use the broadcasted version below." + "Mathematical operators can also be broadcasted (like in Matlab). Multiplying the vectors `a * b` directly won't work. If we want to multiply element by element, we can use the broadcasted version below." ] }, { @@ -557,7 +557,7 @@ "metadata": {}, "source": [ "
    \n", - "Question: Which will be the value of `x` in the last line ?\n", + "Question: What will be the value of `x` in the last line ?\n", "
    \n" ] }, @@ -1300,7 +1300,7 @@ "source": [ "### Arrays of any element type\n", "\n", - "Arrays of fixed element type seem to be very rigid, right? Python list have not this limitation. However, we can use arrays of `Any` type, which are as flexible as Python lists, or even more since they can also contain functions. " + "Arrays of fixed element type seem to be very rigid, right? Python list do not this limitation. However, we can use arrays of the `Any` type, which are as flexible as Python lists, or even more since they can also contain functions. " ] }, { diff --git a/dev/julia_basics/index.html b/dev/julia_basics/index.html index 7f3849c..4b9c0ab 100644 --- a/dev/julia_basics/index.html +++ b/dev/julia_basics/index.html @@ -14,4 +14,4 @@ var myIframe = document.getElementById("notebook"); iFrameResize({log:true}, myIframe); }); - + diff --git a/dev/julia_basics_src/index.html b/dev/julia_basics_src/index.html index 6a93815..b20315a 100644 --- a/dev/julia_basics_src/index.html +++ b/dev/julia_basics_src/index.html @@ -7517,7 +7517,7 @@ a.anchor-link {
    Tip: Did you know that Jupyter stands for Julia, Python and R?
    -

    How to start a Jupyter nootebook in Julia

    To run a Julia Jupyther notebook, open a Julia REPL and type

    +

    How to start a Jupyter notebook in Julia

    To run a Julia Jupyter notebook, open a Julia REPL and type

    julia> ]
     pkg> add IJulia
     julia> using IJulia
    @@ -8026,7 +8026,7 @@ a.anchor-link {
     
    @@ -8056,7 +8056,7 @@ a.anchor-link {
     
     
    @@ -8135,7 +8135,7 @@ a.anchor-link {
    -

    Mathematical operators can also be broadcasted (like in Matlab). The following cell won't work. If we want to multiply element by element, we can use the broadcasted version below.

    +

    Mathematical operators can also be broadcasted (like in Matlab). Multiplying the vectors a * b directly won't work. If we want to multiply element by element, we can use the broadcasted version below.

    @@ -8161,7 +8161,7 @@ a.anchor-link {
    -Question: Which will be the value of `x` in the last line ? +Question: What will be the value of `x` in the last line ?
    @@ -9122,7 +9122,7 @@ a.anchor-link {
    -

    Arrays of any element type

    Arrays of fixed element type seem to be very rigid, right? Python list have not this limitation. However, we can use arrays of Any type, which are as flexible as Python lists, or even more since they can also contain functions.

    +

    Arrays of any element type

    Arrays of fixed element type seem to be very rigid, right? Python list do not this limitation. However, we can use arrays of the Any type, which are as flexible as Python lists, or even more since they can also contain functions.

    diff --git a/dev/julia_distributed/index.html b/dev/julia_distributed/index.html index 1285ff2..704574d 100644 --- a/dev/julia_distributed/index.html +++ b/dev/julia_distributed/index.html @@ -14,4 +14,4 @@ var myIframe = document.getElementById("notebook"); iFrameResize({log:true}, myIframe); }); - + diff --git a/dev/julia_intro/index.html b/dev/julia_intro/index.html index e057349..0678e46 100644 --- a/dev/julia_intro/index.html +++ b/dev/julia_intro/index.html @@ -14,4 +14,4 @@ var myIframe = document.getElementById("notebook"); iFrameResize({log:true}, myIframe); }); - + diff --git a/dev/julia_jacobi/index.html b/dev/julia_jacobi/index.html index 556e711..c17c692 100644 --- a/dev/julia_jacobi/index.html +++ b/dev/julia_jacobi/index.html @@ -14,4 +14,4 @@ var myIframe = document.getElementById("notebook"); iFrameResize({log:true}, myIframe); }); - + diff --git a/dev/julia_tutorial/index.html b/dev/julia_tutorial/index.html index 5994099..94c177f 100644 --- a/dev/julia_tutorial/index.html +++ b/dev/julia_tutorial/index.html @@ -14,4 +14,4 @@ var myIframe = document.getElementById("notebook"); iFrameResize({log:true}, myIframe); }); - + diff --git a/dev/matrix_matrix/index.html b/dev/matrix_matrix/index.html index 20a52b8..ae1a8cf 100644 --- a/dev/matrix_matrix/index.html +++ b/dev/matrix_matrix/index.html @@ -14,4 +14,4 @@ var myIframe = document.getElementById("notebook"); iFrameResize({log:true}, myIframe); }); - + diff --git a/dev/mpi_tutorial/index.html b/dev/mpi_tutorial/index.html index 71b0cea..d13de8a 100644 --- a/dev/mpi_tutorial/index.html +++ b/dev/mpi_tutorial/index.html @@ -14,4 +14,4 @@ var myIframe = document.getElementById("notebook"); iFrameResize({log:true}, myIframe); }); - + diff --git a/dev/notebook-hello/index.html b/dev/notebook-hello/index.html index bea1ae2..dc0780b 100644 --- a/dev/notebook-hello/index.html +++ b/dev/notebook-hello/index.html @@ -14,4 +14,4 @@ var myIframe = document.getElementById("notebook"); iFrameResize({log:true}, myIframe); }); - + diff --git a/dev/search/index.html b/dev/search/index.html index fae2d16..0781b12 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...

        diff --git a/dev/solutions/index.html b/dev/solutions/index.html index f71945d..b035f04 100644 --- a/dev/solutions/index.html +++ b/dev/solutions/index.html @@ -14,4 +14,4 @@ var myIframe = document.getElementById("notebook"); iFrameResize({log:true}, myIframe); }); - + diff --git a/dev/tsp/index.html b/dev/tsp/index.html index 224d181..3dbb9ec 100644 --- a/dev/tsp/index.html +++ b/dev/tsp/index.html @@ -14,4 +14,4 @@ var myIframe = document.getElementById("notebook"); iFrameResize({log:true}, myIframe); }); - +