build based on 0e7cdd0

This commit is contained in:
Documenter.jl 2023-09-08 16:25:04 +00:00
parent 8049e7168a
commit 3871cef500
20 changed files with 21 additions and 22 deletions

View File

@ -14,4 +14,4 @@
var myIframe = document.getElementById("notebook"); var myIframe = document.getElementById("notebook");
iFrameResize({log:true}, myIframe); iFrameResize({log:true}, myIframe);
}); });
</script></article><nav class="docs-footer"><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Friday 8 September 2023 16:03">Friday 8 September 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> </script></article><nav class="docs-footer"><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Friday 8 September 2023 16:24">Friday 8 September 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

View File

@ -14,4 +14,4 @@
var myIframe = document.getElementById("notebook"); var myIframe = document.getElementById("notebook");
iFrameResize({log:true}, myIframe); iFrameResize({log:true}, myIframe);
}); });
</script></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../jacobi_method/">« Jacobi method</a><a class="docs-footer-nextpage" href="../solutions_for_all_notebooks/">Solutions »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Friday 8 September 2023 16:03">Friday 8 September 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> </script></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../jacobi_method/">« Jacobi method</a><a class="docs-footer-nextpage" href="../solutions_for_all_notebooks/">Solutions »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Friday 8 September 2023 16:24">Friday 8 September 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

View File

@ -6,12 +6,11 @@ MPI.Init()
comm = MPI.COMM_WORLD comm = MPI.COMM_WORLD
rank = MPI.Comm_rank(comm) rank = MPI.Comm_rank(comm)
nranks = MPI.Comm_size(comm) nranks = MPI.Comm_size(comm)
println(&quot;Hello world, I am rank $rank of $nranks&quot;)</code></pre><p>As you can see from this example, one can access MPI from Julia in a clean way, without type annotations and other complexities of C/C++ code.</p><p>Now, run the file from the REPL</p><pre><code class="language-julia hljs">julia&gt; include(&quot;hello_mpi.jl&quot;)</code></pre><p>It probably didn&#39;t work, right? Read the error message and note that the MPI package needs to be installed to run this code.</p><p>To install a package, we need to enter <em>package</em> mode. Remember that we entered into help mode by typing <code>?</code>. Package mode is activated by typing <code>]</code> : </p><pre><code class="language-julia hljs">julia&gt; ]</code></pre><p>At this point, the prompt should have changed to <code>(@v1.8) pkg&gt;</code> indicating that we are in package mode. The text between the parentheses indicates which is the active <em>project</em>, i.e., where packages are going to be installed. In this case, we are working with the global project associated with our Julia installation (which is Julia 1.8 in this example, but it can be another version in your case).</p><p>To install the MPI package, type</p><pre><code class="language-julia hljs">(@v1.8) pkg&gt; add MPI</code></pre><p>Congrats, you have installed MPI!</p><div class="admonition is-info"><header class="admonition-header">Note</header><div class="admonition-body"><p>Many Julia package names end with <code>.jl</code>. This is just a way of signaling that a package is written in Julia. When using such packages, the <code>.jl</code> needs to be omitted. In this case, we have installed the <code>MPI.jl</code> package even though we have only typed <code>MPI</code> in the REPL.</p></div></div><div class="admonition is-info"><header class="admonition-header">Note</header><div class="admonition-body"><p>The package you have installed is the Julia interface to MPI, called <code>MPI.jl</code>. Note that it is not a MPI library by itself. It is just a thin wrapper between MPI and Julia. To use this interface, you need an actual MPI library installed in your system such as OpenMPI or MPICH. Julia downloads and installs a MPI library for you, but it is also possible to use a MPI library already available in your system. This is useful, e.g., when running on HPC clusters. See the <a href="https://juliaparallel.org/MPI.jl/stable/configuration/">documentation</a> of <code>MPI.jl</code> for further details.</p></div></div><p>To check that the package was installed properly, exit package mode by pressing the backspace key several times, and run it again</p><pre><code class="language-julia hljs">julia&gt; include(&quot;hello_mpi.jl&quot;)</code></pre><p>Now, it should work, but you probably get output from a single MPI rank only.</p><h3 id="Running-MPI-code"><a class="docs-heading-anchor" href="#Running-MPI-code">Running MPI code</a><a id="Running-MPI-code-1"></a><a class="docs-heading-anchor-permalink" href="#Running-MPI-code" title="Permalink"></a></h3><p>To run MPI applications in parallel, you need a launcher like <code>mpiexec</code>. MPI codes written in Julia are not an exception to this rule. From the system terminal, you can run</p><pre><code class="nohighlight hljs">$ mpiexec -np 4 julia hello_mpi.jl</code></pre><p>But it will probably not work since the version of <code>mpiexec</code> needs to match with the MPI version we are using from Julia. You can find the path to the <code>mpiexec</code> binary you need to use with these commands</p><pre><code class="language-julia hljs">julia&gt; using MPI println(&quot;Hello world, I am rank $rank of $nranks&quot;)</code></pre><p>As you can see from this example, one can access MPI from Julia in a clean way, without type annotations and other complexities of C/C++ code.</p><p>Now, run the file from the REPL</p><pre><code class="language-julia hljs">julia&gt; include(&quot;hello_mpi.jl&quot;)</code></pre><p>It probably didn&#39;t work, right? Read the error message and note that the MPI package needs to be installed to run this code.</p><p>To install a package, we need to enter <em>package</em> mode. Remember that we entered into help mode by typing <code>?</code>. Package mode is activated by typing <code>]</code> : </p><pre><code class="language-julia hljs">julia&gt; ]</code></pre><p>At this point, the prompt should have changed to <code>(@v1.8) pkg&gt;</code> indicating that we are in package mode. The text between the parentheses indicates which is the active <em>project</em>, i.e., where packages are going to be installed. In this case, we are working with the global project associated with our Julia installation (which is Julia 1.8 in this example, but it can be another version in your case).</p><p>To install the MPI package, type</p><pre><code class="language-julia hljs">(@v1.8) pkg&gt; add MPI</code></pre><p>Congrats, you have installed MPI!</p><div class="admonition is-info"><header class="admonition-header">Note</header><div class="admonition-body"><p>Many Julia package names end with <code>.jl</code>. This is just a way of signaling that a package is written in Julia. When using such packages, the <code>.jl</code> needs to be omitted. In this case, we have installed the <code>MPI.jl</code> package even though we have only typed <code>MPI</code> in the REPL.</p></div></div><div class="admonition is-info"><header class="admonition-header">Note</header><div class="admonition-body"><p>The package you have installed is the Julia interface to MPI, called <code>MPI.jl</code>. Note that it is not a MPI library by itself. It is just a thin wrapper between MPI and Julia. To use this interface, you need an actual MPI library installed in your system such as OpenMPI or MPICH. Julia downloads and installs a MPI library for you, but it is also possible to use a MPI library already available in your system. This is useful, e.g., when running on HPC clusters. See the <a href="https://juliaparallel.org/MPI.jl/stable/configuration/">documentation</a> of <code>MPI.jl</code> for further details.</p></div></div><p>To check that the package was installed properly, exit package mode by pressing the backspace key several times, and run it again</p><pre><code class="language-julia hljs">julia&gt; include(&quot;hello_mpi.jl&quot;)</code></pre><p>Now, it should work, but you probably get output from a single MPI rank only.</p><h3 id="Running-MPI-code"><a class="docs-heading-anchor" href="#Running-MPI-code">Running MPI code</a><a id="Running-MPI-code-1"></a><a class="docs-heading-anchor-permalink" href="#Running-MPI-code" title="Permalink"></a></h3><p>To run MPI applications in parallel, you need a launcher like <code>mpiexec</code>. MPI codes written in Julia are not an exception to this rule. From the system terminal, you can run</p><pre><code class="nohighlight hljs">$ mpiexec -np 4 julia hello_mpi.jl</code></pre><p>But it will probably not work since the version of <code>mpiexec</code> needs to match with the MPI version we are using from Julia. Don&#39;t worry if you could not make it work! A more elegant way to run MPI code is from the Julia REPL directly, by using these commands:</p><pre><code class="language-julia hljs">julia&gt; using MPI
julia&gt; MPI.mpiexec_path</code></pre><p>and then try again</p><pre><code class="nohighlight hljs">$ /path/to/my/mpiexec -np 4 julia hello_mpi.jl</code></pre><p>with your particular path.</p><p>However, this is not very convenient. Don&#39;t worry if you could not make it work! A more elegant way to run MPI code is from the Julia REPL directly, by using these commands:</p><pre><code class="language-julia hljs">julia&gt; using MPI
julia&gt; mpiexec(cmd-&gt;run(`$cmd -np 4 julia hello_mpi.jl`))</code></pre><p>Now, you should see output from 4 ranks.</p><h2 id="Package-manager"><a class="docs-heading-anchor" href="#Package-manager">Package manager</a><a id="Package-manager-1"></a><a class="docs-heading-anchor-permalink" href="#Package-manager" title="Permalink"></a></h2><h3 id="Installing-packages-locally"><a class="docs-heading-anchor" href="#Installing-packages-locally">Installing packages locally</a><a id="Installing-packages-locally-1"></a><a class="docs-heading-anchor-permalink" href="#Installing-packages-locally" title="Permalink"></a></h3><p>We have installed the <code>MPI</code> package globally and it will be available in all Julia sessions. However, in some situations, we want to work with different versions of the same package or to install packages in an isolated way to avoid potential conflicts with other packages. This can be done by using local projects.</p><p>A project is simply a folder in the hard disk. To use a particular folder as your project, you need to <em>activate</em> it. This is done by entering package mode and using the <code>activate</code> command followed by the path to the folder you want to activate.</p><pre><code class="language-julia hljs">(@v1.8) pkg&gt; activate .</code></pre><p>The previous command will activate the current working directory. Note that the dot <code>.</code> is indeed the path to the current folder.</p><p>The prompt has changed to <code>(lessons) pkg&gt;</code> indicating that we are in the project within the <code>lessons</code> folder. The particular folder name can be different in your case.</p><div class="admonition is-success"><header class="admonition-header">Tip</header><div class="admonition-body"><p>You can activate a project directly when opening Julia from the terminal using the <code>--project</code> flag. The command <code>$ julia --project=.</code> will open Julia and activate a project in the current directory. You can also achieve the same effect by setting the environment variable <code>JULIA_PROJECT</code> with the path of the folder you want to activate.</p></div></div><div class="admonition is-info"><header class="admonition-header">Note</header><div class="admonition-body"><p>The active project folder and the current working directory are two independent concepts! For instance, <code>(@v1.8) pkg&gt; activate folderB</code> and then <code>julia&gt; cd(&quot;folderA&quot;)</code>, will activate the project in <code>folderB</code> and change the current working directory to <code>folderA</code>.</p></div></div><p>At this point all package-related operations will be local to the new project. For instance, install the <code>DataFrames</code> package.</p><pre><code class="language-julia hljs">(lessons) pkg&gt; add DataFrames</code></pre><p>Use the package to check that it is installed</p><pre><code class="language-julia hljs">julia&gt; using DataFrames julia&gt; mpiexec(cmd-&gt;run(`$cmd -np 4 julia hello_mpi.jl`))</code></pre><p>Now, you should see output from 4 ranks.</p><h2 id="Package-manager"><a class="docs-heading-anchor" href="#Package-manager">Package manager</a><a id="Package-manager-1"></a><a class="docs-heading-anchor-permalink" href="#Package-manager" title="Permalink"></a></h2><h3 id="Installing-packages-locally"><a class="docs-heading-anchor" href="#Installing-packages-locally">Installing packages locally</a><a id="Installing-packages-locally-1"></a><a class="docs-heading-anchor-permalink" href="#Installing-packages-locally" title="Permalink"></a></h3><p>We have installed the <code>MPI</code> package globally and it will be available in all Julia sessions. However, in some situations, we want to work with different versions of the same package or to install packages in an isolated way to avoid potential conflicts with other packages. This can be done by using local projects.</p><p>A project is simply a folder in the hard disk. To use a particular folder as your project, you need to <em>activate</em> it. This is done by entering package mode and using the <code>activate</code> command followed by the path to the folder you want to activate.</p><pre><code class="language-julia hljs">(@v1.8) pkg&gt; activate .</code></pre><p>The previous command will activate the current working directory. Note that the dot <code>.</code> is indeed the path to the current folder.</p><p>The prompt has changed to <code>(lessons) pkg&gt;</code> indicating that we are in the project within the <code>lessons</code> folder. The particular folder name can be different in your case.</p><div class="admonition is-success"><header class="admonition-header">Tip</header><div class="admonition-body"><p>You can activate a project directly when opening Julia from the terminal using the <code>--project</code> flag. The command <code>$ julia --project=.</code> will open Julia and activate a project in the current directory. You can also achieve the same effect by setting the environment variable <code>JULIA_PROJECT</code> with the path of the folder you want to activate.</p></div></div><div class="admonition is-info"><header class="admonition-header">Note</header><div class="admonition-body"><p>The active project folder and the current working directory are two independent concepts! For instance, <code>(@v1.8) pkg&gt; activate folderB</code> and then <code>julia&gt; cd(&quot;folderA&quot;)</code>, will activate the project in <code>folderB</code> and change the current working directory to <code>folderA</code>.</p></div></div><p>At this point all package-related operations will be local to the new project. For instance, install the <code>DataFrames</code> package.</p><pre><code class="language-julia hljs">(lessons) pkg&gt; add DataFrames</code></pre><p>Use the package to check that it is installed</p><pre><code class="language-julia hljs">julia&gt; using DataFrames
julia&gt; DataFrame(a=[1,2],b=[3,4])</code></pre><p>Now, we can return to the global project to check that <code>DataFrames</code> has not been installed there. To return to the global environment, use <code>activate</code> without a folder name.</p><pre><code class="language-julia hljs">(lessons) pkg&gt; activate</code></pre><p>The prompt is again <code>(@v1.8) pkg&gt;</code></p><p>Now, try to use <code>DataFrames</code>.</p><pre><code class="language-julia hljs">julia&gt; using DataFrames julia&gt; DataFrame(a=[1,2],b=[3,4])</code></pre><p>Now, we can return to the global project to check that <code>DataFrames</code> has not been installed there. To return to the global environment, use <code>activate</code> without a folder name.</p><pre><code class="language-julia hljs">(lessons) pkg&gt; activate</code></pre><p>The prompt is again <code>(@v1.8) pkg&gt;</code></p><p>Now, try to use <code>DataFrames</code>.</p><pre><code class="language-julia hljs">julia&gt; using DataFrames
julia&gt; DataFrame(a=[1,2],b=[3,4])</code></pre><p>You should get an error or a warning unless you already had <code>DataFrames</code> installed globally.</p><h3 id="Project-and-Manifest-files"><a class="docs-heading-anchor" href="#Project-and-Manifest-files">Project and Manifest files</a><a id="Project-and-Manifest-files-1"></a><a class="docs-heading-anchor-permalink" href="#Project-and-Manifest-files" title="Permalink"></a></h3><p>The information about a project is stored in two files <code>Project.toml</code> and <code>Manifest.toml</code>.</p><ul><li><p><code>Project.toml</code> contains the packages explicitly installed (the direct dependencies)</p></li><li><p><code>Manifest.toml</code> contains direct and indirect dependencies along with the concrete version of each package.</p></li></ul><p>In other words, <code>Project.toml</code> contains the packages relevant for the user, whereas <code>Manifest.toml</code> is the detailed snapshot of all dependencies. The <code>Manifest.toml</code> can be used to reproduce the same environment in another machine.</p><p>You can see the path to the current <code>Project.toml</code> file by using the <code>status</code> operator (or <code>st</code> in its short form) while in package mode</p><pre><code class="language-julia hljs">(@v1.8) pkg&gt; status</code></pre><p>The information about the <code>Manifest.toml</code> can be inspected by passing the <code>-m</code> flag.</p><pre><code class="language-julia hljs">(@v1.8) pkg&gt; status -m</code></pre><h3 id="Installing-packages-from-a-project-file"><a class="docs-heading-anchor" href="#Installing-packages-from-a-project-file">Installing packages from a project file</a><a id="Installing-packages-from-a-project-file-1"></a><a class="docs-heading-anchor-permalink" href="#Installing-packages-from-a-project-file" title="Permalink"></a></h3><p>Project files can be used to install lists of packages defined by others. E.g., to install all the dependencies of a Julia application.</p><p>Assume that a colleague has sent to you a <code>Project.toml</code> file with this content:</p><pre><code class="nohighlight hljs">[deps] julia&gt; DataFrame(a=[1,2],b=[3,4])</code></pre><p>You should get an error or a warning unless you already had <code>DataFrames</code> installed globally.</p><h3 id="Project-and-Manifest-files"><a class="docs-heading-anchor" href="#Project-and-Manifest-files">Project and Manifest files</a><a id="Project-and-Manifest-files-1"></a><a class="docs-heading-anchor-permalink" href="#Project-and-Manifest-files" title="Permalink"></a></h3><p>The information about a project is stored in two files <code>Project.toml</code> and <code>Manifest.toml</code>.</p><ul><li><p><code>Project.toml</code> contains the packages explicitly installed (the direct dependencies)</p></li><li><p><code>Manifest.toml</code> contains direct and indirect dependencies along with the concrete version of each package.</p></li></ul><p>In other words, <code>Project.toml</code> contains the packages relevant for the user, whereas <code>Manifest.toml</code> is the detailed snapshot of all dependencies. The <code>Manifest.toml</code> can be used to reproduce the same environment in another machine.</p><p>You can see the path to the current <code>Project.toml</code> file by using the <code>status</code> operator (or <code>st</code> in its short form) while in package mode</p><pre><code class="language-julia hljs">(@v1.8) pkg&gt; status</code></pre><p>The information about the <code>Manifest.toml</code> can be inspected by passing the <code>-m</code> flag.</p><pre><code class="language-julia hljs">(@v1.8) pkg&gt; status -m</code></pre><h3 id="Installing-packages-from-a-project-file"><a class="docs-heading-anchor" href="#Installing-packages-from-a-project-file">Installing packages from a project file</a><a id="Installing-packages-from-a-project-file-1"></a><a class="docs-heading-anchor-permalink" href="#Installing-packages-from-a-project-file" title="Permalink"></a></h3><p>Project files can be used to install lists of packages defined by others. E.g., to install all the dependencies of a Julia application.</p><p>Assume that a colleague has sent to you a <code>Project.toml</code> file with this content:</p><pre><code class="nohighlight hljs">[deps]
BenchmarkTools = &quot;6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf&quot; BenchmarkTools = &quot;6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf&quot;
DataFrames = &quot;a93c6f00-e57d-5684-b7b6-d8193f3e46c0&quot; DataFrames = &quot;a93c6f00-e57d-5684-b7b6-d8193f3e46c0&quot;
MPI = &quot;da04e1cc-30fd-572f-bb4f-1f8673147195&quot;</code></pre><p>Copy the contents of previous code block into a file called <code>Project.toml</code> and place it in an empty folder named <code>newproject</code>. It is important that the file is named <code>Project.toml</code>. You can create a new folder from the REPL with</p><pre><code class="language-julia hljs">julia&gt; mkdir(&quot;newproject&quot;)</code></pre><p>To install all the packages registered in this file you need to activate the folder containing your <code>Project.toml</code> file</p><pre><code class="language-julia hljs">(@v1.8) pkg&gt; activate newproject</code></pre><p>and then <em>instantiating</em> it</p><pre><code class="language-julia hljs">(newproject) pkg&gt; instantiate</code></pre><p>The instantiate command will download and install all listed packages and their dependencies in just one click.</p><h3 id="Getting-help-in-package-mode"><a class="docs-heading-anchor" href="#Getting-help-in-package-mode">Getting help in package mode</a><a id="Getting-help-in-package-mode-1"></a><a class="docs-heading-anchor-permalink" href="#Getting-help-in-package-mode" title="Permalink"></a></h3><p>You can get help about a particular package operator by writing <code>help</code> in front of it</p><pre><code class="language-julia hljs">(@v1.8) pkg&gt; help activate</code></pre><p>You can get an overview of all package commands by typing <code>help</code> alone</p><pre><code class="language-julia hljs">(@v1.8) pkg&gt; help</code></pre><h3 id="Package-operations-in-Julia-code"><a class="docs-heading-anchor" href="#Package-operations-in-Julia-code">Package operations in Julia code</a><a id="Package-operations-in-Julia-code-1"></a><a class="docs-heading-anchor-permalink" href="#Package-operations-in-Julia-code" title="Permalink"></a></h3><p>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 <code>Pkg</code> package. For instance</p><pre><code class="language-julia hljs">julia&gt; using Pkg MPI = &quot;da04e1cc-30fd-572f-bb4f-1f8673147195&quot;</code></pre><p>Copy the contents of previous code block into a file called <code>Project.toml</code> and place it in an empty folder named <code>newproject</code>. It is important that the file is named <code>Project.toml</code>. You can create a new folder from the REPL with</p><pre><code class="language-julia hljs">julia&gt; mkdir(&quot;newproject&quot;)</code></pre><p>To install all the packages registered in this file you need to activate the folder containing your <code>Project.toml</code> file</p><pre><code class="language-julia hljs">(@v1.8) pkg&gt; activate newproject</code></pre><p>and then <em>instantiating</em> it</p><pre><code class="language-julia hljs">(newproject) pkg&gt; instantiate</code></pre><p>The instantiate command will download and install all listed packages and their dependencies in just one click.</p><h3 id="Getting-help-in-package-mode"><a class="docs-heading-anchor" href="#Getting-help-in-package-mode">Getting help in package mode</a><a id="Getting-help-in-package-mode-1"></a><a class="docs-heading-anchor-permalink" href="#Getting-help-in-package-mode" title="Permalink"></a></h3><p>You can get help about a particular package operator by writing <code>help</code> in front of it</p><pre><code class="language-julia hljs">(@v1.8) pkg&gt; help activate</code></pre><p>You can get an overview of all package commands by typing <code>help</code> alone</p><pre><code class="language-julia hljs">(@v1.8) pkg&gt; help</code></pre><h3 id="Package-operations-in-Julia-code"><a class="docs-heading-anchor" href="#Package-operations-in-Julia-code">Package operations in Julia code</a><a id="Package-operations-in-Julia-code-1"></a><a class="docs-heading-anchor-permalink" href="#Package-operations-in-Julia-code" title="Permalink"></a></h3><p>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 <code>Pkg</code> package. For instance</p><pre><code class="language-julia hljs">julia&gt; using Pkg
julia&gt; Pkg.status()</code></pre><p>is equivalent to calling <code>status</code> in package mode.</p><pre><code class="language-julia hljs">(@v1.8) pkg&gt; status</code></pre><h2 id="Conclusion"><a class="docs-heading-anchor" href="#Conclusion">Conclusion</a><a id="Conclusion-1"></a><a class="docs-heading-anchor-permalink" href="#Conclusion" title="Permalink"></a></h2><p>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:</p><ul><li><a href="https://docs.julialang.org/en/v1/manual/getting-started/">Julia Manual</a></li><li><a href="https://pkgdocs.julialang.org/v1/getting-started/">Package manager</a></li></ul></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« Home</a><a class="docs-footer-nextpage" href="../julia_basics/">Julia Basics »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Friday 8 September 2023 16:03">Friday 8 September 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> julia&gt; Pkg.status()</code></pre><p>is equivalent to calling <code>status</code> in package mode.</p><pre><code class="language-julia hljs">(@v1.8) pkg&gt; status</code></pre><h2 id="Conclusion"><a class="docs-heading-anchor" href="#Conclusion">Conclusion</a><a id="Conclusion-1"></a><a class="docs-heading-anchor-permalink" href="#Conclusion" title="Permalink"></a></h2><p>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:</p><ul><li><a href="https://docs.julialang.org/en/v1/manual/getting-started/">Julia Manual</a></li><li><a href="https://pkgdocs.julialang.org/v1/getting-started/">Package manager</a></li></ul></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« Home</a><a class="docs-footer-nextpage" href="../julia_basics/">Julia Basics »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Friday 8 September 2023 16:24">Friday 8 September 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

File diff suppressed because one or more lines are too long

View File

@ -14,4 +14,4 @@
var myIframe = document.getElementById("notebook"); var myIframe = document.getElementById("notebook");
iFrameResize({log:true}, myIframe); iFrameResize({log:true}, myIframe);
}); });
</script></article><nav class="docs-footer"><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Friday 8 September 2023 16:03">Friday 8 September 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> </script></article><nav class="docs-footer"><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Friday 8 September 2023 16:24">Friday 8 September 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

View File

@ -14,4 +14,4 @@
var myIframe = document.getElementById("notebook"); var myIframe = document.getElementById("notebook");
iFrameResize({log:true}, myIframe); iFrameResize({log:true}, myIframe);
}); });
</script></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../matrix_matrix/">« Matrix-matrix multiplication</a><a class="docs-footer-nextpage" href="../asp/">All pairs of shortest paths »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Friday 8 September 2023 16:03">Friday 8 September 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> </script></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../matrix_matrix/">« Matrix-matrix multiplication</a><a class="docs-footer-nextpage" href="../asp/">All pairs of shortest paths »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Friday 8 September 2023 16:24">Friday 8 September 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

View File

@ -14,4 +14,4 @@
var myIframe = document.getElementById("notebook"); var myIframe = document.getElementById("notebook");
iFrameResize({log:true}, myIframe); iFrameResize({log:true}, myIframe);
}); });
</script></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../julia_basics/">« Julia Basics</a><a class="docs-footer-nextpage" href="../julia_distributed/">Distributed computing in Julia »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Friday 8 September 2023 16:03">Friday 8 September 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> </script></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../julia_basics/">« Julia Basics</a><a class="docs-footer-nextpage" href="../julia_distributed/">Distributed computing in Julia »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Friday 8 September 2023 16:24">Friday 8 September 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

View File

@ -14,4 +14,4 @@
var myIframe = document.getElementById("notebook"); var myIframe = document.getElementById("notebook");
iFrameResize({log:true}, myIframe); iFrameResize({log:true}, myIframe);
}); });
</script></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../getting_started_with_julia/">« Getting started</a><a class="docs-footer-nextpage" href="../julia_async/">Asynchronous programming in Julia »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Friday 8 September 2023 16:03">Friday 8 September 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> </script></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../getting_started_with_julia/">« Getting started</a><a class="docs-footer-nextpage" href="../julia_async/">Asynchronous programming in Julia »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Friday 8 September 2023 16:24">Friday 8 September 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

View File

@ -14,4 +14,4 @@
var myIframe = document.getElementById("notebook"); var myIframe = document.getElementById("notebook");
iFrameResize({log:true}, myIframe); iFrameResize({log:true}, myIframe);
}); });
</script></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../julia_async/">« Asynchronous programming in Julia</a><a class="docs-footer-nextpage" href="../mpi_tutorial/">Distributed computing with MPI »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Friday 8 September 2023 16:03">Friday 8 September 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> </script></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../julia_async/">« Asynchronous programming in Julia</a><a class="docs-footer-nextpage" href="../mpi_tutorial/">Distributed computing with MPI »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Friday 8 September 2023 16:24">Friday 8 September 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

View File

@ -14,4 +14,4 @@
var myIframe = document.getElementById("notebook"); var myIframe = document.getElementById("notebook");
iFrameResize({log:true}, myIframe); iFrameResize({log:true}, myIframe);
}); });
</script></article><nav class="docs-footer"><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Friday 8 September 2023 16:03">Friday 8 September 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> </script></article><nav class="docs-footer"><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Friday 8 September 2023 16:24">Friday 8 September 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

View File

@ -14,4 +14,4 @@
var myIframe = document.getElementById("notebook"); var myIframe = document.getElementById("notebook");
iFrameResize({log:true}, myIframe); iFrameResize({log:true}, myIframe);
}); });
</script></article><nav class="docs-footer"><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Friday 8 September 2023 16:03">Friday 8 September 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> </script></article><nav class="docs-footer"><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Friday 8 September 2023 16:24">Friday 8 September 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

View File

@ -14,4 +14,4 @@
var myIframe = document.getElementById("notebook"); var myIframe = document.getElementById("notebook");
iFrameResize({log:true}, myIframe); iFrameResize({log:true}, myIframe);
}); });
</script></article><nav class="docs-footer"><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Friday 8 September 2023 16:03">Friday 8 September 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> </script></article><nav class="docs-footer"><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Friday 8 September 2023 16:24">Friday 8 September 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

View File

@ -14,4 +14,4 @@
var myIframe = document.getElementById("notebook"); var myIframe = document.getElementById("notebook");
iFrameResize({log:true}, myIframe); iFrameResize({log:true}, myIframe);
}); });
</script></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../mpi_tutorial/">« Distributed computing with MPI</a><a class="docs-footer-nextpage" href="../jacobi_method/">Jacobi method »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Friday 8 September 2023 16:03">Friday 8 September 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> </script></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../mpi_tutorial/">« Distributed computing with MPI</a><a class="docs-footer-nextpage" href="../jacobi_method/">Jacobi method »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Friday 8 September 2023 16:24">Friday 8 September 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

View File

@ -14,4 +14,4 @@
var myIframe = document.getElementById("notebook"); var myIframe = document.getElementById("notebook");
iFrameResize({log:true}, myIframe); iFrameResize({log:true}, myIframe);
}); });
</script></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../julia_distributed/">« Distributed computing in Julia</a><a class="docs-footer-nextpage" href="../matrix_matrix/">Matrix-matrix multiplication »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Friday 8 September 2023 16:03">Friday 8 September 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> </script></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../julia_distributed/">« Distributed computing in Julia</a><a class="docs-footer-nextpage" href="../matrix_matrix/">Matrix-matrix multiplication »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Friday 8 September 2023 16:24">Friday 8 September 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

View File

@ -14,4 +14,4 @@
var myIframe = document.getElementById("notebook"); var myIframe = document.getElementById("notebook");
iFrameResize({log:true}, myIframe); iFrameResize({log:true}, myIframe);
}); });
</script></article><nav class="docs-footer"><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Friday 8 September 2023 16:03">Friday 8 September 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> </script></article><nav class="docs-footer"><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Friday 8 September 2023 16:24">Friday 8 September 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -14,4 +14,4 @@
var myIframe = document.getElementById("notebook"); var myIframe = document.getElementById("notebook");
iFrameResize({log:true}, myIframe); iFrameResize({log:true}, myIframe);
}); });
</script></article><nav class="docs-footer"><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Friday 8 September 2023 16:03">Friday 8 September 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> </script></article><nav class="docs-footer"><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Friday 8 September 2023 16:24">Friday 8 September 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

View File

@ -14,4 +14,4 @@ max_iters = 100
n = 1000 n = 1000
x = LinRange(-1.7,0.7,n) x = LinRange(-1.7,0.7,n)
y = LinRange(-1.2,1.2,n) y = LinRange(-1.2,1.2,n)
heatmap(x,y,(i,j)-&gt;mandel(i,j,max_iters))</code></pre><h2 id="Asynchronous-programming-in-Julia"><a class="docs-heading-anchor" href="#Asynchronous-programming-in-Julia">Asynchronous programming in Julia</a><a id="Asynchronous-programming-in-Julia-1"></a><a class="docs-heading-anchor-permalink" href="#Asynchronous-programming-in-Julia" title="Permalink"></a></h2><h3 id="NB2-Q1"><a class="docs-heading-anchor" href="#NB2-Q1">NB2-Q1</a><a id="NB2-Q1-1"></a><a class="docs-heading-anchor-permalink" href="#NB2-Q1" title="Permalink"></a></h3><p>Evaluating <code>compute_π(100_000_000)</code> takes about 0.25 seconds. Thus, the loop would take about 2.5 seconds since we are calling the function 10 times.</p><h3 id="NB2-Q2"><a class="docs-heading-anchor" href="#NB2-Q2">NB2-Q2</a><a id="NB2-Q2-1"></a><a class="docs-heading-anchor-permalink" href="#NB2-Q2" title="Permalink"></a></h3><p>The time in doing the loop will be almost zero since the loop just schedules 10 tasks, which should be very fast.</p><h3 id="NB2-Q3"><a class="docs-heading-anchor" href="#NB2-Q3">NB2-Q3</a><a id="NB2-Q3-1"></a><a class="docs-heading-anchor-permalink" href="#NB2-Q3" title="Permalink"></a></h3><p>It will take 2.5 seconds, like in question 1. The <code>@sync</code> macro forces to wait for all tasks we have generated with the <code>@async</code> macro. Since we have created 10 tasks and each of them takes about 0.25 seconds, the total time will be about 2.5 seconds.</p><h3 id="NB2-Q4"><a class="docs-heading-anchor" href="#NB2-Q4">NB2-Q4</a><a id="NB2-Q4-1"></a><a class="docs-heading-anchor-permalink" href="#NB2-Q4" title="Permalink"></a></h3><p>It will take about 3 seconds. The channel has buffer size 4, thus the call to <code>put!</code>will not block. The call to <code>take!</code> will not block neither since there is a value stored in the channel. The taken value is 3 and therefore we will wait for 3 seconds. </p><h3 id="NB2-Q5"><a class="docs-heading-anchor" href="#NB2-Q5">NB2-Q5</a><a id="NB2-Q5-1"></a><a class="docs-heading-anchor-permalink" href="#NB2-Q5" title="Permalink"></a></h3><p>The channel is not buffered and therefore the call to <code>put!</code> will block. The cell will run forever, since there is no other task that calls <code>take!</code> on this channel. </p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../asp/">« All pairs of shortest paths</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Friday 8 September 2023 16:03">Friday 8 September 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> heatmap(x,y,(i,j)-&gt;mandel(i,j,max_iters))</code></pre><h2 id="Asynchronous-programming-in-Julia"><a class="docs-heading-anchor" href="#Asynchronous-programming-in-Julia">Asynchronous programming in Julia</a><a id="Asynchronous-programming-in-Julia-1"></a><a class="docs-heading-anchor-permalink" href="#Asynchronous-programming-in-Julia" title="Permalink"></a></h2><h3 id="NB2-Q1"><a class="docs-heading-anchor" href="#NB2-Q1">NB2-Q1</a><a id="NB2-Q1-1"></a><a class="docs-heading-anchor-permalink" href="#NB2-Q1" title="Permalink"></a></h3><p>Evaluating <code>compute_π(100_000_000)</code> takes about 0.25 seconds. Thus, the loop would take about 2.5 seconds since we are calling the function 10 times.</p><h3 id="NB2-Q2"><a class="docs-heading-anchor" href="#NB2-Q2">NB2-Q2</a><a id="NB2-Q2-1"></a><a class="docs-heading-anchor-permalink" href="#NB2-Q2" title="Permalink"></a></h3><p>The time in doing the loop will be almost zero since the loop just schedules 10 tasks, which should be very fast.</p><h3 id="NB2-Q3"><a class="docs-heading-anchor" href="#NB2-Q3">NB2-Q3</a><a id="NB2-Q3-1"></a><a class="docs-heading-anchor-permalink" href="#NB2-Q3" title="Permalink"></a></h3><p>It will take 2.5 seconds, like in question 1. The <code>@sync</code> macro forces to wait for all tasks we have generated with the <code>@async</code> macro. Since we have created 10 tasks and each of them takes about 0.25 seconds, the total time will be about 2.5 seconds.</p><h3 id="NB2-Q4"><a class="docs-heading-anchor" href="#NB2-Q4">NB2-Q4</a><a id="NB2-Q4-1"></a><a class="docs-heading-anchor-permalink" href="#NB2-Q4" title="Permalink"></a></h3><p>It will take about 3 seconds. The channel has buffer size 4, thus the call to <code>put!</code>will not block. The call to <code>take!</code> will not block neither since there is a value stored in the channel. The taken value is 3 and therefore we will wait for 3 seconds. </p><h3 id="NB2-Q5"><a class="docs-heading-anchor" href="#NB2-Q5">NB2-Q5</a><a id="NB2-Q5-1"></a><a class="docs-heading-anchor-permalink" href="#NB2-Q5" title="Permalink"></a></h3><p>The channel is not buffered and therefore the call to <code>put!</code> will block. The cell will run forever, since there is no other task that calls <code>take!</code> on this channel. </p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../asp/">« All pairs of shortest paths</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Friday 8 September 2023 16:24">Friday 8 September 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

View File

@ -14,4 +14,4 @@
var myIframe = document.getElementById("notebook"); var myIframe = document.getElementById("notebook");
iFrameResize({log:true}, myIframe); iFrameResize({log:true}, myIframe);
}); });
</script></article><nav class="docs-footer"><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Friday 8 September 2023 16:03">Friday 8 September 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> </script></article><nav class="docs-footer"><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Friday 8 September 2023 16:24">Friday 8 September 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>