Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7b4621e166 | ||
|
|
9b8dcf4331 | ||
|
|
f60ea53aba | ||
|
|
b628e017c1 | ||
|
|
685d3db6a5 | ||
|
|
123053b9c7 | ||
|
|
c838264158 | ||
|
|
8a60d3f999 | ||
|
|
e88da2b3bd | ||
|
|
d1a88e7525 | ||
|
|
a7b86b4a38 | ||
|
|
f7de703973 | ||
|
|
e34d92008b | ||
|
|
bf45227674 | ||
|
|
59f36650e9 | ||
|
|
4a8548ce62 | ||
|
|
785e78576a | ||
|
|
b116cebaf2 | ||
|
|
f820a72c8c | ||
|
|
557b342f63 | ||
|
|
e1c4a9e1a0 | ||
|
|
26afa1d3c7 | ||
|
|
e34b10c37c | ||
|
|
795f8ec805 | ||
|
|
c3f6c5a5c0 | ||
|
|
7dd8b4fabc | ||
|
|
50fb289e5b | ||
|
|
173d1ad747 | ||
|
|
a9692802de | ||
|
|
3d7fcb4d8e | ||
|
|
6cf3b87d0a | ||
|
|
118f7f8ecd | ||
|
|
ef4aeeb7db | ||
|
|
185c19dc6e | ||
|
|
9ff9a178e4 | ||
|
|
3034b92da3 | ||
|
|
57d1727647 | ||
|
|
11b25d5009 | ||
|
|
b690daaf6e | ||
|
|
0b81f39564 | ||
|
|
b0847c897c | ||
|
|
4fbf18dc0e | ||
|
|
441a15f52f | ||
|
|
fa68ec8f85 | ||
|
|
6ce67fde1a | ||
|
|
f6a3a677b2 | ||
|
|
01c69ff310 | ||
|
|
60ae199c86 | ||
|
|
87684b2d38 | ||
|
|
20c1049ada | ||
|
|
76789ca320 | ||
|
|
4e13c64114 | ||
|
|
6011c99cb8 | ||
|
|
559cefd8f4 | ||
|
|
0e7cdd08e9 | ||
|
|
145d42bd22 | ||
|
|
9a7ce528ac | ||
|
|
4ad26425f6 | ||
|
|
dc2f65480f | ||
|
|
a5f1ac6e5a | ||
|
|
b42470c275 | ||
|
|
214dbbdf85 | ||
|
|
71fd8cad72 | ||
|
|
fd3349e54a | ||
|
|
71fd7d8f56 | ||
|
|
aa7b3c28b8 | ||
|
|
598137ec52 | ||
|
|
a79d490bf3 | ||
|
|
665c853ad2 | ||
|
|
bc7f87be14 | ||
|
|
abd74c81a8 | ||
|
|
9429f1e1e3 | ||
|
|
5095192209 | ||
|
|
59288a7e53 | ||
|
|
cabefa5acd | ||
|
|
795eff418f | ||
|
|
ed7bcf8c06 | ||
|
|
0b53e10b89 | ||
|
|
98ee1a2e08 | ||
|
|
1516d0d7fc | ||
|
|
b82c11d3a7 | ||
|
|
4a6041a5d7 | ||
|
|
81177c8cfc | ||
|
|
a4f014c064 | ||
|
|
15c08580b9 | ||
|
|
9f0ca208f1 | ||
|
|
e775f37ce5 | ||
|
|
f7674fe705 | ||
|
|
421ad3ad68 | ||
|
|
2b8b471cb4 | ||
|
|
44520fbe1d | ||
|
|
c1aa8a7262 | ||
|
|
1f375dd4ff | ||
|
|
097159c967 | ||
|
|
b3f45fce34 | ||
|
|
9bb1ed1896 | ||
|
|
d8f8564236 | ||
|
|
1a9b1a6756 | ||
|
|
904d4caee5 | ||
|
|
5c03b6cf33 | ||
|
|
7899998863 | ||
|
|
b8728d637f | ||
|
|
1202cf41a9 | ||
|
|
5a7d33d8ea | ||
|
|
aa26119f34 | ||
|
|
9372448ef5 | ||
|
|
6c681ef324 | ||
|
|
fc5495986a | ||
|
|
5e0531930e | ||
|
|
4a2ca280cf | ||
|
|
03a3d629e2 | ||
|
|
b91a64c5a1 | ||
|
|
7862ad79e4 | ||
|
|
9991211f35 | ||
|
|
d954714bed | ||
|
|
fe4e47f56b | ||
|
|
9a3c8dbd4c | ||
|
|
f34290559e | ||
|
|
73458f0e1d | ||
|
|
95c4608380 | ||
|
|
b82b2d4bea | ||
|
|
e7417b1e46 | ||
|
|
f283a8f8da | ||
|
|
d2af3894cf | ||
|
|
d902333350 | ||
|
|
14b4706526 | ||
|
|
d2bad0df61 | ||
|
|
b55aef53a7 | ||
|
|
ebdeef8893 | ||
|
|
d13ea2408a | ||
|
|
5d0c156fc1 | ||
|
|
fbb7423b65 | ||
|
|
abcd874867 | ||
|
|
1c3062f249 | ||
|
|
3de8ce76c9 | ||
|
|
6a8a64740c | ||
|
|
7f0f40fa47 | ||
|
|
732eb4ee00 | ||
|
|
811ec8f509 | ||
|
|
6c4bbec71b | ||
|
|
e6e68e8f9a | ||
|
|
973c76fff0 | ||
|
|
a6b8b7e051 | ||
|
|
963cbd96e7 | ||
|
|
ff9158dd9b | ||
|
|
b03244d130 | ||
|
|
ecebbdbab1 | ||
|
|
f3cb03b337 | ||
|
|
51c608cf71 | ||
|
|
780c982074 | ||
|
|
a45683b381 | ||
|
|
3507cb66d6 | ||
|
|
2c76ded98a | ||
|
|
a2bb4df6f5 | ||
|
|
3b1e15c6f8 | ||
|
|
36e27eee4e | ||
|
|
13ee7880e7 | ||
|
|
9b563c984e | ||
|
|
8892e1e7f7 | ||
|
|
67c2c39cda | ||
|
|
ee7a9c75d9 | ||
|
|
65e88dff8e | ||
|
|
ffcd31c482 | ||
|
|
5b47a090a5 | ||
|
|
413e27df23 | ||
|
|
0eea1ec8c1 | ||
|
|
b5f054495a | ||
|
|
aed98da00b |
No files matched your search
@@ -0,0 +1,64 @@
|
||||
name: CI
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
tags: ['*']
|
||||
pull_request:
|
||||
concurrency:
|
||||
# Skip intermediate builds: always.
|
||||
# Cancel intermediate builds: only if it is a pull request build.
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
|
||||
jobs:
|
||||
test:
|
||||
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
version:
|
||||
- '1.9'
|
||||
os:
|
||||
- ubuntu-latest
|
||||
arch:
|
||||
- x64
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: julia-actions/setup-julia@v1
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
arch: ${{ matrix.arch }}
|
||||
- uses: julia-actions/cache@v1
|
||||
- uses: julia-actions/julia-buildpkg@v1
|
||||
- uses: julia-actions/julia-runtest@v1
|
||||
docs:
|
||||
name: Documentation
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
statuses: write
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: julia-actions/setup-julia@v1
|
||||
with:
|
||||
version: '1'
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4.7.0
|
||||
with:
|
||||
python-version: '3.9'
|
||||
- name: Install nbconvert
|
||||
run: |
|
||||
python -m pip install jupyter nbconvert
|
||||
- name: Configure doc environment
|
||||
run: |
|
||||
julia --project=docs/ -e '
|
||||
using Pkg
|
||||
Pkg.develop(PackageSpec(path=pwd()))
|
||||
Pkg.instantiate()'
|
||||
- uses: julia-actions/julia-buildpkg@v1
|
||||
- uses: julia-actions/julia-docdeploy@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
*.swp
|
||||
Manifest.toml
|
||||
.ipynb_checkpoints/
|
||||
.vscode/
|
||||
docs/src/notebooks/
|
||||
docs/src/notebook-html/
|
||||
*.code-workspace
|
||||
*.DS_Store
|
||||
@@ -0,0 +1,395 @@
|
||||
Attribution 4.0 International
|
||||
|
||||
=======================================================================
|
||||
|
||||
Creative Commons Corporation ("Creative Commons") is not a law firm and
|
||||
does not provide legal services or legal advice. Distribution of
|
||||
Creative Commons public licenses does not create a lawyer-client or
|
||||
other relationship. Creative Commons makes its licenses and related
|
||||
information available on an "as-is" basis. Creative Commons gives no
|
||||
warranties regarding its licenses, any material licensed under their
|
||||
terms and conditions, or any related information. Creative Commons
|
||||
disclaims all liability for damages resulting from their use to the
|
||||
fullest extent possible.
|
||||
|
||||
Using Creative Commons Public Licenses
|
||||
|
||||
Creative Commons public licenses provide a standard set of terms and
|
||||
conditions that creators and other rights holders may use to share
|
||||
original works of authorship and other material subject to copyright
|
||||
and certain other rights specified in the public license below. The
|
||||
following considerations are for informational purposes only, are not
|
||||
exhaustive, and do not form part of our licenses.
|
||||
|
||||
Considerations for licensors: Our public licenses are
|
||||
intended for use by those authorized to give the public
|
||||
permission to use material in ways otherwise restricted by
|
||||
copyright and certain other rights. Our licenses are
|
||||
irrevocable. Licensors should read and understand the terms
|
||||
and conditions of the license they choose before applying it.
|
||||
Licensors should also secure all rights necessary before
|
||||
applying our licenses so that the public can reuse the
|
||||
material as expected. Licensors should clearly mark any
|
||||
material not subject to the license. This includes other CC-
|
||||
licensed material, or material used under an exception or
|
||||
limitation to copyright. More considerations for licensors:
|
||||
wiki.creativecommons.org/Considerations_for_licensors
|
||||
|
||||
Considerations for the public: By using one of our public
|
||||
licenses, a licensor grants the public permission to use the
|
||||
licensed material under specified terms and conditions. If
|
||||
the licensor's permission is not necessary for any reason--for
|
||||
example, because of any applicable exception or limitation to
|
||||
copyright--then that use is not regulated by the license. Our
|
||||
licenses grant only permissions under copyright and certain
|
||||
other rights that a licensor has authority to grant. Use of
|
||||
the licensed material may still be restricted for other
|
||||
reasons, including because others have copyright or other
|
||||
rights in the material. A licensor may make special requests,
|
||||
such as asking that all changes be marked or described.
|
||||
Although not required by our licenses, you are encouraged to
|
||||
respect those requests where reasonable. More considerations
|
||||
for the public:
|
||||
wiki.creativecommons.org/Considerations_for_licensees
|
||||
|
||||
=======================================================================
|
||||
|
||||
Creative Commons Attribution 4.0 International Public License
|
||||
|
||||
By exercising the Licensed Rights (defined below), You accept and agree
|
||||
to be bound by the terms and conditions of this Creative Commons
|
||||
Attribution 4.0 International Public License ("Public License"). To the
|
||||
extent this Public License may be interpreted as a contract, You are
|
||||
granted the Licensed Rights in consideration of Your acceptance of
|
||||
these terms and conditions, and the Licensor grants You such rights in
|
||||
consideration of benefits the Licensor receives from making the
|
||||
Licensed Material available under these terms and conditions.
|
||||
|
||||
|
||||
Section 1 -- Definitions.
|
||||
|
||||
a. Adapted Material means material subject to Copyright and Similar
|
||||
Rights that is derived from or based upon the Licensed Material
|
||||
and in which the Licensed Material is translated, altered,
|
||||
arranged, transformed, or otherwise modified in a manner requiring
|
||||
permission under the Copyright and Similar Rights held by the
|
||||
Licensor. For purposes of this Public License, where the Licensed
|
||||
Material is a musical work, performance, or sound recording,
|
||||
Adapted Material is always produced where the Licensed Material is
|
||||
synched in timed relation with a moving image.
|
||||
|
||||
b. Adapter's License means the license You apply to Your Copyright
|
||||
and Similar Rights in Your contributions to Adapted Material in
|
||||
accordance with the terms and conditions of this Public License.
|
||||
|
||||
c. Copyright and Similar Rights means copyright and/or similar rights
|
||||
closely related to copyright including, without limitation,
|
||||
performance, broadcast, sound recording, and Sui Generis Database
|
||||
Rights, without regard to how the rights are labeled or
|
||||
categorized. For purposes of this Public License, the rights
|
||||
specified in Section 2(b)(1)-(2) are not Copyright and Similar
|
||||
Rights.
|
||||
|
||||
d. Effective Technological Measures means those measures that, in the
|
||||
absence of proper authority, may not be circumvented under laws
|
||||
fulfilling obligations under Article 11 of the WIPO Copyright
|
||||
Treaty adopted on December 20, 1996, and/or similar international
|
||||
agreements.
|
||||
|
||||
e. Exceptions and Limitations means fair use, fair dealing, and/or
|
||||
any other exception or limitation to Copyright and Similar Rights
|
||||
that applies to Your use of the Licensed Material.
|
||||
|
||||
f. Licensed Material means the artistic or literary work, database,
|
||||
or other material to which the Licensor applied this Public
|
||||
License.
|
||||
|
||||
g. Licensed Rights means the rights granted to You subject to the
|
||||
terms and conditions of this Public License, which are limited to
|
||||
all Copyright and Similar Rights that apply to Your use of the
|
||||
Licensed Material and that the Licensor has authority to license.
|
||||
|
||||
h. Licensor means the individual(s) or entity(ies) granting rights
|
||||
under this Public License.
|
||||
|
||||
i. Share means to provide material to the public by any means or
|
||||
process that requires permission under the Licensed Rights, such
|
||||
as reproduction, public display, public performance, distribution,
|
||||
dissemination, communication, or importation, and to make material
|
||||
available to the public including in ways that members of the
|
||||
public may access the material from a place and at a time
|
||||
individually chosen by them.
|
||||
|
||||
j. Sui Generis Database Rights means rights other than copyright
|
||||
resulting from Directive 96/9/EC of the European Parliament and of
|
||||
the Council of 11 March 1996 on the legal protection of databases,
|
||||
as amended and/or succeeded, as well as other essentially
|
||||
equivalent rights anywhere in the world.
|
||||
|
||||
k. You means the individual or entity exercising the Licensed Rights
|
||||
under this Public License. Your has a corresponding meaning.
|
||||
|
||||
|
||||
Section 2 -- Scope.
|
||||
|
||||
a. License grant.
|
||||
|
||||
1. Subject to the terms and conditions of this Public License,
|
||||
the Licensor hereby grants You a worldwide, royalty-free,
|
||||
non-sublicensable, non-exclusive, irrevocable license to
|
||||
exercise the Licensed Rights in the Licensed Material to:
|
||||
|
||||
a. reproduce and Share the Licensed Material, in whole or
|
||||
in part; and
|
||||
|
||||
b. produce, reproduce, and Share Adapted Material.
|
||||
|
||||
2. Exceptions and Limitations. For the avoidance of doubt, where
|
||||
Exceptions and Limitations apply to Your use, this Public
|
||||
License does not apply, and You do not need to comply with
|
||||
its terms and conditions.
|
||||
|
||||
3. Term. The term of this Public License is specified in Section
|
||||
6(a).
|
||||
|
||||
4. Media and formats; technical modifications allowed. The
|
||||
Licensor authorizes You to exercise the Licensed Rights in
|
||||
all media and formats whether now known or hereafter created,
|
||||
and to make technical modifications necessary to do so. The
|
||||
Licensor waives and/or agrees not to assert any right or
|
||||
authority to forbid You from making technical modifications
|
||||
necessary to exercise the Licensed Rights, including
|
||||
technical modifications necessary to circumvent Effective
|
||||
Technological Measures. For purposes of this Public License,
|
||||
simply making modifications authorized by this Section 2(a)
|
||||
(4) never produces Adapted Material.
|
||||
|
||||
5. Downstream recipients.
|
||||
|
||||
a. Offer from the Licensor -- Licensed Material. Every
|
||||
recipient of the Licensed Material automatically
|
||||
receives an offer from the Licensor to exercise the
|
||||
Licensed Rights under the terms and conditions of this
|
||||
Public License.
|
||||
|
||||
b. No downstream restrictions. You may not offer or impose
|
||||
any additional or different terms or conditions on, or
|
||||
apply any Effective Technological Measures to, the
|
||||
Licensed Material if doing so restricts exercise of the
|
||||
Licensed Rights by any recipient of the Licensed
|
||||
Material.
|
||||
|
||||
6. No endorsement. Nothing in this Public License constitutes or
|
||||
may be construed as permission to assert or imply that You
|
||||
are, or that Your use of the Licensed Material is, connected
|
||||
with, or sponsored, endorsed, or granted official status by,
|
||||
the Licensor or others designated to receive attribution as
|
||||
provided in Section 3(a)(1)(A)(i).
|
||||
|
||||
b. Other rights.
|
||||
|
||||
1. Moral rights, such as the right of integrity, are not
|
||||
licensed under this Public License, nor are publicity,
|
||||
privacy, and/or other similar personality rights; however, to
|
||||
the extent possible, the Licensor waives and/or agrees not to
|
||||
assert any such rights held by the Licensor to the limited
|
||||
extent necessary to allow You to exercise the Licensed
|
||||
Rights, but not otherwise.
|
||||
|
||||
2. Patent and trademark rights are not licensed under this
|
||||
Public License.
|
||||
|
||||
3. To the extent possible, the Licensor waives any right to
|
||||
collect royalties from You for the exercise of the Licensed
|
||||
Rights, whether directly or through a collecting society
|
||||
under any voluntary or waivable statutory or compulsory
|
||||
licensing scheme. In all other cases the Licensor expressly
|
||||
reserves any right to collect such royalties.
|
||||
|
||||
|
||||
Section 3 -- License Conditions.
|
||||
|
||||
Your exercise of the Licensed Rights is expressly made subject to the
|
||||
following conditions.
|
||||
|
||||
a. Attribution.
|
||||
|
||||
1. If You Share the Licensed Material (including in modified
|
||||
form), You must:
|
||||
|
||||
a. retain the following if it is supplied by the Licensor
|
||||
with the Licensed Material:
|
||||
|
||||
i. identification of the creator(s) of the Licensed
|
||||
Material and any others designated to receive
|
||||
attribution, in any reasonable manner requested by
|
||||
the Licensor (including by pseudonym if
|
||||
designated);
|
||||
|
||||
ii. a copyright notice;
|
||||
|
||||
iii. a notice that refers to this Public License;
|
||||
|
||||
iv. a notice that refers to the disclaimer of
|
||||
warranties;
|
||||
|
||||
v. a URI or hyperlink to the Licensed Material to the
|
||||
extent reasonably practicable;
|
||||
|
||||
b. indicate if You modified the Licensed Material and
|
||||
retain an indication of any previous modifications; and
|
||||
|
||||
c. indicate the Licensed Material is licensed under this
|
||||
Public License, and include the text of, or the URI or
|
||||
hyperlink to, this Public License.
|
||||
|
||||
2. You may satisfy the conditions in Section 3(a)(1) in any
|
||||
reasonable manner based on the medium, means, and context in
|
||||
which You Share the Licensed Material. For example, it may be
|
||||
reasonable to satisfy the conditions by providing a URI or
|
||||
hyperlink to a resource that includes the required
|
||||
information.
|
||||
|
||||
3. If requested by the Licensor, You must remove any of the
|
||||
information required by Section 3(a)(1)(A) to the extent
|
||||
reasonably practicable.
|
||||
|
||||
4. If You Share Adapted Material You produce, the Adapter's
|
||||
License You apply must not prevent recipients of the Adapted
|
||||
Material from complying with this Public License.
|
||||
|
||||
|
||||
Section 4 -- Sui Generis Database Rights.
|
||||
|
||||
Where the Licensed Rights include Sui Generis Database Rights that
|
||||
apply to Your use of the Licensed Material:
|
||||
|
||||
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
|
||||
to extract, reuse, reproduce, and Share all or a substantial
|
||||
portion of the contents of the database;
|
||||
|
||||
b. if You include all or a substantial portion of the database
|
||||
contents in a database in which You have Sui Generis Database
|
||||
Rights, then the database in which You have Sui Generis Database
|
||||
Rights (but not its individual contents) is Adapted Material; and
|
||||
|
||||
c. You must comply with the conditions in Section 3(a) if You Share
|
||||
all or a substantial portion of the contents of the database.
|
||||
|
||||
For the avoidance of doubt, this Section 4 supplements and does not
|
||||
replace Your obligations under this Public License where the Licensed
|
||||
Rights include other Copyright and Similar Rights.
|
||||
|
||||
|
||||
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
|
||||
|
||||
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
|
||||
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
|
||||
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
|
||||
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
|
||||
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
|
||||
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
|
||||
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
|
||||
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
|
||||
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
|
||||
|
||||
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
|
||||
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
|
||||
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
|
||||
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
|
||||
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
|
||||
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
|
||||
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
|
||||
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
|
||||
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
|
||||
|
||||
c. The disclaimer of warranties and limitation of liability provided
|
||||
above shall be interpreted in a manner that, to the extent
|
||||
possible, most closely approximates an absolute disclaimer and
|
||||
waiver of all liability.
|
||||
|
||||
|
||||
Section 6 -- Term and Termination.
|
||||
|
||||
a. This Public License applies for the term of the Copyright and
|
||||
Similar Rights licensed here. However, if You fail to comply with
|
||||
this Public License, then Your rights under this Public License
|
||||
terminate automatically.
|
||||
|
||||
b. Where Your right to use the Licensed Material has terminated under
|
||||
Section 6(a), it reinstates:
|
||||
|
||||
1. automatically as of the date the violation is cured, provided
|
||||
it is cured within 30 days of Your discovery of the
|
||||
violation; or
|
||||
|
||||
2. upon express reinstatement by the Licensor.
|
||||
|
||||
For the avoidance of doubt, this Section 6(b) does not affect any
|
||||
right the Licensor may have to seek remedies for Your violations
|
||||
of this Public License.
|
||||
|
||||
c. For the avoidance of doubt, the Licensor may also offer the
|
||||
Licensed Material under separate terms or conditions or stop
|
||||
distributing the Licensed Material at any time; however, doing so
|
||||
will not terminate this Public License.
|
||||
|
||||
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
|
||||
License.
|
||||
|
||||
|
||||
Section 7 -- Other Terms and Conditions.
|
||||
|
||||
a. The Licensor shall not be bound by any additional or different
|
||||
terms or conditions communicated by You unless expressly agreed.
|
||||
|
||||
b. Any arrangements, understandings, or agreements regarding the
|
||||
Licensed Material not stated herein are separate from and
|
||||
independent of the terms and conditions of this Public License.
|
||||
|
||||
|
||||
Section 8 -- Interpretation.
|
||||
|
||||
a. For the avoidance of doubt, this Public License does not, and
|
||||
shall not be interpreted to, reduce, limit, restrict, or impose
|
||||
conditions on any use of the Licensed Material that could lawfully
|
||||
be made without permission under this Public License.
|
||||
|
||||
b. To the extent possible, if any provision of this Public License is
|
||||
deemed unenforceable, it shall be automatically reformed to the
|
||||
minimum extent necessary to make it enforceable. If the provision
|
||||
cannot be reformed, it shall be severed from this Public License
|
||||
without affecting the enforceability of the remaining terms and
|
||||
conditions.
|
||||
|
||||
c. No term or condition of this Public License will be waived and no
|
||||
failure to comply consented to unless expressly agreed to by the
|
||||
Licensor.
|
||||
|
||||
d. Nothing in this Public License constitutes or may be interpreted
|
||||
as a limitation upon, or waiver of, any privileges and immunities
|
||||
that apply to the Licensor or You, including from the legal
|
||||
processes of any jurisdiction or authority.
|
||||
|
||||
|
||||
=======================================================================
|
||||
|
||||
Creative Commons is not a party to its public
|
||||
licenses. Notwithstanding, Creative Commons may elect to apply one of
|
||||
its public licenses to material it publishes and in those instances
|
||||
will be considered the “Licensor.” The text of the Creative Commons
|
||||
public licenses is dedicated to the public domain under the CC0 Public
|
||||
Domain Dedication. Except for the limited purpose of indicating that
|
||||
material is shared under a Creative Commons public license or as
|
||||
otherwise permitted by the Creative Commons policies published at
|
||||
creativecommons.org/policies, Creative Commons does not authorize the
|
||||
use of the trademark "Creative Commons" or any other trademark or logo
|
||||
of Creative Commons without its prior written consent including,
|
||||
without limitation, in connection with any unauthorized modifications
|
||||
to any of its public licenses or any other arrangements,
|
||||
understandings, or agreements concerning use of licensed material. For
|
||||
the avoidance of doubt, this paragraph does not form part of the
|
||||
public licenses.
|
||||
|
||||
Creative Commons may be contacted at creativecommons.org.
|
||||
@@ -0,0 +1,8 @@
|
||||
name = "XM_40017"
|
||||
uuid = "97f213cd-d64a-481d-bc9d-afa871b8c535"
|
||||
authors = ["Francesc Verdugo <f.verdugo.rojano@vu.nl>"]
|
||||
version = "0.1.0"
|
||||
|
||||
[deps]
|
||||
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
|
||||
Glob = "c27321d9-0574-5035-807b-f59d2c89b15c"
|
||||
@@ -0,0 +1,6 @@
|
||||
# XM_40017
|
||||
Jupyter notebook scripts for the course Programming Large-Scale Parallel Systems (XM_40017) at Vrije Universiteit Amsterdam.
|
||||
|
||||
- [**Go to webpage**](https://fverdugo.github.io/XM_40017/dev)
|
||||
|
||||
NB: The `notebooks` folder contains material under construction. The material that is ready for study is the one accessible from the website. The material will be added incrementally to the website as the course advances.
|
||||
@@ -1 +0,0 @@
|
||||
{"documenter":{"julia_version":"1.11.7","generation_timestamp":"2025-09-24T05:37:55","documenter_version":"1.14.1"}}
|
||||
@@ -1,636 +0,0 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "46d0dd15",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<img src=\"https://upload.wikimedia.org/wikipedia/commons/thumb/3/39/VU_logo.png/800px-VU_logo.png?20161029201021\" width=\"350\">\n",
|
||||
"\n",
|
||||
"### Programming large-scale parallel systems\n",
|
||||
"\n",
|
||||
"# Gaussian elimination"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "ff0fbd76",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Contents\n",
|
||||
"\n",
|
||||
"In this notebook, we will learn\n",
|
||||
"\n",
|
||||
"- How to parallelize Gaussian elimination\n",
|
||||
"- What is load imbalance, and how to fix it in this algorithm"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "480af594",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<div class=\"alert alert-block alert-info\">\n",
|
||||
"<b>Note:</b> Do not forget to execute the cell below before starting this notebook! \n",
|
||||
"</div>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "7e93809a",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"using Printf\n",
|
||||
"function answer_checker(answer,solution)\n",
|
||||
" if answer == solution\n",
|
||||
" \"🥳 Well done!\"\n",
|
||||
" else\n",
|
||||
" \"It's not correct. Keep trying! 💪\"\n",
|
||||
" end |> println\n",
|
||||
"end\n",
|
||||
"function ge_par_why()\n",
|
||||
" msg = \"The outer loop of the algorithm is not parallelizable, since the iterations depend on the results of the previous iterations. However, we can extract parallelism from the inner loops.\"\n",
|
||||
" println(msg)\n",
|
||||
"end\n",
|
||||
"ge_par_check(answer) = answer_checker(answer, \"a\")\n",
|
||||
"ge_dep_check(answer) = answer_checker(answer, \"b\")\n",
|
||||
"function ge_lb_answer()\n",
|
||||
" msg = \"It is a form of static load balancing. We know in advance the load distribution and the partition strategy does not depend on the actual values of the input matrix\"\n",
|
||||
" println(msg)\n",
|
||||
"end\n",
|
||||
"println(\"🥳 Well done!\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "8ad95aa5",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Gaussian elimination\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"[Gaussian elimination](https://en.wikipedia.org/wiki/Gaussian_elimination) is a method to solve systems of linear equations, like this one:\n",
|
||||
"\n",
|
||||
"$$\n",
|
||||
"\\left[\n",
|
||||
"\\begin{matrix}\n",
|
||||
"1 & 3 & 1 \\\\\n",
|
||||
"1 & 2 & -1 \\\\\n",
|
||||
"3 & 11 & 5 \\\\\n",
|
||||
"\\end{matrix}\n",
|
||||
"\\right]\n",
|
||||
"\\left[\n",
|
||||
"\\begin{matrix}\n",
|
||||
"x \\\\\n",
|
||||
"y \\\\\n",
|
||||
"z \\\\\n",
|
||||
"\\end{matrix}\n",
|
||||
"\\right]\n",
|
||||
"=\n",
|
||||
"\\left[\n",
|
||||
"\\begin{matrix}\n",
|
||||
"9 \\\\\n",
|
||||
"1 \\\\\n",
|
||||
"35 \\\\\n",
|
||||
"\\end{matrix}\n",
|
||||
"\\right].\n",
|
||||
"$$\n",
|
||||
"\n",
|
||||
"This is just a small example with three unknowns, but practical applications need to solve linear equations with large number of unknowns. Parallel processing is needed in these cases.\n",
|
||||
"\n",
|
||||
"### Problem statement\n",
|
||||
"\n",
|
||||
"Let us consider a system of linear equations written in matrix form $Ax=b$, where $A$ is a nonsingular square matrix, and $x$ and $b$ are vectors. $A$ and $b$ are given, and $x$ is unknown. The goal of Gaussian elimination is to transform the system $Ax=b$, into a new system $Ux=c$ such that\n",
|
||||
"- both systems have the same solution vector $x$,\n",
|
||||
"- the matrix $U$ of the new system is *upper triangular* with unit diagonal, namely $U_{ii} = 1$ and $U_{ij} = 0$ for $i>j$.\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"For the particular system shown above, the transformed one is the following:\n",
|
||||
"\n",
|
||||
"$$\n",
|
||||
"\\left[\n",
|
||||
"\\begin{matrix}\n",
|
||||
"1 & 3 & 1 \\\\\n",
|
||||
"1 & 2 & -1 \\\\\n",
|
||||
"3 & 11 & 5 \\\\\n",
|
||||
"\\end{matrix}\n",
|
||||
"\\right]\n",
|
||||
"\\left[\n",
|
||||
"\\begin{matrix}\n",
|
||||
"x \\\\\n",
|
||||
"y \\\\\n",
|
||||
"z \\\\\n",
|
||||
"\\end{matrix}\n",
|
||||
"\\right]\n",
|
||||
"=\n",
|
||||
"\\left[\n",
|
||||
"\\begin{matrix}\n",
|
||||
"9 \\\\\n",
|
||||
"1 \\\\\n",
|
||||
"35 \\\\\n",
|
||||
"\\end{matrix}\n",
|
||||
"\\right]\n",
|
||||
"\\longrightarrow\n",
|
||||
"\\left[\n",
|
||||
"\\begin{matrix}\n",
|
||||
"1 & 3 & 1 \\\\\n",
|
||||
"0 & 1 & 2 \\\\\n",
|
||||
"0 & 0 & 1 \\\\\n",
|
||||
"\\end{matrix}\n",
|
||||
"\\right]\n",
|
||||
"\\left[\n",
|
||||
"\\begin{matrix}\n",
|
||||
"x \\\\\n",
|
||||
"y \\\\\n",
|
||||
"z \\\\\n",
|
||||
"\\end{matrix}\n",
|
||||
"\\right]\n",
|
||||
"=\n",
|
||||
"\\left[\n",
|
||||
"\\begin{matrix}\n",
|
||||
"9 \\\\\n",
|
||||
"8 \\\\\n",
|
||||
"4 \\\\\n",
|
||||
"\\end{matrix}\n",
|
||||
"\\right]\n",
|
||||
"$$\n",
|
||||
"\n",
|
||||
"The most challenging part of solving a system of linear equations is to transform it to upper triangular form. Afterwards, the solution vector can be obtained easily with a backward substitution. For this reason, we will study here the triangulation step only."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "980cb36f",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"\n",
|
||||
"\n",
|
||||
"### Augmented system matrix\n",
|
||||
"\n",
|
||||
"In practice, vector $b$ is added as an additional column to A forming the so-called *augmented* matrix $A^* = [A b]$. The augmented matrix in the example above is\n",
|
||||
"\n",
|
||||
"$$\n",
|
||||
"\\left[\n",
|
||||
"\\begin{matrix}\n",
|
||||
"1 & 3 & 1 \\\\\n",
|
||||
"1 & 2 & -1 \\\\\n",
|
||||
"3 & 11 & 5 \\\\\n",
|
||||
"\\end{matrix}\n",
|
||||
"\\right]\n",
|
||||
"\\left[\n",
|
||||
"\\begin{matrix}\n",
|
||||
"x \\\\\n",
|
||||
"y \\\\\n",
|
||||
"z \\\\\n",
|
||||
"\\end{matrix}\n",
|
||||
"\\right]\n",
|
||||
"=\n",
|
||||
"\\left[\n",
|
||||
"\\begin{matrix}\n",
|
||||
"9 \\\\\n",
|
||||
"1 \\\\\n",
|
||||
"35 \\\\\n",
|
||||
"\\end{matrix}\n",
|
||||
"\\right]\\longrightarrow\n",
|
||||
"A^*=\n",
|
||||
"\\left[\n",
|
||||
"\\begin{matrix}\n",
|
||||
"1 & 3 & 1 & 9 \\\\\n",
|
||||
"1 & 2 & -1 & 1 \\\\\n",
|
||||
"3 & 11 & 5 & 35\\\\\n",
|
||||
"\\end{matrix}\n",
|
||||
"\\right].\n",
|
||||
"$$\n",
|
||||
"\n",
|
||||
"With this new notation, the goal of Gaussian elimination is to find the augmented matrix containing $U$ and $c$, namely $U^*= [U c]$, given the augmented matrix $A^* = [A b]$. These are $A^*$ and $U^*$ in our example:\n",
|
||||
"\n",
|
||||
"$$\n",
|
||||
"A^*=\n",
|
||||
"\\left[\n",
|
||||
"\\begin{matrix}\n",
|
||||
"1 & 3 & 1 & 9 \\\\\n",
|
||||
"1 & 2 & -1 & 1 \\\\\n",
|
||||
"3 & 11 & 5 & 35\\\\\n",
|
||||
"\\end{matrix}\n",
|
||||
"\\right]\\longrightarrow\n",
|
||||
"U^*=\n",
|
||||
"\\left[\n",
|
||||
"\\begin{matrix}\n",
|
||||
"1 & 3 & 1 & 9 \\\\\n",
|
||||
"0 & 1 & 2 & 8\\\\\n",
|
||||
"0 & 0 & 1 & 4\\\\\n",
|
||||
"\\end{matrix}\n",
|
||||
"\\right].\n",
|
||||
"$$\n",
|
||||
"\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "94c10106",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Serial implementation\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"The following algorithm computes the Gaussian elimination on a given augmented matrix `B`, representing a system of linear equations. The result is given by overwriting `B`, avoiding the allocation of an additional matrix.\n",
|
||||
"\n",
|
||||
"- The outer loop is a loop over rows.\n",
|
||||
"- The first inner loop in line 4 divides the current row by the value of the diagonal entry, thus transforming the diagonal to contain only ones. Note that we skip the first entries in the row, as we know that these values are zero at this point. The cells updated in this loop at iteration $k$ are depicted in red in the figure below.\n",
|
||||
"- The second inner loop beginning in line 8 subtracts the rows from one another such that all entries below the diagonal become zero. The entries updated in this loop are depicted in blue in the figure below."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "e4070214",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"function gaussian_elimination!(B)\n",
|
||||
" n,m = size(B)\n",
|
||||
" @inbounds for k in 1:n\n",
|
||||
" for t in (k+1):m\n",
|
||||
" B[k,t] = B[k,t]/B[k,k]\n",
|
||||
" end\n",
|
||||
" B[k,k] = 1\n",
|
||||
" for i in (k+1):n \n",
|
||||
" for j in (k+1):m\n",
|
||||
" B[i,j] = B[i,j] - B[i,k]*B[k,j]\n",
|
||||
" end\n",
|
||||
" B[i,k] = 0\n",
|
||||
" end\n",
|
||||
" end\n",
|
||||
" B\n",
|
||||
"end"
|
||||
]
|
||||
},
|
||||
{
|
||||
"attachments": {
|
||||
"g27851.png": {
|
||||
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAzAAAAJsCAYAAAAiM0YjAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAewgAAHsIBbtB1PgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAACAASURBVHic7N15nBx1nf/xV/X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w5Rw+nAA0mHGEZv0gGG8RBwStIhargIuDzpEDUcTlQAptlWoiIhrW4Czk86xPbCaWXvFUIIT006lbLPa2AkSZIkZYYFjCRJkqTMsICRJEmSlBkWMJIkSZIyw2mUpeHtDOzB0wX/DUQzm0mSJKnFLGCk7b2UaD79g4mm9J5X9vgBwK2tDiVJkiQLGKmS/yVal0CSJEkp4zUwUnVbiU4X+xouJSxJkpQKjsBI23sX8DfgLp5edflyYPfEEkmSJAmwgJEq+WHSASRJklSZp5BJkiRJygwLGEmSJEmZYQEjSZIkKTMsYCRJkiRlhgWMJEmSpMywgJEkSZKUGRYwkiRJkjLDAkaSJElSZljASJIkScoMCxhJkiRJmWEBI0mSJCkzLGAkSZIkZYYFjCRJkqTMsICRJEmSlBn5pANIKbQUeG/Zvkkl968B+ku2Q2Bms0NJkiTJAkaqZDwwvcbjU8q2wyZmkSRJUgkLGGl7VzJ0hGU4FjCSJEktYgEjbe+3AzdJkiSljBfxS5IkScoMCxhJkiRJmWEBI0mSJCkzLGAkSZIkZYYFLine truncated
|
||||
}
|
||||
},
|
||||
"cell_type": "markdown",
|
||||
"id": "cc6ce65e",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<div>\n",
|
||||
"<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAzAAAAJsCAYAAAAiM0YjAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAewgAAHsIBbtB1PgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAACAASURBVHic7N15nBx1nf/xV/X0zOS+LxIIwYRDDkFuFBFUUFbE+wQPFBRXXQVcL1xss3ggrgfeeKKuq7grIh4/BeUSOQxBbgEFQgIkAZJJyDVX1++PmoGeTnfPVKe7q2rm9Xw8+pGu6u936t09k5n+9Lfq+w2QJI12eeCsku2/A5cO3O8EXgG8GdgD2BkoAvcDvwMuAB6u8nWfBZwKPB94xsDXWgvcBPwQ+GUjn4QkSZKksWE8EJbcfjqw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sX8DfgLp5edflyYPfEEkmSJAmwgJEq+WHSASRJklSZp5BJkiRJygwLGEmSJEmZYQEjSZIkKTMsYCRJkiRlhgWMJEmSpMywgJEkSZKUGRYwkiRJkjLDAkaSJElSZljASJIkScoMCxhJkiRJmWEBI0mSJCkzLGAkSZIkZYYFjCRJkqTMsICRJEmSlBn5pANIKbQUeG/Zvkkl968B+ku2Q2Bms0NJkiTJAkaqZDwwvcbjU8q2wyZmkSRJUgkLGGl7VzJ0hGU4FjCSJEktYgEjbe+3AzdJkiSljBfxS5IkScoMCxhJkiRJmWEBILine truncated
|
||||
"</div>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "3763b000",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<div class=\"alert alert-block alert-info\">\n",
|
||||
"<b>Note:</b> This algorithm is not correct for all nonsingular matrices: if any diagonal element <code>B[k,k]</code> is zero, the computation in the first inner loop fails. To get around this problem, another step can be added to the algorithm that swaps the rows until the diagonal entry of the current row is not zero. This process of finding a nonzero value is called <b>pivoting</b>. We are not going to consider pivoting here for simplicity. \n",
|
||||
"</div>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "fbb3d1eb",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"You can verify that the algorithm computes the upper triangular matrix correctly for the example in the introduction by running the following code cell. "
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "eb30df0d",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"A = Float64[1 3 1; 1 2 -1; 3 11 5]\n",
|
||||
"b = Float64[9,1,35]\n",
|
||||
"B = [A b]\n",
|
||||
"gaussian_elimination!(B)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "a7d6f90a",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Complexity of the algorithm\n",
|
||||
"\n",
|
||||
"The number of operations of the algorithm is $O(N^3)$, where $N$ is the number of unknowns in the system. Intuitively, this makes sense as there are three nested loops. However, the length of the loops is not equal to $N$. In any case, it can be proven that the total number of operations is still $O(N^3)$. The actual proof is a bit challenging and it is not discussed here."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "39f2e8ef",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Parallelization\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "1b1a6469",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Where can we extract parallelism?\n",
|
||||
"\n",
|
||||
"```julia\n",
|
||||
"n,m = size(B)\n",
|
||||
"for k in 1:n\n",
|
||||
" for t in (k+1):m\n",
|
||||
" B[k,t] = B[k,t]/B[k,k]\n",
|
||||
" end\n",
|
||||
" B[k,k] = 1\n",
|
||||
" for i in (k+1):n \n",
|
||||
" for j in (k+1):m\n",
|
||||
" B[i,j] = B[i,j] - B[i,k]*B[k,j]\n",
|
||||
" end\n",
|
||||
" B[i,k] = 0\n",
|
||||
" end\n",
|
||||
"end\n",
|
||||
"```"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "e52c4b38",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<div class=\"alert alert-block alert-success\">\n",
|
||||
"<b>Question:</b> Which of the loops can be parallelized?\n",
|
||||
"</div>\n",
|
||||
"\n",
|
||||
" a) the inner loops, but not the outer loop\n",
|
||||
" b) the outer loop, but not the inner loops\n",
|
||||
" c) all loops\n",
|
||||
" d) only the first inner loop"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "078e974e",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"answer = \"x\" # replace x with a, b, c, or d \n",
|
||||
"ge_par_check(answer)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "1169c86e",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"ge_par_why()"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "74491f64",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Data partition\n",
|
||||
"\n",
|
||||
"Let's start considering a row-wise block partition, as we did in previous algorithms.\n",
|
||||
"\n",
|
||||
"In the figure below, we use different colors to illustrate which entries are assigned to a CPU. All entries with the same color are assigned to the same CPU."
|
||||
]
|
||||
},
|
||||
{
|
||||
"attachments": {
|
||||
"g31767.png": {
|
||||
"image/png": "iVBORw0KGgoAAAANSUhEUgAAArUAAAHoCAYAAABXWBf1AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAewgAAHsIBbtB1PgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAACAASURBVHic7N13nB11vf/x1/ecs9l0UiCEhC5FShAISBGkiHAFERW7KAq2a7lYsF69ev1ZLhYUwYIoYi+ABRVFQAWU3gnSpJsQCKRnk83uOd/fH7PBzdnZzfaZb3g9H4/zgP3Ome98dmZ289453/lO4GnxauAAJEmS8p0D4W1FFyHlqXT9dyIsm1hoJZIkqeQemgFUi65CyhMg/h2WTYLa7jAhFF2QJEkqq0URpt4AtXshvKHoaqTuAsRYdBGSJCkp8yDMKboIqbtac8PWu8EWzyqilL7d9If/iXNf9OnSXkm+7bIv1HfY94TqhE1mFV1Krntv/AGTp23HzO0PLrqUXIsX3M7CB/5e3/Wg/yztx1plPwdv//OX6tvt+YrqpGnbFl1Krvtv+Rmt4zdtbLnzEZUNv3v0LXvyPh658+LGnENOKWV9kJ2De//Hp0II5Szxjr9+pb71bi+ubrLZjkWXkuuhO35FqLQ0ttntxaXcgWvXLGfelV9r7H3kx0tX3wO3wKJHi65C6luPULvFDjDn0AIq2YBbLzuLOYd9uugyenXX389p7LjvkdXps8sZah9/+CJmbncQux9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RyRPAl4HdILy7awqtEgt3A/sAHwQeG0QHfwIOgfA2CO3DWlqBHH4gSZI2AuEO4I0Q3wX8B3AQ2QMKtie7WrnuQt5SsuEF9wLXAteQjbtd29xjH74B/L5p+80PRxhhYSXwJYhnko2XPZjse96KbJzxRLKr14u7XncAVwKXQ7hzdGvt4QzgwmHs706AAHG9gzBu0un1sRO/V7pxJKuWPDpmwtStBnLCjaq2ZQtaWsdPa1RbxpZu3wG0LV/YUmsZy5hxUzqKriVPR/uKSkf7yur4yVuUsj5I4BxcvqBl7PhNG5XamFKeg6uW/Ks2ZtwmoWXspFIe4441Kyod7Stq4zeZVdpjvGrJo2MmTNmqg9DjyUKl0LZsQcuYcVMatTHjS3kOrlmxqBYqldA6YXopz8HYaFRWL3+sOn7K7NLVt2rpZ2prVx/X/dPdeRDmFFbQoMQa0IDQ1zCFjUhsgVC6c2kk9bhSu+2cl1S323PPahHF9OWyc1/OAS87Y0zRdfTmyp+e1Njj8A9VJ2/6rNLtO4CbL/k007bYnW33eHkp9+HC+6/iodsvbOz/sq+Wsj6Ay753fLnPwZ+d3Njt4PdUp8zctbTn4OTp28Ud9nlDKffhokeu597rvtco8zG+7HvHx/1f9pWWEMo5cuzv5/9n/dkHvq06ffZepTwH77zya1RrYxvPPvBtpTzG7W2LuebC98QynoO3/3kX/nV30VUM1cYxbrT/nlmBFnJC7eTNdmDWjs03ERYvVCpx1o6Hl3a6jUqlpb7Z1vtWps/es+hScv3j799g8qY7MGvHw4suJVd722Lm33dZfdaOh5fzX2uyjzXKfA7WamPr07fcu7L5dgcWXUqu+274PpOmbd+YtePhpQw8EHng1vMb5T4HA7N2OIxQKecurLa0NqbNek61rL9nHrr9Qqot40t7jNuWLYBQKeXPyD9vLLoCacNK+YMtSZIkDYShVpIkSckz1EqSJCl5hlpJkiQlz1ArSZKk5BlqJUmSlDxDLine truncated
|
||||
}
|
||||
},
|
||||
"cell_type": "markdown",
|
||||
"id": "7460b0af",
|
||||
"metadata": {},
|
||||
"source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WXspFIe4441Kyod7Stq4zeZVdpjvGrJo2MmTNmqg9DjyUKl0LZsQcuYcVMatTHjS3kOrlmxqBYqldA6YXopz8HYaFRWL3+sOn7K7NLVt2rpZ2prVx/X/dPdeRDmFFbQoMQa0IDQ1zCFjUhsgVC6c2kk9bhSu+2cl1S323PPahHF9OWyc1/OAS87Y0zRdfTmyp+e1Njj8A9VJ2/6rNLtO4CbL/k007bYnW33eHkp9+HC+6/iodsvbOz/sq+Wsj6Ay753fLnPwZ+d3Njt4PdUp8zctbTn4OTp28Ud9nlDKffhokeu597rvtco8zG+7HvHx/1f9pWWEMo5cuzv5/9n/dkHvq06ffZepTwH77zya1RrYxvPPvBtpTzG7W2LuebC98QynoO3/3kX/nV30VUM1cYxbrT/nlmBFnJC7eTNdmDWjs03ERYvVCpx1o6Hl3a6jUqlpb7Z1vtWps/es+hScv3j799g8qY7MGvHw4suJVd722Lm33dZfdaOh5fzX2uyjzXKfA7WamPr07fcu7L5dgcWXUqu+274PpOmbd+YtePhpQw8EHng1vMb5T4HA7N2OIxQKecurLa0NqbNek61rL9nHrr9Qqot40t7jNuWLYBQKeXPyD9vLLoCacNK+YMtSZIkDYShVpIkSckz1EqSJCl5hlpJkiQlzLine truncated
|
||||
"</div>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "3ebddda1",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Load imbalance\n",
|
||||
"\n",
|
||||
"Each CPU will be on charge of updating the entries stored locally. However, this algorithm is a bit different than the previous ones. At iteration $k$ only a subset of the entries in the matrix `B` are updated, i.e. only the entries in the bottom right block `B[k:end,k:end]` are updated. This block is illustrated in a darker color in the next figure for $k=6$. "
|
||||
]
|
||||
},
|
||||
{
|
||||
"attachments": {
|
||||
"fig-asp-data-updated-2.png": {
|
||||
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAtcAAAJNCAYAAAD6c1l4AAAACXBIWXMAAB7CAAAewgFu0HU+AAAAGXRFW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NmrsG5bwI/FCuZMSoaU7ftJ+72Dskzq2cULs3/PLKss3lVwTWq1eKlp/AVUS66J1OwjdC4r356Zllj0kFudSYIsatzMrtm7LkmtCMv9G0bZebLK+wU6uz2r0eAC+EFv3uxWWTUqu5wLHAh2t+nyibR8X2+4fqyw/qMk14U5S8bJLgJk1bueHsXVvqrJ8PLm+F9i8hu3Ev/cOfLCFn1lNyTXhoc/4OfrjdWwn8+Sa0PCzOLbO16jvORMnnFtrOkdWiefCWL0Vn10baa+R2OcawsEYHwZtjZS3cWXs/cyU60/TUIq1GV/x2vu4ngIUD2G1NvDOMsseT2m/6Uu8xtERBtFgf8ZHUDriyOnu/lQtK3oYiu8HRUXGwBkJ+30p9v6b7v5QzVEOnmmEYer6VevWlRtmtirh4r/fQ8DZdVTxY8JFT79495hK/k64E3e+t37Cr7yfBz8Ve/89d3+2xnW/Qug+0m8XM9uqjm3v4zWMoexhxJq/xIoz7XdtZkcSEsH+c7QDx7r7j7OLqiFTCV28ip1Kfc+ZQOiCeouZVRwRqAbxc9jGTdY3rIy4PtcA7u5mtpTSLine truncated
|
||||
}
|
||||
},
|
||||
"cell_type": "markdown",
|
||||
"id": "d083cd53",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<div>\n",
|
||||
"<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAtcAAAJNCAYAAAD6c1l4AAAACXBIWXMAAB7CAAAewgFu0HU+AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAIABJREFUeJzs3XecJFW5//HPM2HzwgZYWNIui2RYQBEEJEgSEOUqGa7+RERR1GtCQQRRxABcuagIgooBRBRFDCASJCNJySCZJe4uYfPupH5+f5watrumOldP1cx8369Xv6DPVJ16trq6+qlTp84xd0dEsmNmy4Ex0dvl7j4uy3hGCjObBTxVVHSvu2+bQRwbAncCk4uKbwP2dPcVgx2PyFBhZt8ETioqOs7df5RVPHljZqOAtYCxQAFYCrzi7r01rPsN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/cyU60/TUIq1GV/x2vu4ngIUD2G1NvDOMsseT2m/6Uu8xtERBtFgf8ZHUDriyOnu/lQtK3oYiu8HRUXGwBkJ+30p9v6b7v5QzVEOnmmEYer6VevWlRtmtirh4r/fQ8DZdVTxY8JFT79495hK/k64E3e+t37Cr7yfBz8Ve/89d3+2xnW/Qug+0m8XM9uqjm3v4zWMoexhxJq/xIoz7XdtZkcSEsH+c7QDx7r7j7OLqiFTCV28ip1Kfc+ZQOiCeouZVRwRqAbxc9jGTLine truncated
|
||||
"</div>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "e341fda6",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"In this particular example CPU 1 will not have any work to do at iteration $k=6$ and it will be waiting, while other CPUs are computing. In general, CPUs containing rows previous to row $k$ will have less work to do than CPUs containing rows after row $k$. This will worsen as the value of $k$ increases. At some point, only the last CPU will have work to do and the others will idle. \n",
|
||||
"\n",
|
||||
"<div class=\"alert alert-block alert-info\">\n",
|
||||
"<b>Definition:</b> *Load imbalance*: is the problem when work is not equally distributed over all processes and consequently some processes do more work than others.\n",
|
||||
"</div>\n",
|
||||
"\n",
|
||||
"Having processors waiting for others is a waste of computational resources and affects negatively parallel speedups. The optimal speedup (speedup equal to the number of processors) assumes that the work is perfectly parallel and that it is evenly distributed. If there is load imbalance, the last assumption is not true anymore and the speedup will be suboptimal.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "51498a44",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Fixing load imbalance\n",
|
||||
"\n",
|
||||
"In this application, is relatively easy to fix the load imbalance problem. We know in advance which data is going to be processes at each CPU and we can design a more clever data partition.\n",
|
||||
"\n",
|
||||
"We can consider row-wise cyclic partition to fix the problem. See figure below. In this case, the CPUs will have less work as the value of $k$ increases, but amount of work will be better distributed than with the previous row block partition."
|
||||
]
|
||||
},
|
||||
{
|
||||
"attachments": {
|
||||
"fig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1oXTwAuwGQnqmAJv3s4NjvvQxPFvLbN93QlqHbHekTj3wU08V5oJ6gPA+yo8168T+04HBhXZdmMS7UiB/ar4f+V9gTfpdU/eyK8ss31dCSrhl/WE2P7zgE0q3NcIJV5lv+QIpbzx7RZTYZssQket+L7NTlDj7WPnAB11HKvVCepPE8f4RRX7fjmx799KbFsoQZ1J6BhS8PPXwPfnwMR57ymzfUsTVEKtV/yH8xIqLIwgNLGJn+d5wEpsn0xQn63kcxV9dpNtY49p4ntWUYJK+LGSTDBPqPJcWUhQk22/f00oma/mPBNoTB71s8RxD2j0+9uObVBx97cJvwbjklWz9UpW363T4OM3UrJaap00gmiBk7zyoThOIVR554wkv4lA3NHktyO9zN2vrCG+Zmr19bgf+b3Mz3D35yvZ0cPdLzm6QXLmpJwfJpbP8HTaZJUUjS4wNrbqf96CUTMaIaou/k5s1WuEz0el/k3+DEnVVAfeBXzA3c/y5k9PfS3hizZnnSafr1rfJr+K+S/uXumA67+irykThB/VxT5ThRxQyecq+uxelVhdTZv8hjOzTxKaAMV7vh/vJUaAybBkG/ujCbUJ1VgXGB+NTlSP5Ag3G9V5vH7arg1qzDzyGxtX3Xi/FHefZWYL6WuLWmxYnSx4O7E8KpUoMsTDsGQ3k98ecltC25ulLine truncated
|
||||
}
|
||||
},
|
||||
"cell_type": "markdown",
|
||||
"id": "b90252f1",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<div>\n",
|
||||
"<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAqgAAAJJCAYAAABmoMV7AAAACXBIWXMAAB7CAAAewgFu0HU+AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAIABJREFUeJzs3Xe4HGXZx/HvfU46LSSBECB0pGpoggpIUwSVooCogIiK2EVAFFBBBF8QCyiK2BBBOtJbkN47SG8hBAKkh/TklPv945nNmZ2zvc2E/X2ua6/szJlyZ3d29t6nmrsjIukxs5nAyrlld7cUw2kbZrYKMD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2j0+9uObVBx97cJvwbjklWz9UpW363T4OM3UrJaap00gmiBk7zyoThOIVR554wkv4lA3NHktyO9zN2vrCG+Zmr19bgf+b3Mz3D35yvZ0cPdLzm6QXLmpJwfJpbP8HTaZJUUjS4wNrbqf96CUTMaIaou/k5s1WuEz0el/k3+DEnVVAfeBXzA3c/y5k9PfS3hizZnnSafr1rfJr+K+S/uXumA67+irykThB/VxT5ThRxQyecq+uxelVhdTZv8hjOzTxKaAMV7vh/vJUaAybBkG/ujCbUJ1VgXGB+NTlSP5Ag3G9V5vH7arg1qzDzyGxtX3Xi/FHefZWYL6WuLWmxYnSx4O7E8KpUoMLine truncated
|
||||
"</div>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "1c9e4c8a",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Static vs dynamic load balancing\n",
|
||||
"\n",
|
||||
"Load balancing is the process of distributing work to processors uniformly with the aim to efficiently exploit a parallel system. There are two key forms of load balancing: Static and dynamic load balancing.\n",
|
||||
"\n",
|
||||
"- **Static load balancing** the work distribution strategy is based on prior information of the algorithm and it does not depend on runtime values.\n",
|
||||
"- **Dynamic load balancing** the work distribution strategy is based on runtime values.\n",
|
||||
"\n",
|
||||
"Static load balancing is often used in algorithms for which the load distribution is known in advance and it does not depend on runtime values. On the other hand, dynamic load balancing is often needed in problems in which the work distribution cannot be predicted in advance and depends on runtime values.\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"<div class=\"alert alert-block alert-success\">\n",
|
||||
"<b>Question:</b> Using a cyclic partition for Gaussian elimination, is a form of static or dynamic load balancing?\n",
|
||||
"</div>\n",
|
||||
"\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "a6741a25",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"ge_lb_answer()"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "e151fb8d",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Data dependencies\n",
|
||||
"\n",
|
||||
"Using a cyclic partition, we managed to distribute the work uniformly. But we still need to study the data dependencies in order to implement this algorithm in parallel efficiently.\n",
|
||||
"\n",
|
||||
"Look again to the algorithm\n",
|
||||
"\n",
|
||||
"```julia\n",
|
||||
"n,m = size(B)\n",
|
||||
"for k in 1:n\n",
|
||||
" for t in (k+1):m\n",
|
||||
" B[k,t] = B[k,t]/B[k,k]\n",
|
||||
" end\n",
|
||||
" B[k,k] = 1\n",
|
||||
" for i in (k+1):n \n",
|
||||
" for j in (k+1):m\n",
|
||||
" B[i,j] = B[i,j] - B[i,k]*B[k,j]\n",
|
||||
" end\n",
|
||||
" B[i,k] = 0\n",
|
||||
" end\n",
|
||||
"end\n",
|
||||
"```\n",
|
||||
"\n",
|
||||
"Note that all updates on the loop over i and j we do the following: \n",
|
||||
"\n",
|
||||
"```julia\n",
|
||||
"B[i,j] = B[i,j] - B[i,k]*B[k,j]\n",
|
||||
"```\n",
|
||||
"\n",
|
||||
"As we are using row-wise partitions, the CPU that updates `B[i,j]` will also have entry `B[i,k]` in memory (both are in the same row). However, `B[k,j]` is in another row and it might be located on another processor. We might need to communicate `B[k,j]` for `j=(k+1):m`. This corresponds to the cells marked in red in the figure below. These red entries are the data dependencies of this algorithm. The owner of these entries has to send them to the other processors. This is very similar to the communication pattern seen in previous notebook for Floyd's algorithm. There is a key difference however. In the current case, we do not need to send the full row, only the entries beyond column $k$ (the red cells in the figure).\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"attachments": {
|
||||
"g27851.png": {
|
||||
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAzAAAAJsCAYAAAAiM0YjAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAewgAAHsIBbtB1PgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAACAASURBVHic7N15nBx1nf/xV/X0zOS+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+nAA0mHGEZv0gGG8RBwStIhargIuDzpEDUcTlQAptlWoiIhrW4Czk86xPbCaWXvFUIIT006lbLPa2AkSZIkZYYFjCRJkqTMsICRJEmSlBkWMJIkSZIyw2mUpeHtDOzB0wX/DUQzm0mSJKnFLGCk7b2UaD79g4mm9J5X9vgBwK2tDiVJkiQLGKmS/yVal0CSJEkp4zUwUnVbiU4X+xouJSxJkpQKjsBI23sX8DfgLp5edflyYPfEEkmSJAmwgJEq+WHSASRJklSZp5BJkiRJygwLGEmSJEmZYQEjSZIkKTMsYCRJkiRlhgWMJEmSpMywgJEkSZKUGRYwkiRJkjLDAkaSJElSZljASJIkScoMCxhJkiRJmWEBI0mSJCkzLGAkSZIkZYYFjCRJkqTMsICRJEmSlBn5pANIKbQUeG/Zvkkl968B+ku2Q2Bms0NJkiTJAkaqZDwwvcbjU8q2wyZmkSRJUgkLGGl7VzJ0hGU4FjCSJEktYgEjbe+3AzdJkiSljBfxS5IkScoMCxhJkiRJmWEBI0mSJCkzLGAkSZIkZYYFLine truncated
|
||||
}
|
||||
},
|
||||
"cell_type": "markdown",
|
||||
"id": "0050b6c4",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<div>\n",
|
||||
"<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAzAAAAJsCAYAAAAiM0YjAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAewgAAHsIBbtB1PgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAACAASURBVHic7N15nBx1nf/xV/X0zOS+LxIIwYRDDkFuFBFUUFbE+wQPFBRXXQVcL1xss3ggrgfeeKKuq7grIh4/BeUSOQxBbgEFQgIkAZJJyDVX1++PmoGeTnfPVKe7q2rm9Xw8+pGu6u936t09k5n+9Lfq+w2QJI12eeCsku2/A5cO3O8EXgG8GdgD2BkoAvcDvwMuAB6u8nWfBZwKPB94xsDXWgvcBPwQ+GUjn4QkSZKksWE8EJbcfjqwf1/g7r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Lp5edflyYPfEEkmSJAmwgJEq+WHSASRJklSZp5BJkiRJygwLGEmSJEmZYQEjSZIkKTMsYCRJkiRlhgWMJEmSpMywgJEkSZKUGRYwkiRJkjLDAkaSJElSZljASJIkScoMCxhJkiRJmWEBI0mSJCkzLGAkSZIkZYYFjCRJkqTMsICRJEmSlBn5pANIKbQUeG/Zvkkl968B+ku2Q2Bms0NJkiTJAkaqZDwwvcbjU8q2wyZmkSRJUgkLGGl7VzJ0hGU4FjCSJEktYgEjbe+3AzdJkiSljBfxS5IkScoMCxhJkiRJmWEBILine truncated
|
||||
"</div>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "cf189776",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Parallel implementation\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"At iteration $k$,\n",
|
||||
"\n",
|
||||
"1. The CPU owning row $k$ does the loop over $t$ to update row $k$.\n",
|
||||
"2. The CPU owning row $k$ sets $B_{kk} = 1$.\n",
|
||||
"2. This CPU sends the red cells in figure above to the other processors.\n",
|
||||
"3. All processors receive the updated values in row $k$ and do the loop over i and j locally (blue cells).\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"As you probably see, the parallel implementation of this method is closely related to Floyd's algorithm. But there are some differences. \n",
|
||||
"\n",
|
||||
"1. The process that owns row $k$ updates its values before sending them.\n",
|
||||
"2. We do not send the full row $k$, only the entries beyond column $k$.\n",
|
||||
"3. We need a cyclic partition to balance the load properly.\n",
|
||||
"\n",
|
||||
"A key similarity between the two algorithms, however, is that they both suffer from synchronization problems. We need to make sure that the rows arrive in the right order. The strategies discussed for Floyd's algorithm also apply in this current case.\n",
|
||||
"\n",
|
||||
"The actual implementation of the parallel algorithm is left as an open exercise."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "866824c6",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Conclusion\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"We studied the parallelization of an algorithm that leads to load imbalance. We fixed the problem using a cyclic partition. This is a form of static load balancing since we were able to distribute the load in advance without using runtime values. This is opposed to dynamic load balancing which can schedule loads flexibly during runtime. Note however that cyclic partitioning is not suitable for all communication patterns. For example, it can lead to a large communication overhead in the parallel Jacobi method, since the computation of each value depends on its neighboring elements.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "f60d9ea0",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# License\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"This notebook is part of the course [Programming Large Scale Parallel Systems](https://www.francescverdugo.com/XM_40017) at Vrije Universiteit Amsterdam and may be used under a [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) license."
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Julia 1.11.6",
|
||||
"language": "julia",
|
||||
"name": "julia-1.11"
|
||||
},
|
||||
"language_info": {
|
||||
"file_extension": ".jl",
|
||||
"mimetype": "application/julia",
|
||||
"name": "julia",
|
||||
"version": "1.11.6"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 5
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Gaussian elimination · XM_40017</title><meta name="title" content="Gaussian elimination · XM_40017"/><meta property="og:title" content="Gaussian elimination · XM_40017"/><meta property="twitter:title" content="Gaussian elimination · XM_40017"/><meta name="description" content="Documentation for XM_40017."/><meta property="og:description" content="Documentation for XM_40017."/><meta property="twitter:description" content="Documentation for XM_40017."/><meta property="og:url" content="https://fverdugo.github.io/XM_40017/LEQ/"/><meta property="twitter:url" content="https://fverdugo.github.io/XM_40017/LEQ/"/><link rel="canonical" href="https://fverdugo.github.io/XM_40017/LEQ/"/><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../search_index.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script><link href="../assets/favicon.ico" rel="icon" type="image/x-icon"/><script src="../assets/iframeResizer.min.js"></script><link href="../assets/custom.css" rel="stylesheet" type="text/css"/></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="../"><img src="../assets/logo.png" alt="XM_40017 logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../">XM_40017</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li><a class="tocitem" href="../getting_started_with_julia/">Getting started</a></li><li><span class="tocitem">Notebooks</span><ul><li><a class="tocitem" href="../julia_basics/">Julia Basics</a></li><li><a class="tocitem" href="../julia_async/">Asynchronous programming in Julia</a></li><li><a class="tocitem" href="../julia_distributed/">Distributed computing in Julia</a></li><li><a class="tocitem" href="../matrix_matrix/">Matrix-matrix multiplication</a></li><li><a class="tocitem" href="../julia_mpi/">MPI (point-to-point)</a></li><li><a class="tocitem" href="../mpi_collectives/">MPI (collectives)</a></li><li><a class="tocitem" href="../jacobi_method/">Jacobi method</a></li><li><a class="tocitem" href="../asp/">All pairs of shortest paths</a></li><li class="is-active"><a class="tocitem" href>Gaussian elimination</a></li><li><a class="tocitem" href="../tsp/">Traveling salesperson problem</a></li></ul></li><li><a class="tocitem" href="../solutions_for_all_notebooks/">Solutions</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#Line truncated
|
||||
<header class="admonition-header">Tip</header>
|
||||
<div class="admonition-body">
|
||||
<ul>
|
||||
<li>
|
||||
Download this notebook and run it locally on your machine [highly recommended]. Click <a href="https://www.francescverdugo.com/XM_40017/dev/LEQ.ipynb" download>here</a>.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div><iframe id="notebook" src="../LEQ_src/" style="width:100%"></iframe>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function(){
|
||||
var myIframe = document.getElementById("notebook");
|
||||
iFrameResize({log:true}, myIframe);
|
||||
});
|
||||
</script></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../asp/">« All pairs of shortest paths</a><a class="docs-footer-nextpage" href="../tsp/">Traveling salesperson problem »</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="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.14.1 on <span class="colophon-date" title="Wednesday 24 September 2025 05:37">Wednesday 24 September 2025</span>. Using Julia version 1.11.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
|
||||
@@ -1,17 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>All pairs of shortest paths · XM_40017</title><meta name="title" content="All pairs of shortest paths · XM_40017"/><meta property="og:title" content="All pairs of shortest paths · XM_40017"/><meta property="twitter:title" content="All pairs of shortest paths · XM_40017"/><meta name="description" content="Documentation for XM_40017."/><meta property="og:description" content="Documentation for XM_40017."/><meta property="twitter:description" content="Documentation for XM_40017."/><meta property="og:url" content="https://fverdugo.github.io/XM_40017/asp/"/><meta property="twitter:url" content="https://fverdugo.github.io/XM_40017/asp/"/><link rel="canonical" href="https://fverdugo.github.io/XM_40017/asp/"/><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../search_index.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script><link href="../assets/favicon.ico" rel="icon" type="image/x-icon"/><script src="../assets/iframeResizer.min.js"></script><link href="../assets/custom.css" rel="stylesheet" type="text/css"/></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="../"><img src="../assets/logo.png" alt="XM_40017 logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../">XM_40017</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li><a class="tocitem" href="../getting_started_with_julia/">Getting started</a></li><li><span class="tocitem">Notebooks</span><ul><li><a class="tocitem" href="../julia_basics/">Julia Basics</a></li><li><a class="tocitem" href="../julia_async/">Asynchronous programming in Julia</a></li><li><a class="tocitem" href="../julia_distributed/">Distributed computing in Julia</a></li><li><a class="tocitem" href="../matrix_matrix/">Matrix-matrix multiplication</a></li><li><a class="tocitem" href="../julia_mpi/">MPI (point-to-point)</a></li><li><a class="tocitem" href="../mpi_collectives/">MPI (collectives)</a></li><li><a class="tocitem" href="../jacobi_method/">Jacobi method</a></li><li class="is-active"><a class="tocitem" href>All pairs of shortest paths</a></li><li><a class="tocitem" href="../LEQ/">Gaussian elimination</a></li><li><a class="tocitem" href="../tsp/">Traveling salesperson problem</a></li></ul></li><li><a class="tocitem" href="../solutions_for_all_notebooks/">Solutions</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documeLine truncated
|
||||
<header class="admonition-header">Tip</header>
|
||||
<div class="admonition-body">
|
||||
<ul>
|
||||
<li>
|
||||
Download this notebook and run it locally on your machine [highly recommended]. Click <a href="https://www.francescverdugo.com/XM_40017/dev/asp.ipynb" download>here</a>.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div><iframe id="notebook" src="../asp_src/" style="width:100%"></iframe>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function(){
|
||||
var myIframe = document.getElementById("notebook");
|
||||
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="../LEQ/">Gaussian elimination »</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="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.14.1 on <span class="colophon-date" title="Wednesday 24 September 2025 05:37">Wednesday 24 September 2025</span>. Using Julia version 1.11.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
|
||||
@@ -1 +0,0 @@
|
||||
html.theme--catppuccin-frappe .pagination-previous,html.theme--catppuccin-frappe .pagination-next,html.theme--catppuccin-frappe .pagination-link,html.theme--catppuccin-frappe .pagination-ellipsis,html.theme--catppuccin-frappe .file-cta,html.theme--catppuccin-frappe .file-name,html.theme--catppuccin-frappe .select select,html.theme--catppuccin-frappe .textarea,html.theme--catppuccin-frappe .input,html.theme--catppuccin-frappe #documenter .docs-sidebar form.docs-search>input,html.theme--catppuccin-frappe .button{-moz-appearance:none;-webkit-appearance:none;align-items:center;border:1px solid transparent;border-radius:.4em;box-shadow:none;display:inline-flex;font-size:1rem;height:2.5em;justify-content:flex-start;line-height:1.5;padding-bottom:calc(0.5em - 1px);padding-left:calc(0.75em - 1px);padding-right:calc(0.75em - 1px);padding-top:calc(0.5em - 1px);position:relative;vertical-align:top}html.theme--catppuccin-frappe .pagination-previous:focus,html.theme--catppuccin-frappe .pagination-next:focus,html.theme--catppuccin-frappe .pagination-link:focus,html.theme--catppuccin-frappe .pagination-ellipsis:focus,html.theme--catppuccin-frappe .file-cta:focus,html.theme--catppuccin-frappe .file-name:focus,html.theme--catppuccin-frappe .select select:focus,html.theme--catppuccin-frappe .textarea:focus,html.theme--catppuccin-frappe .input:focus,html.theme--catppuccin-frappe #documenter .docs-sidebar form.docs-search>input:focus,html.theme--catppuccin-frappe .button:focus,html.theme--catppuccin-frappe .is-focused.pagination-previous,html.theme--catppuccin-frappe .is-focused.pagination-next,html.theme--catppuccin-frappe .is-focused.pagination-link,html.theme--catppuccin-frappe .is-focused.pagination-ellipsis,html.theme--catppuccin-frappe .is-focused.file-cta,html.theme--catppuccin-frappe .is-focused.file-name,html.theme--catppuccin-frappe .select select.is-focused,html.theme--catppuccin-frappe .is-focused.textarea,html.theme--catppuccin-frappe .is-focused.input,html.theme--catppuccin-frappe #documenter .docs-sidebar form.docs-search>input.is-focused,html.theme--catppuccin-frappe .is-focused.button,html.theme--catppuccin-frappe .pagination-previous:active,html.theme--catppuccin-frappe .pagination-next:active,html.theme--catppuccin-frappe .pagination-link:active,html.theme--catppuccin-frappe .pagination-ellipsis:active,html.theme--catppuccin-frappe .file-cta:active,html.theme--catppuccin-frappe .file-name:active,html.theme--catppuccin-frappe .select select:active,html.theme--catppuccin-frappe .textarea:active,html.theme--catppuccin-frappe .input:active,html.theme--catppuccin-frappe #documenter .docs-sidebar form.docs-search>input:active,html.theme--catppuccin-frappe .button:active,html.theme--catppuccin-frappe .is-active.pagination-previous,html.theme--catppuccin-frappe .is-active.pagination-next,html.theme--catppuccin-frappe .is-active.pagination-link,html.theme--catppuccin-frappe .is-active.pagination-ellipsis,html.theme--catppuccin-frappe .is-active.file-cta,html.theme--catppuccin-frappe .is-active.file-name,html.theme--catppuccin-frappe .select select.is-active,html.theme--catppuccin-frappe .is-active.textarea,html.theme--catppuccin-frappe .is-active.input,html.theme--catppuccin-frappe #documenter .docs-sidebar form.docs-search>input.is-active,html.theme--catppuccin-frappe .is-active.button{outline:none}html.theme--catppuccin-frappe .pagination-previous[disabled],html.theme--catppuccin-frappe .pagination-next[disabled],html.theme--catppuccin-frappe .pagination-link[disabled],html.theme--catppuccin-frappe .pagination-ellipsis[disabled],html.theme--catppuccin-frappe .file-cta[disabled],html.theme--catppuccin-frappe .file-name[disabled],html.theme--catppuccin-frappe .select select[disabled],html.theme--catppuccin-frappe .textarea[disabled],html.theme--catppuccin-frappe .input[disabled],html.theme--catppuccin-frappe #documenter .docs-sidebar form.docs-search>input[disabled],html.theme--catppuccin-frappe .button[disabled],fieldset[disabled] html.theme--catppuccin-frappe .pagination-previous,html.theme--catppuccin-frappe fieldset[disabled] .pagination-previous,fieldset[disabled] html.theme--catppuccin-frappe .pagination-next,html.theme--catppuccin-frappe fieldset[disabled] .pagination-next,fieldset[disabled] html.theme--catppuccin-frappe .pagination-link,html.theme--catppuccin-frappe fieldset[disabled] .pagination-link,fieldset[disabled] html.theme--catppuccin-frappe .pagination-ellipsis,html.theme--catppuccin-frappe fieldset[disabled] .pagination-ellipsis,fieldset[disabled] html.theme--catppuccin-frappe .file-cta,html.theme--catppuccin-frappe fieldset[disabled] .file-cta,fieldset[disabled] html.theme--catppuccin-frappe .file-name,html.theme--catppuccin-frappe fieldset[disabled] .file-name,fieldset[disabled] html.theme--catppuccin-frappe .select select,fieldset[disabled] html.theme--catppuccin-frappe .textarea,fieldset[disabled] html.theme--catppuccin-frappe .input,fieldset[disabled] html.theme--catppuccin-frappe #documentLine truncated
|
||||
@@ -1 +0,0 @@
|
||||
html.theme--catppuccin-latte .pagination-previous,html.theme--catppuccin-latte .pagination-next,html.theme--catppuccin-latte .pagination-link,html.theme--catppuccin-latte .pagination-ellipsis,html.theme--catppuccin-latte .file-cta,html.theme--catppuccin-latte .file-name,html.theme--catppuccin-latte .select select,html.theme--catppuccin-latte .textarea,html.theme--catppuccin-latte .input,html.theme--catppuccin-latte #documenter .docs-sidebar form.docs-search>input,html.theme--catppuccin-latte .button{-moz-appearance:none;-webkit-appearance:none;align-items:center;border:1px solid transparent;border-radius:.4em;box-shadow:none;display:inline-flex;font-size:1rem;height:2.5em;justify-content:flex-start;line-height:1.5;padding-bottom:calc(0.5em - 1px);padding-left:calc(0.75em - 1px);padding-right:calc(0.75em - 1px);padding-top:calc(0.5em - 1px);position:relative;vertical-align:top}html.theme--catppuccin-latte .pagination-previous:focus,html.theme--catppuccin-latte .pagination-next:focus,html.theme--catppuccin-latte .pagination-link:focus,html.theme--catppuccin-latte .pagination-ellipsis:focus,html.theme--catppuccin-latte .file-cta:focus,html.theme--catppuccin-latte .file-name:focus,html.theme--catppuccin-latte .select select:focus,html.theme--catppuccin-latte .textarea:focus,html.theme--catppuccin-latte .input:focus,html.theme--catppuccin-latte #documenter .docs-sidebar form.docs-search>input:focus,html.theme--catppuccin-latte .button:focus,html.theme--catppuccin-latte .is-focused.pagination-previous,html.theme--catppuccin-latte .is-focused.pagination-next,html.theme--catppuccin-latte .is-focused.pagination-link,html.theme--catppuccin-latte .is-focused.pagination-ellipsis,html.theme--catppuccin-latte .is-focused.file-cta,html.theme--catppuccin-latte .is-focused.file-name,html.theme--catppuccin-latte .select select.is-focused,html.theme--catppuccin-latte .is-focused.textarea,html.theme--catppuccin-latte .is-focused.input,html.theme--catppuccin-latte #documenter .docs-sidebar form.docs-search>input.is-focused,html.theme--catppuccin-latte .is-focused.button,html.theme--catppuccin-latte .pagination-previous:active,html.theme--catppuccin-latte .pagination-next:active,html.theme--catppuccin-latte .pagination-link:active,html.theme--catppuccin-latte .pagination-ellipsis:active,html.theme--catppuccin-latte .file-cta:active,html.theme--catppuccin-latte .file-name:active,html.theme--catppuccin-latte .select select:active,html.theme--catppuccin-latte .textarea:active,html.theme--catppuccin-latte .input:active,html.theme--catppuccin-latte #documenter .docs-sidebar form.docs-search>input:active,html.theme--catppuccin-latte .button:active,html.theme--catppuccin-latte .is-active.pagination-previous,html.theme--catppuccin-latte .is-active.pagination-next,html.theme--catppuccin-latte .is-active.pagination-link,html.theme--catppuccin-latte .is-active.pagination-ellipsis,html.theme--catppuccin-latte .is-active.file-cta,html.theme--catppuccin-latte .is-active.file-name,html.theme--catppuccin-latte .select select.is-active,html.theme--catppuccin-latte .is-active.textarea,html.theme--catppuccin-latte .is-active.input,html.theme--catppuccin-latte #documenter .docs-sidebar form.docs-search>input.is-active,html.theme--catppuccin-latte .is-active.button{outline:none}html.theme--catppuccin-latte .pagination-previous[disabled],html.theme--catppuccin-latte .pagination-next[disabled],html.theme--catppuccin-latte .pagination-link[disabled],html.theme--catppuccin-latte .pagination-ellipsis[disabled],html.theme--catppuccin-latte .file-cta[disabled],html.theme--catppuccin-latte .file-name[disabled],html.theme--catppuccin-latte .select select[disabled],html.theme--catppuccin-latte .textarea[disabled],html.theme--catppuccin-latte .input[disabled],html.theme--catppuccin-latte #documenter .docs-sidebar form.docs-search>input[disabled],html.theme--catppuccin-latte .button[disabled],fieldset[disabled] html.theme--catppuccin-latte .pagination-previous,html.theme--catppuccin-latte fieldset[disabled] .pagination-previous,fieldset[disabled] html.theme--catppuccin-latte .pagination-next,html.theme--catppuccin-latte fieldset[disabled] .pagination-next,fieldset[disabled] html.theme--catppuccin-latte .pagination-link,html.theme--catppuccin-latte fieldset[disabled] .pagination-link,fieldset[disabled] html.theme--catppuccin-latte .pagination-ellipsis,html.theme--catppuccin-latte fieldset[disabled] .pagination-ellipsis,fieldset[disabled] html.theme--catppuccin-latte .file-cta,html.theme--catppuccin-latte fieldset[disabled] .file-cta,fieldset[disabled] html.theme--catppuccin-latte .file-name,html.theme--catppuccin-latte fieldset[disabled] .file-name,fieldset[disabled] html.theme--catppuccin-latte .select select,fieldset[disabled] html.theme--catppuccin-latte .textarea,fieldset[disabled] html.theme--catppuccin-latte .input,fieldset[disabled] html.theme--catppuccin-latte #documenter .docs-sidebar form.docs-search>input,html.theme--catppuccin-latte fieldset[disaLine truncated
|
||||
@@ -1 +0,0 @@
|
||||
html.theme--catppuccin-macchiato .pagination-previous,html.theme--catppuccin-macchiato .pagination-next,html.theme--catppuccin-macchiato .pagination-link,html.theme--catppuccin-macchiato .pagination-ellipsis,html.theme--catppuccin-macchiato .file-cta,html.theme--catppuccin-macchiato .file-name,html.theme--catppuccin-macchiato .select select,html.theme--catppuccin-macchiato .textarea,html.theme--catppuccin-macchiato .input,html.theme--catppuccin-macchiato #documenter .docs-sidebar form.docs-search>input,html.theme--catppuccin-macchiato .button{-moz-appearance:none;-webkit-appearance:none;align-items:center;border:1px solid transparent;border-radius:.4em;box-shadow:none;display:inline-flex;font-size:1rem;height:2.5em;justify-content:flex-start;line-height:1.5;padding-bottom:calc(0.5em - 1px);padding-left:calc(0.75em - 1px);padding-right:calc(0.75em - 1px);padding-top:calc(0.5em - 1px);position:relative;vertical-align:top}html.theme--catppuccin-macchiato .pagination-previous:focus,html.theme--catppuccin-macchiato .pagination-next:focus,html.theme--catppuccin-macchiato .pagination-link:focus,html.theme--catppuccin-macchiato .pagination-ellipsis:focus,html.theme--catppuccin-macchiato .file-cta:focus,html.theme--catppuccin-macchiato .file-name:focus,html.theme--catppuccin-macchiato .select select:focus,html.theme--catppuccin-macchiato .textarea:focus,html.theme--catppuccin-macchiato .input:focus,html.theme--catppuccin-macchiato #documenter .docs-sidebar form.docs-search>input:focus,html.theme--catppuccin-macchiato .button:focus,html.theme--catppuccin-macchiato .is-focused.pagination-previous,html.theme--catppuccin-macchiato .is-focused.pagination-next,html.theme--catppuccin-macchiato .is-focused.pagination-link,html.theme--catppuccin-macchiato .is-focused.pagination-ellipsis,html.theme--catppuccin-macchiato .is-focused.file-cta,html.theme--catppuccin-macchiato .is-focused.file-name,html.theme--catppuccin-macchiato .select select.is-focused,html.theme--catppuccin-macchiato .is-focused.textarea,html.theme--catppuccin-macchiato .is-focused.input,html.theme--catppuccin-macchiato #documenter .docs-sidebar form.docs-search>input.is-focused,html.theme--catppuccin-macchiato .is-focused.button,html.theme--catppuccin-macchiato .pagination-previous:active,html.theme--catppuccin-macchiato .pagination-next:active,html.theme--catppuccin-macchiato .pagination-link:active,html.theme--catppuccin-macchiato .pagination-ellipsis:active,html.theme--catppuccin-macchiato .file-cta:active,html.theme--catppuccin-macchiato .file-name:active,html.theme--catppuccin-macchiato .select select:active,html.theme--catppuccin-macchiato .textarea:active,html.theme--catppuccin-macchiato .input:active,html.theme--catppuccin-macchiato #documenter .docs-sidebar form.docs-search>input:active,html.theme--catppuccin-macchiato .button:active,html.theme--catppuccin-macchiato .is-active.pagination-previous,html.theme--catppuccin-macchiato .is-active.pagination-next,html.theme--catppuccin-macchiato .is-active.pagination-link,html.theme--catppuccin-macchiato .is-active.pagination-ellipsis,html.theme--catppuccin-macchiato .is-active.file-cta,html.theme--catppuccin-macchiato .is-active.file-name,html.theme--catppuccin-macchiato .select select.is-active,html.theme--catppuccin-macchiato .is-active.textarea,html.theme--catppuccin-macchiato .is-active.input,html.theme--catppuccin-macchiato #documenter .docs-sidebar form.docs-search>input.is-active,html.theme--catppuccin-macchiato .is-active.button{outline:none}html.theme--catppuccin-macchiato .pagination-previous[disabled],html.theme--catppuccin-macchiato .pagination-next[disabled],html.theme--catppuccin-macchiato .pagination-link[disabled],html.theme--catppuccin-macchiato .pagination-ellipsis[disabled],html.theme--catppuccin-macchiato .file-cta[disabled],html.theme--catppuccin-macchiato .file-name[disabled],html.theme--catppuccin-macchiato .select select[disabled],html.theme--catppuccin-macchiato .textarea[disabled],html.theme--catppuccin-macchiato .input[disabled],html.theme--catppuccin-macchiato #documenter .docs-sidebar form.docs-search>input[disabled],html.theme--catppuccin-macchiato .button[disabled],fieldset[disabled] html.theme--catppuccin-macchiato .pagination-previous,html.theme--catppuccin-macchiato fieldset[disabled] .pagination-previous,fieldset[disabled] html.theme--catppuccin-macchiato .pagination-next,html.theme--catppuccin-macchiato fieldset[disabled] .pagination-next,fieldset[disabled] html.theme--catppuccin-macchiato .pagination-link,html.theme--catppuccin-macchiato fieldset[disabled] .pagination-link,fieldset[disabled] html.theme--catppuccin-macchiato .pagination-ellipsis,html.theme--catppuccin-macchiato fieldset[disabled] .pagination-ellipsis,fieldset[disabled] html.theme--catppuccin-macchiato .file-cta,html.theme--catppuccin-macchiato fieldset[disabled] .file-cta,fieldset[disabled] html.theme--catppuccin-macchiato .file-name,html.theme--catppuccin-macchiato fieldset[disabled] .file-name,fieLine truncated
|
||||
@@ -1 +0,0 @@
|
||||
html.theme--catppuccin-mocha .pagination-previous,html.theme--catppuccin-mocha .pagination-next,html.theme--catppuccin-mocha .pagination-link,html.theme--catppuccin-mocha .pagination-ellipsis,html.theme--catppuccin-mocha .file-cta,html.theme--catppuccin-mocha .file-name,html.theme--catppuccin-mocha .select select,html.theme--catppuccin-mocha .textarea,html.theme--catppuccin-mocha .input,html.theme--catppuccin-mocha #documenter .docs-sidebar form.docs-search>input,html.theme--catppuccin-mocha .button{-moz-appearance:none;-webkit-appearance:none;align-items:center;border:1px solid transparent;border-radius:.4em;box-shadow:none;display:inline-flex;font-size:1rem;height:2.5em;justify-content:flex-start;line-height:1.5;padding-bottom:calc(0.5em - 1px);padding-left:calc(0.75em - 1px);padding-right:calc(0.75em - 1px);padding-top:calc(0.5em - 1px);position:relative;vertical-align:top}html.theme--catppuccin-mocha .pagination-previous:focus,html.theme--catppuccin-mocha .pagination-next:focus,html.theme--catppuccin-mocha .pagination-link:focus,html.theme--catppuccin-mocha .pagination-ellipsis:focus,html.theme--catppuccin-mocha .file-cta:focus,html.theme--catppuccin-mocha .file-name:focus,html.theme--catppuccin-mocha .select select:focus,html.theme--catppuccin-mocha .textarea:focus,html.theme--catppuccin-mocha .input:focus,html.theme--catppuccin-mocha #documenter .docs-sidebar form.docs-search>input:focus,html.theme--catppuccin-mocha .button:focus,html.theme--catppuccin-mocha .is-focused.pagination-previous,html.theme--catppuccin-mocha .is-focused.pagination-next,html.theme--catppuccin-mocha .is-focused.pagination-link,html.theme--catppuccin-mocha .is-focused.pagination-ellipsis,html.theme--catppuccin-mocha .is-focused.file-cta,html.theme--catppuccin-mocha .is-focused.file-name,html.theme--catppuccin-mocha .select select.is-focused,html.theme--catppuccin-mocha .is-focused.textarea,html.theme--catppuccin-mocha .is-focused.input,html.theme--catppuccin-mocha #documenter .docs-sidebar form.docs-search>input.is-focused,html.theme--catppuccin-mocha .is-focused.button,html.theme--catppuccin-mocha .pagination-previous:active,html.theme--catppuccin-mocha .pagination-next:active,html.theme--catppuccin-mocha .pagination-link:active,html.theme--catppuccin-mocha .pagination-ellipsis:active,html.theme--catppuccin-mocha .file-cta:active,html.theme--catppuccin-mocha .file-name:active,html.theme--catppuccin-mocha .select select:active,html.theme--catppuccin-mocha .textarea:active,html.theme--catppuccin-mocha .input:active,html.theme--catppuccin-mocha #documenter .docs-sidebar form.docs-search>input:active,html.theme--catppuccin-mocha .button:active,html.theme--catppuccin-mocha .is-active.pagination-previous,html.theme--catppuccin-mocha .is-active.pagination-next,html.theme--catppuccin-mocha .is-active.pagination-link,html.theme--catppuccin-mocha .is-active.pagination-ellipsis,html.theme--catppuccin-mocha .is-active.file-cta,html.theme--catppuccin-mocha .is-active.file-name,html.theme--catppuccin-mocha .select select.is-active,html.theme--catppuccin-mocha .is-active.textarea,html.theme--catppuccin-mocha .is-active.input,html.theme--catppuccin-mocha #documenter .docs-sidebar form.docs-search>input.is-active,html.theme--catppuccin-mocha .is-active.button{outline:none}html.theme--catppuccin-mocha .pagination-previous[disabled],html.theme--catppuccin-mocha .pagination-next[disabled],html.theme--catppuccin-mocha .pagination-link[disabled],html.theme--catppuccin-mocha .pagination-ellipsis[disabled],html.theme--catppuccin-mocha .file-cta[disabled],html.theme--catppuccin-mocha .file-name[disabled],html.theme--catppuccin-mocha .select select[disabled],html.theme--catppuccin-mocha .textarea[disabled],html.theme--catppuccin-mocha .input[disabled],html.theme--catppuccin-mocha #documenter .docs-sidebar form.docs-search>input[disabled],html.theme--catppuccin-mocha .button[disabled],fieldset[disabled] html.theme--catppuccin-mocha .pagination-previous,html.theme--catppuccin-mocha fieldset[disabled] .pagination-previous,fieldset[disabled] html.theme--catppuccin-mocha .pagination-next,html.theme--catppuccin-mocha fieldset[disabled] .pagination-next,fieldset[disabled] html.theme--catppuccin-mocha .pagination-link,html.theme--catppuccin-mocha fieldset[disabled] .pagination-link,fieldset[disabled] html.theme--catppuccin-mocha .pagination-ellipsis,html.theme--catppuccin-mocha fieldset[disabled] .pagination-ellipsis,fieldset[disabled] html.theme--catppuccin-mocha .file-cta,html.theme--catppuccin-mocha fieldset[disabled] .file-cta,fieldset[disabled] html.theme--catppuccin-mocha .file-name,html.theme--catppuccin-mocha fieldset[disabled] .file-name,fieldset[disabled] html.theme--catppuccin-mocha .select select,fieldset[disabled] html.theme--catppuccin-mocha .textarea,fieldset[disabled] html.theme--catppuccin-mocha .input,fieldset[disabled] html.theme--catppuccin-mocha #documenter .docs-sidebar form.docs-search>input,html.theme--catppuccin-mocha fieldset[disaLine truncated
|
||||
@@ -1,7 +0,0 @@
|
||||
html.theme--documenter-dark .pagination-previous,html.theme--documenter-dark .pagination-next,html.theme--documenter-dark .pagination-link,html.theme--documenter-dark .pagination-ellipsis,html.theme--documenter-dark .file-cta,html.theme--documenter-dark .file-name,html.theme--documenter-dark .select select,html.theme--documenter-dark .textarea,html.theme--documenter-dark .input,html.theme--documenter-dark #documenter .docs-sidebar form.docs-search>input,html.theme--documenter-dark .button{-moz-appearance:none;-webkit-appearance:none;align-items:center;border:1px solid transparent;border-radius:.4em;box-shadow:none;display:inline-flex;font-size:1rem;height:2.5em;justify-content:flex-start;line-height:1.5;padding-bottom:calc(0.5em - 1px);padding-left:calc(0.75em - 1px);padding-right:calc(0.75em - 1px);padding-top:calc(0.5em - 1px);position:relative;vertical-align:top}html.theme--documenter-dark .pagination-previous:focus,html.theme--documenter-dark .pagination-next:focus,html.theme--documenter-dark .pagination-link:focus,html.theme--documenter-dark .pagination-ellipsis:focus,html.theme--documenter-dark .file-cta:focus,html.theme--documenter-dark .file-name:focus,html.theme--documenter-dark .select select:focus,html.theme--documenter-dark .textarea:focus,html.theme--documenter-dark .input:focus,html.theme--documenter-dark #documenter .docs-sidebar form.docs-search>input:focus,html.theme--documenter-dark .button:focus,html.theme--documenter-dark .is-focused.pagination-previous,html.theme--documenter-dark .is-focused.pagination-next,html.theme--documenter-dark .is-focused.pagination-link,html.theme--documenter-dark .is-focused.pagination-ellipsis,html.theme--documenter-dark .is-focused.file-cta,html.theme--documenter-dark .is-focused.file-name,html.theme--documenter-dark .select select.is-focused,html.theme--documenter-dark .is-focused.textarea,html.theme--documenter-dark .is-focused.input,html.theme--documenter-dark #documenter .docs-sidebar form.docs-search>input.is-focused,html.theme--documenter-dark .is-focused.button,html.theme--documenter-dark .pagination-previous:active,html.theme--documenter-dark .pagination-next:active,html.theme--documenter-dark .pagination-link:active,html.theme--documenter-dark .pagination-ellipsis:active,html.theme--documenter-dark .file-cta:active,html.theme--documenter-dark .file-name:active,html.theme--documenter-dark .select select:active,html.theme--documenter-dark .textarea:active,html.theme--documenter-dark .input:active,html.theme--documenter-dark #documenter .docs-sidebar form.docs-search>input:active,html.theme--documenter-dark .button:active,html.theme--documenter-dark .is-active.pagination-previous,html.theme--documenter-dark .is-active.pagination-next,html.theme--documenter-dark .is-active.pagination-link,html.theme--documenter-dark .is-active.pagination-ellipsis,html.theme--documenter-dark .is-active.file-cta,html.theme--documenter-dark .is-active.file-name,html.theme--documenter-dark .select select.is-active,html.theme--documenter-dark .is-active.textarea,html.theme--documenter-dark .is-active.input,html.theme--documenter-dark #documenter .docs-sidebar form.docs-search>input.is-active,html.theme--documenter-dark .is-active.button{outline:none}html.theme--documenter-dark .pagination-previous[disabled],html.theme--documenter-dark .pagination-next[disabled],html.theme--documenter-dark .pagination-link[disabled],html.theme--documenter-dark .pagination-ellipsis[disabled],html.theme--documenter-dark .file-cta[disabled],html.theme--documenter-dark .file-name[disabled],html.theme--documenter-dark .select select[disabled],html.theme--documenter-dark .textarea[disabled],html.theme--documenter-dark .input[disabled],html.theme--documenter-dark #documenter .docs-sidebar form.docs-search>input[disabled],html.theme--documenter-dark .button[disabled],fieldset[disabled] html.theme--documenter-dark .pagination-previous,html.theme--documenter-dark fieldset[disabled] .pagination-previous,fieldset[disabled] html.theme--documenter-dark .pagination-next,html.theme--documenter-dark fieldset[disabled] .pagination-next,fieldset[disabled] html.theme--documenter-dark .pagination-link,html.theme--documenter-dark fieldset[disabled] .pagination-link,fieldset[disabled] html.theme--documenter-dark .pagination-ellipsis,html.theme--documenter-dark fieldset[disabled] .pagination-ellipsis,fieldset[disabled] html.theme--documenter-dark .file-cta,html.theme--documenter-dark fieldset[disabled] .file-cta,fieldset[disabled] html.theme--documenter-dark .file-name,html.theme--documenter-dark fieldset[disabled] .file-name,fieldset[disabled] html.theme--documenter-dark .select select,fieldset[disabled] html.theme--documenter-dark .textarea,fieldset[disabled] html.theme--documenter-dark .input,fieldset[disabled] html.theme--documenter-dark #documenter .docs-sidebar form.docs-search>input,html.theme--documenter-dark fieldset[disabled] .select select,html.theme--documenter-dark .select fieldset[disabled] select,Line truncated
|
||||
Theme: a11y-dark
|
||||
Author: @ericwbailey
|
||||
Maintainer: @ericwbailey
|
||||
|
||||
Based on the Tomorrow Night Eighties theme: https://github.com/isagalaev/highlight.js/blob/master/src/styles/tomorrow-night-eighties.css
|
||||
*/}html.theme--documenter-dark html{background-color:#1f2424;font-size:16px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;min-width:300px;overflow-x:auto;overflow-y:scroll;text-rendering:optimizeLegibility;text-size-adjust:100%}html.theme--documenter-dark article,html.theme--documenter-dark aside,html.theme--documenter-dark figure,html.theme--documenter-dark footer,html.theme--documenter-dark header,html.theme--documenter-dark hgroup,html.theme--documenter-dark section{display:block}html.theme--documenter-dark body,html.theme--documenter-dark button,html.theme--documenter-dark input,html.theme--documenter-dark optgroup,html.theme--documenter-dark select,html.theme--documenter-dark textarea{font-family:"Lato Medium",-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue","Helvetica","Arial",sans-serif}html.theme--documenter-dark code,html.theme--documenter-dark pre{-moz-osx-font-smoothing:auto;-webkit-font-smoothing:auto;font-family:"JuliaMono","SFMono-Regular","Menlo","Consolas","Liberation Mono","DejaVu Sans Mono",monospace}html.theme--documenter-dark body{color:#fff;font-size:1em;font-weight:400;line-height:1.5}html.theme--documenter-dark a{color:#1abc9c;cursor:pointer;text-decoration:none}html.theme--documenter-dark a strong{color:currentColor}html.theme--documenter-dark a:hover{color:#1dd2af}html.theme--documenter-dark code{background-color:rgba(255,255,255,0.05);color:#ececec;font-size:.875em;font-weight:normal;padding:.1em}html.theme--documenter-dark hr{background-color:#282f2f;border:none;display:block;height:2px;margin:1.5rem 0}html.theme--documenter-dark img{height:auto;max-width:100%}html.theme--documenter-dark input[type="checkbox"],html.theme--documenter-dark input[type="radio"]{vertical-align:baseline}html.theme--documenter-dark small{font-size:.875em}html.theme--documenter-dark span{font-style:inherit;font-weight:inherit}html.theme--documenter-dark strong{color:#f2f2f2;font-weight:700}html.theme--documenter-dark fieldset{border:none}html.theme--documenter-dark pre{-webkit-overflow-scrolling:touch;background-color:#282f2f;color:#fff;font-size:.875em;overflow-x:auto;padding:1.25rem 1.5rem;white-space:pre;word-wrap:normal}html.theme--documenter-dark pre code{background-color:transparent;color:currentColor;font-size:1em;padding:0}html.theme--documenter-dark table td,html.theme--documenter-dark table th{vertical-align:top}html.theme--documenter-dark table td:not([align]),html.theme--documenter-dark table th:not([align]){text-align:inherit}html.theme--documenter-dark table th{color:#f2f2f2}html.theme--documenter-dark .box{background-color:#343c3d;border-radius:8px;box-shadow:none;color:#fff;display:block;padding:1.25rem}html.theme--documenter-dark a.box:hover,html.theme--documenter-dark a.box:focus{box-shadow:0 0.5em 1em -0.125em rgba(10,10,10,0.1),0 0 0 1px #1abc9c}html.theme--documenter-dark a.box:active{box-shadow:inset 0 1px 2px rgba(10,10,10,0.2),0 0 0 1px #1abc9c}html.theme--documenter-dark .button{background-color:#282f2f;border-color:#4c5759;border-width:1px;color:#375a7f;cursor:pointer;justify-content:center;padding-bottom:calc(0.5em - 1px);padding-left:1em;padding-right:1em;padding-top:calc(0.5em - 1px);text-align:center;white-space:nowrap}html.theme--documenter-dark .button strong{color:inherit}html.theme--documenter-dark .button .icon,html.theme--documenter-dark .button .icon.is-small,html.theme--documenter-dark .button #documenter .docs-sidebar form.docs-search>input.icon,html.theme--documenter-dark #documenter .docs-sidebar .button form.docs-search>input.icon,html.theme--documenter-dark .button .icon.is-medium,html.theme--documenter-dark .button .icon.is-large{height:1.5em;width:1.5em}html.theme--documenter-dark .button .icon:first-child:not(:last-child){margin-left:calc(-0.5em - 1px);margin-right:.25em}html.theme--documenter-dark .button .icon:last-child:not(:first-child){margin-left:.25em;margin-right:calc(-0.5em - 1px)}html.theme--documenter-dark .button .icon:first-child:last-child{margin-left:calc(-0.5em - 1px);margin-right:calc(-0.5em - 1px)}html.theme--documenter-dark .button:hover,html.theme--documenter-dark .button.is-hovered{border-color:#8c9b9d;color:#f2f2f2}html.theme--documenter-dark .button:focus,html.theme--documenter-dark .button.is-focused{border-color:#8c9b9d;color:#17a689}html.theme--documenter-dark .button:focus:not(:active),html.theme--documenter-dark .button.is-focused:not(:active){box-shadow:0 0 0 0.125em rgba(26,188,156,0.25)}html.theme--documenter-dark .button:active,html.theme--documenter-dark .button.is-active{border-color:#343c3d;color:#f2f2f2}html.theme--documenter-dark .button.is-text{background-color:transparent;border-color:transparent;color:#fff;text-decoration:underline}html.theme--documenter-dark .button.is-text:hover,html.theme--documenter-dark .button.is-text.is-hovered,html.theme--documenter-dark .button.is-text:focus,html.theme--documenter-dark .button.is-text.is-focused{background-color:#282f2f;color:#f2f2f2}html.themLine truncated
|
||||
@@ -1,9 +0,0 @@
|
||||
.pagination-previous,.pagination-next,.pagination-link,.pagination-ellipsis,.file-cta,.file-name,.select select,.textarea,.input,#documenter .docs-sidebar form.docs-search>input,.button{-moz-appearance:none;-webkit-appearance:none;align-items:center;border:1px solid transparent;border-radius:4px;box-shadow:none;display:inline-flex;font-size:1rem;height:2.5em;justify-content:flex-start;line-height:1.5;padding-bottom:calc(0.5em - 1px);padding-left:calc(0.75em - 1px);padding-right:calc(0.75em - 1px);padding-top:calc(0.5em - 1px);position:relative;vertical-align:top}.pagination-previous:focus,.pagination-next:focus,.pagination-link:focus,.pagination-ellipsis:focus,.file-cta:focus,.file-name:focus,.select select:focus,.textarea:focus,.input:focus,#documenter .docs-sidebar form.docs-search>input:focus,.button:focus,.is-focused.pagination-previous,.is-focused.pagination-next,.is-focused.pagination-link,.is-focused.pagination-ellipsis,.is-focused.file-cta,.is-focused.file-name,.select select.is-focused,.is-focused.textarea,.is-focused.input,#documenter .docs-sidebar form.docs-search>input.is-focused,.is-focused.button,.pagination-previous:active,.pagination-next:active,.pagination-link:active,.pagination-ellipsis:active,.file-cta:active,.file-name:active,.select select:active,.textarea:active,.input:active,#documenter .docs-sidebar form.docs-search>input:active,.button:active,.is-active.pagination-previous,.is-active.pagination-next,.is-active.pagination-link,.is-active.pagination-ellipsis,.is-active.file-cta,.is-active.file-name,.select select.is-active,.is-active.textarea,.is-active.input,#documenter .docs-sidebar form.docs-search>input.is-active,.is-active.button{outline:none}.pagination-previous[disabled],.pagination-next[disabled],.pagination-link[disabled],.pagination-ellipsis[disabled],.file-cta[disabled],.file-name[disabled],.select select[disabled],.textarea[disabled],.input[disabled],#documenter .docs-sidebar form.docs-search>input[disabled],.button[disabled],fieldset[disabled] .pagination-previous,fieldset[disabled] .pagination-next,fieldset[disabled] .pagination-link,fieldset[disabled] .pagination-ellipsis,fieldset[disabled] .file-cta,fieldset[disabled] .file-name,fieldset[disabled] .select select,.select fieldset[disabled] select,fieldset[disabled] .textarea,fieldset[disabled] .input,fieldset[disabled] #documenter .docs-sidebar form.docs-search>input,#documenter .docs-sidebar fieldset[disabled] form.docs-search>input,fieldset[disabled] .button{cursor:not-allowed}.tabs,.pagination-previous,.pagination-next,.pagination-link,.pagination-ellipsis,.breadcrumb,.file,.button,.is-unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.navbar-link:not(.is-arrowless)::after,.select:not(.is-multiple):not(.is-loading)::after{border:3px solid rgba(0,0,0,0);border-radius:2px;border-right:0;border-top:0;content:" ";display:block;height:0.625em;margin-top:-0.4375em;pointer-events:none;position:absolute;top:50%;transform:rotate(-45deg);transform-origin:center;width:0.625em}.admonition:not(:last-child),.tabs:not(:last-child),.pagination:not(:last-child),.message:not(:last-child),.level:not(:last-child),.breadcrumb:not(:last-child),.block:not(:last-child),.title:not(:last-child),.subtitle:not(:last-child),.table-container:not(:last-child),.table:not(:last-child),.progress:not(:last-child),.notification:not(:last-child),.content:not(:last-child),.box:not(:last-child){margin-bottom:1.5rem}.modal-close,.delete{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-moz-appearance:none;-webkit-appearance:none;background-color:rgba(10,10,10,0.2);border:none;border-radius:9999px;cursor:pointer;pointer-events:auto;display:inline-block;flex-grow:0;flex-shrink:0;font-size:0;height:20px;max-height:20px;max-width:20px;min-height:20px;min-width:20px;outline:none;position:relative;vertical-align:top;width:20px}.modal-close::before,.delete::before,.modal-close::after,.delete::after{background-color:#fff;content:"";display:block;left:50%;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%) rotate(45deg);transform-origin:center center}.modal-close::before,.delete::before{height:2px;width:50%}.modal-close::after,.delete::after{height:50%;width:2px}.modal-close:hover,.delete:hover,.modal-close:focus,.delete:focus{background-color:rgba(10,10,10,0.3)}.modal-close:active,.delete:active{background-color:rgba(10,10,10,0.4)}.is-small.modal-close,#documenter .docs-sidebar form.docs-search>input.modal-close,.is-small.delete,#documenter .docs-sidebar form.docs-search>input.delete{height:16px;max-height:16px;max-width:16px;min-height:16px;min-width:16px;width:16px}.is-medium.modal-close,.is-medium.delete{height:24px;max-height:24px;max-width:24px;min-height:24px;min-width:24px;width:24px}.is-large.modal-close,.is-large.delete{height:32px;max-height:32px;max-width:32px;min-height:32px;min-width:32px;widtLine truncated
|
||||
Theme: Default
|
||||
Description: Original highlight.js style
|
||||
Author: (c) Ivan Sagalaev <maniac@softwaremaniacs.org>
|
||||
Maintainer: @highlightjs/core-team
|
||||
Website: https://highlightjs.org/
|
||||
License: see project LICENSE
|
||||
Touched: 2021
|
||||
*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#F3F3F3;color:#444}.hljs-comment{color:#697070}.hljs-tag,.hljs-punctuation{color:#444a}.hljs-tag .hljs-name,.hljs-tag .hljs-attr{color:#444}.hljs-keyword,.hljs-attribute,.hljs-selector-tag,.hljs-meta .hljs-keyword,.hljs-doctag,.hljs-name{font-weight:bold}.hljs-type,.hljs-string,.hljs-number,.hljs-selector-id,.hljs-selector-class,.hljs-quote,.hljs-template-tag,.hljs-deletion{color:#880000}.hljs-title,.hljs-section{color:#880000;font-weight:bold}.hljs-regexp,.hljs-symbol,.hljs-variable,.hljs-template-variable,.hljs-link,.hljs-selector-attr,.hljs-operator,.hljs-selector-pseudo{color:#ab5656}.hljs-literal{color:#695}.hljs-built_in,.hljs-bullet,.hljs-code,.hljs-addition{color:#397300}.hljs-meta{color:#1f7199}.hljs-meta .hljs-string{color:#38a}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:bold}.gap-4{gap:1rem}
|
||||
@@ -1,84 +0,0 @@
|
||||
// Small function to quickly swap out themes. Gets put into the <head> tag..
|
||||
function set_theme_from_local_storage() {
|
||||
// Initialize the theme to null, which means default
|
||||
var theme = null;
|
||||
// If the browser supports the localstorage and is not disabled then try to get the
|
||||
// documenter theme
|
||||
if (window.localStorage != null) {
|
||||
// Get the user-picked theme from localStorage. May be `null`, which means the default
|
||||
// theme.
|
||||
theme = window.localStorage.getItem("documenter-theme");
|
||||
}
|
||||
// Check if the users preference is for dark color scheme
|
||||
var darkPreference =
|
||||
window.matchMedia("(prefers-color-scheme: dark)").matches === true;
|
||||
// Initialize a few variables for the loop:
|
||||
//
|
||||
// - active: will contain the index of the theme that should be active. Note that there
|
||||
// is no guarantee that localStorage contains sane values. If `active` stays `null`
|
||||
// we either could not find the theme or it is the default (primary) theme anyway.
|
||||
// Either way, we then need to stick to the primary theme.
|
||||
//
|
||||
// - disabled: style sheets that should be disabled (i.e. all the theme style sheets
|
||||
// that are not the currently active theme)
|
||||
var active = null;
|
||||
var disabled = [];
|
||||
var primaryLightTheme = null;
|
||||
var primaryDarkTheme = null;
|
||||
for (var i = 0; i < document.styleSheets.length; i++) {
|
||||
var ss = document.styleSheets[i];
|
||||
// The <link> tag of each style sheet is expected to have a data-theme-name attribute
|
||||
// which must contain the name of the theme. The names in localStorage much match this.
|
||||
var themename = ss.ownerNode.getAttribute("data-theme-name");
|
||||
// attribute not set => non-theme stylesheet => ignore
|
||||
if (themename === null) continue;
|
||||
// To distinguish the default (primary) theme, it needs to have the data-theme-primary
|
||||
// attribute set.
|
||||
if (ss.ownerNode.getAttribute("data-theme-primary") !== null) {
|
||||
primaryLightTheme = themename;
|
||||
}
|
||||
// Check if the theme is primary dark theme so that we could store its name in darkTheme
|
||||
if (ss.ownerNode.getAttribute("data-theme-primary-dark") !== null) {
|
||||
primaryDarkTheme = themename;
|
||||
}
|
||||
// If we find a matching theme (and it's not the default), we'll set active to non-null
|
||||
if (themename === theme) active = i;
|
||||
// Store the style sheets of inactive themes so that we could disable them
|
||||
if (themename !== theme) disabled.push(ss);
|
||||
}
|
||||
var activeTheme = null;
|
||||
if (active !== null) {
|
||||
// If we did find an active theme, we'll (1) add the theme--$(theme) class to <html>
|
||||
document.getElementsByTagName("html")[0].className = "theme--" + theme;
|
||||
activeTheme = theme;
|
||||
} else {
|
||||
// If we did _not_ find an active theme, then we need to fall back to the primary theme
|
||||
// which can either be dark or light, depending on the user's OS preference.
|
||||
var activeTheme = darkPreference ? primaryDarkTheme : primaryLightTheme;
|
||||
// In case it somehow happens that the relevant primary theme was not found in the
|
||||
// preceding loop, we abort without doing anything.
|
||||
if (activeTheme === null) {
|
||||
console.error("Unable to determine primary theme.");
|
||||
return;
|
||||
}
|
||||
// When switching to the primary light theme, then we must not have a class name
|
||||
// for the <html> tag. That's only for non-primary or the primary dark theme.
|
||||
if (darkPreference) {
|
||||
document.getElementsByTagName("html")[0].className =
|
||||
"theme--" + activeTheme;
|
||||
} else {
|
||||
document.getElementsByTagName("html")[0].className = "";
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < document.styleSheets.length; i++) {
|
||||
var ss = document.styleSheets[i];
|
||||
// The <link> tag of each style sheet is expected to have a data-theme-name attribute
|
||||
// which must contain the name of the theme. The names in localStorage much match this.
|
||||
var themename = ss.ownerNode.getAttribute("data-theme-name");
|
||||
// attribute not set => non-theme stylesheet => ignore
|
||||
if (themename === null) continue;
|
||||
// we'll disable all the stylesheets, except for the active one
|
||||
ss.disabled = !(themename == activeTheme);
|
||||
}
|
||||
}
|
||||
set_theme_from_local_storage();
|
||||
@@ -1,68 +0,0 @@
|
||||
function maybeAddWarning() {
|
||||
// DOCUMENTER_NEWEST is defined in versions.js, DOCUMENTER_CURRENT_VERSION and DOCUMENTER_STABLE
|
||||
// in siteinfo.js. DOCUMENTER_IS_DEV_VERSION is optional and defined in siteinfo.js.
|
||||
// If the required variables are undefined something went horribly wrong, so we abort.
|
||||
if (
|
||||
window.DOCUMENTER_NEWEST === undefined ||
|
||||
window.DOCUMENTER_CURRENT_VERSION === undefined ||
|
||||
window.DOCUMENTER_STABLE === undefined
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Current version is not a version number, so we can't tell if it's the newest version. Abort.
|
||||
if (!/v(\d+\.)*\d+/.test(window.DOCUMENTER_CURRENT_VERSION)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Current version is newest version, so no need to add a warning.
|
||||
if (window.DOCUMENTER_NEWEST === window.DOCUMENTER_CURRENT_VERSION) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Add a noindex meta tag (unless one exists) so that search engines don't index this version of the docs.
|
||||
if (document.body.querySelector('meta[name="robots"]') === null) {
|
||||
const meta = document.createElement("meta");
|
||||
meta.name = "robots";
|
||||
meta.content = "noindex";
|
||||
|
||||
document.getElementsByTagName("head")[0].appendChild(meta);
|
||||
}
|
||||
|
||||
const div = document.createElement("div");
|
||||
// Base class is added by default
|
||||
div.classList.add("warning-overlay-base");
|
||||
const closer = document.createElement("button");
|
||||
closer.classList.add("outdated-warning-closer", "delete");
|
||||
closer.addEventListener("click", function () {
|
||||
document.body.removeChild(div);
|
||||
});
|
||||
const href = window.documenterBaseURL + "/../" + window.DOCUMENTER_STABLE;
|
||||
|
||||
// Determine if this is a development version or an older release
|
||||
let warningMessage = "";
|
||||
if (window.DOCUMENTER_IS_DEV_VERSION === true) {
|
||||
div.classList.add("dev-warning-overlay");
|
||||
warningMessage =
|
||||
"This documentation is for the <strong>development version</strong> and may contain unstable or unreleased features.<br>";
|
||||
} else {
|
||||
div.classList.add("outdated-warning-overlay");
|
||||
warningMessage =
|
||||
"This documentation is for an <strong>older version</strong> that may be missing recent changes.<br>";
|
||||
}
|
||||
|
||||
warningMessage +=
|
||||
'<a href="' +
|
||||
href +
|
||||
'">Click here to go to the documentation for the latest stable release.</a>';
|
||||
|
||||
div.innerHTML = warningMessage;
|
||||
div.appendChild(closer);
|
||||
document.body.appendChild(div);
|
||||
}
|
||||
|
||||
if (document.readyState === "loading") {
|
||||
document.addEventListener("DOMContentLoaded", maybeAddWarning);
|
||||
} else {
|
||||
maybeAddWarning();
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Getting started · XM_40017</title><meta name="title" content="Getting started · XM_40017"/><meta property="og:title" content="Getting started · XM_40017"/><meta property="twitter:title" content="Getting started · XM_40017"/><meta name="description" content="Documentation for XM_40017."/><meta property="og:description" content="Documentation for XM_40017."/><meta property="twitter:description" content="Documentation for XM_40017."/><meta property="og:url" content="https://fverdugo.github.io/XM_40017/getting_started_with_julia/"/><meta property="twitter:url" content="https://fverdugo.github.io/XM_40017/getting_started_with_julia/"/><link rel="canonical" href="https://fverdugo.github.io/XM_40017/getting_started_with_julia/"/><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../search_index.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script><link href="../assets/favicon.ico" rel="icon" type="image/x-icon"/><script src="../assets/iframeResizer.min.js"></script><link href="../assets/custom.css" rel="stylesheet" type="text/css"/></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="../"><img src="../assets/logo.png" alt="XM_40017 logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../">XM_40017</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li class="is-active"><a class="tocitem" href>Getting started</a><ul class="internal"><li><a class="tocitem" href="#Introduction"><span>Introduction</span></a></li><li><a class="tocitem" href="#Why-Julia?"><span>Why Julia?</span></a></li><li><a class="tocitem" href="#Installing-Julia"><span>Installing Julia</span></a></li><li><a class="tocitem" href="#The-Julia-REPL"><span>The Julia REPL</span></a></li><li><a class="tocitem" href="#Running-Julia-code"><span>Running Julia code</span></a></li><li><a class="tocitem" href="#Package-manager"><span>Package manager</span></a></li><li><a class="tocitem" href="#Conclusion"><span>Conclusion</span></a></li></ul></li><li><span class="tocitem">Notebooks</span><ul><li><a class="tocitem" href="../julia_basics/">Julia Basics</a></li><li><a class="tocitem" href="../julia_async/">Asynchronous programming in Julia</a></li><li><a class="tocitem" href="../julia_distributed/">Distributed computing in Julia</a></li><li><a class="tocitem" href="../matrix_matrix/">Matrix-matrix multiplication</a></li><li><a class="tocitem" href="../julia_mpi/">MPI (point-to-point)</a></li><li><a class="tocitem" href="../mpi_collectives/">MPI (collectives)</a></li><li><a class="tocitem" href="../jacobi_method/">Jacobi method</a></li><li><a class="tocitem" href="../asp/">All pairs of shortest paths</a></li><li><a class="tocitem" href="../LEQ/">Gaussian elimination</a></li><li><a class="tocitem" href="../Line truncated
|
||||
julia> @everywhere println("Hello, world! I am proc $(myid()) from $(nprocs())")</code></pre><p>Here, we are using the <code>Distributed</code> package, which is part of the Julia standard library that provides distributed memory parallel support. The code prints the process id and the number of processes in the current Julia session.</p><p>You will probably only see output from 1 process. We need to add more processes to run the example in parallel. This is done with the <code>addprocs</code> function.</p><pre><code class="language-julia hljs">julia> addprocs(3)</code></pre><p>We have added 3 new processes. Plus the old one, we have 4 processes. Run the code again.</p><pre><code class="language-julia hljs">julia> @everywhere println("Hello, world! I am proc $(myid()) from $(nprocs())")</code></pre><p>Now, you should see output from 4 processes.</p><p>It is possible to specify the number of processes when starting Julia from the terminal with the <code>-p</code> argument (useful, e.g., when running in a cluster). If you launch Julia from the terminal as</p><pre><code class="nohighlight hljs">$ julia -p 3</code></pre><p>and then run</p><pre><code class="language-julia hljs">julia> @everywhere println("Hello, world! I am proc $(myid()) from $(nprocs())")</code></pre><p>You should get output from 4 processes as before.</p><h3 id="Installing-packages"><a class="docs-heading-anchor" href="#Installing-packages">Installing packages</a><a id="Installing-packages-1"></a><a class="docs-heading-anchor-permalink" href="#Installing-packages" title="Permalink"></a></h3><p>One of the most useful features of Julia is its package manager. It allows one to install Julia packages in a straightforward and platform independent way. To illustrate this, let us consider the following parallel "Hello world" example. This example uses the Message Passing Interface (MPI). We will learn more about MPI later in the course.</p><p>Copy the following block of code into a new file named <code>"hello_mpi.jl"</code></p><pre><code class="language-julia hljs"># file hello_mpi.jl
|
||||
using MPI
|
||||
MPI.Init()
|
||||
comm = MPI.COMM_WORLD
|
||||
rank = MPI.Comm_rank(comm)
|
||||
nranks = MPI.Comm_size(comm)
|
||||
println("Hello world, I am rank $rank of $nranks")</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> include("hello_mpi.jl")</code></pre><p>It probably didn'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> ]</code></pre><p>At this point, the prompt should have changed to <code>(@v1.11) pkg></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.11 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.11) pkg> add MPI</code></pre><p>Congrats, you have installed MPI!</p><div class="admonition is-info" id="Note-5ee13b415305b02"><header class="admonition-header">Note<a class="admonition-anchor" href="#Note-5ee13b415305b02" title="Permalink"></a></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" id="Note-a53bbbf84d2a033e"><header class="admonition-header">Note<a class="admonition-anchor" href="#Note-a53bbbf84d2a033e" title="Permalink"></a></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 an 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 an MPI library for you, but it is also possible to use an 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> include("hello_mpi.jl")</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'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> using MPI
|
||||
julia> run(`$(mpiexec()) -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 your file system. 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.11) pkg> 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></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" id="Tip-345f5a1eef440049"><header class="admonition-header">Tip<a class="admonition-anchor" href="#Tip-345f5a1eef440049" title="Permalink"></a></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" id="Note-d1a60b30576112d1"><header class="admonition-header">Note<a class="admonition-anchor" href="#Note-d1a60b30576112d1" title="Permalink"></a></header><div class="admonition-body"><p>The active project folder and the current working directory are two independent concepts! For instance, <code>(@v1.11) pkg> activate folderB</code> and then <code>julia> cd("folderA")</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> add DataFrames</code></pre><p>Use the package to check that it is installed</p><pre><code class="language-julia hljs">julia> using DataFrames
|
||||
julia> 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> activate</code></pre><p>The prompt is again <code>(@v1.11) pkg></code></p><p>Now, try to use <code>DataFrames</code>.</p><pre><code class="language-julia hljs">julia> using DataFrames
|
||||
julia> 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.11) pkg> 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.11) pkg> 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 = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
|
||||
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
|
||||
MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195"</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> mkdir("newproject")</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.11) pkg> activate newproject</code></pre><p>and then <em>instantiating</em> it</p><pre><code class="language-julia hljs">(newproject) pkg> 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.11) pkg> 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.11) pkg> 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> using Pkg
|
||||
julia> Pkg.status()</code></pre><p>is equivalent to calling <code>status</code> in package mode.</p><pre><code class="language-julia hljs">(@v1.11) pkg> status</code></pre><h3 id="Creating-you-own-package"><a class="docs-heading-anchor" href="#Creating-you-own-package">Creating you own package</a><a id="Creating-you-own-package-1"></a><a class="docs-heading-anchor-permalink" href="#Creating-you-own-package" title="Permalink"></a></h3><p>In many situations, it is useful to create your own package, for instance, when working with a large code base, when you want to reduce compilation latency using <a href="https://github.com/timholy/Revise.jl"><code>Revise.jl</code></a>, or if you want to eventually <a href="https://github.com/JuliaRegistries/Registrator.jl">register your package</a> and share it with others.</p><p>The simplest way of generating a package (called <code>MyPackage</code>) is as follows. Open Julia, go to package mode, and type</p><pre><code class="language-julia hljs">(@v1.11) pkg> generate MyPackage</code></pre><p>This will crate a minimal package consisting of a new folder <code>MyPackage</code> with two files:</p><ul><li><code>MyPackage/Project.toml</code>: Project file defining the direct dependencies of your package.</li><li><code>MyPackage/src/MyPackage.jl</code>: Main source file of your package. You can split your code in several files if needed, and include them in the package main file using function <code>include</code>.</li></ul><div class="admonition is-success" id="Tip-a4880389dfda2d5a"><header class="admonition-header">Tip<a class="admonition-anchor" href="#Tip-a4880389dfda2d5a" title="Permalink"></a></header><div class="admonition-body"><p>This approach only generates a very minimal package. To create a more sophisticated package skeleton (including unit testing, code coverage, readme file, licence, etc.) use <a href="https://github.com/JuliaCI/PkgTemplates.jl"><code>PkgTemplates.jl</code></a> or <a href="https://github.com/JuliaBesties/BestieTemplate.jl"><code>BestieTemplate.jl</code></a>. The later one is developed in Amsterdam at the <a href="https://www.esciencecenter.nl/">Netherlands eScience Center</a>.</p></div></div><p>You can add dependencies to the package by activating the <code>MyPackage</code> folder in package mode and adding new dependencies as always:</p><pre><code class="language-julia hljs">(@v1.11) pkg> activate MyPackage
|
||||
(MyPackage) pkg> add MPI</code></pre><p>This will add MPI to your package dependencies.</p><h3 id="Using-your-own-package"><a class="docs-heading-anchor" href="#Using-your-own-package">Using your own package</a><a id="Using-your-own-package-1"></a><a class="docs-heading-anchor-permalink" href="#Using-your-own-package" title="Permalink"></a></h3><p>To use your package you first need to add it to a package environment of your choice. This is done by changing to package mode and typing <code>develop</code> followed by the path to the folder containing the package. For instance:</p><pre><code class="language-julia hljs">(@v1.11) pkg> develop MyPackage</code></pre><div class="admonition is-info" id="Note-36ab1f5b85af2553"><header class="admonition-header">Note<a class="admonition-anchor" href="#Note-36ab1f5b85af2553" title="Permalink"></a></header><div class="admonition-body"><p>You do not need to "develop" your package if you activated the package folder <code>MyPackage</code>.</p></div></div><p>Now, we can go back to standard Julia mode and use it as any other package:</p><pre><code class="language-julia hljs">using MyPackage
|
||||
MyPackage.greet()</code></pre><p>Here, we just called the example function defined in <code>MyPackage/src/MyPackage.jl</code>.</p><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, including how to run serial and parallel code, and how to manage, create, and use Julia packages. This knowledge will allow you to follow the course effectively! 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="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.14.1 on <span class="colophon-date" title="Wednesday 24 September 2025 05:37">Wednesday 24 September 2025</span>. Using Julia version 1.11.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
|
||||
@@ -1,5 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Home · XM_40017</title><meta name="title" content="Home · XM_40017"/><meta property="og:title" content="Home · XM_40017"/><meta property="twitter:title" content="Home · XM_40017"/><meta name="description" content="Documentation for XM_40017."/><meta property="og:description" content="Documentation for XM_40017."/><meta property="twitter:description" content="Documentation for XM_40017."/><meta property="og:url" content="https://fverdugo.github.io/XM_40017/"/><meta property="twitter:url" content="https://fverdugo.github.io/XM_40017/"/><link rel="canonical" href="https://fverdugo.github.io/XM_40017/"/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script><link href="assets/favicon.ico" rel="icon" type="image/x-icon"/><script src="assets/iframeResizer.min.js"></script><link href="assets/custom.css" rel="stylesheet" type="text/css"/></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href><img src="assets/logo.png" alt="XM_40017 logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href>XM_40017</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li class="is-active"><a class="tocitem" href>Home</a><ul class="internal"><li><a class="tocitem" href="#What"><span>What</span></a></li><li><a class="tocitem" href="#How-to-use-this-page"><span>How to use this page</span></a></li><li><a class="tocitem" href="#How-to-run-the-notebooks-locally"><span>How to run the notebooks locally</span></a></li><li><a class="tocitem" href="#Authors"><span>Authors</span></a></li><li><a class="tocitem" href="#License"><span>License</span></a></li><li><a class="tocitem" href="#Acknowledgment"><span>Acknowledgment</span></a></li></ul></li><li><a class="tocitem" href="getting_started_with_julia/">Getting started</a></li><li><span class="tocitem">Notebooks</span><ul><li><a class="tocitem" href="julia_basics/">Julia Basics</a></li><li><a class="tocitem" href="julia_async/">Asynchronous programming in Julia</a></li><li><a class="tocitem" href="julia_distributed/">Distributed computing in Julia</a></li><li><a class="tocitem" href="matrix_matrix/">Matrix-matrix multiplication</a></li><li><a class="tocitem" href="julia_mpi/">MPI (point-to-point)</a></li><li><a class="tocitem" href="mpi_collectives/">MPI (collectives)</a></li><li><a class="tocitem" href="jacobi_method/">Jacobi method</a></li><li><a class="tocitem" href="asp/">All pairs of shortest paths</a></li><li><a class="tocitem" href="LEQ/">Gaussian elimination</a></li><li><a class="tocitem" href="tsp/">Traveling salesperson problem</a></li></ul></li><li><a class="tocitem" href="solutions_for_all_notebooks/">Solutions</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">VersionLine truncated
|
||||
julia> Pkg.add("IJulia")
|
||||
julia> using IJulia
|
||||
julia> notebook()</code></pre><ul><li>These commands will open a jupyter in your web browser. Navigate in jupyter to the notebook file you have downloaded and open it.</li></ul><h2 id="Authors"><a class="docs-heading-anchor" href="#Authors">Authors</a><a id="Authors-1"></a><a class="docs-heading-anchor-permalink" href="#Authors" title="Permalink"></a></h2><p>This material is created by <a href="https://github.com/fverdugo/">Francesc Verdugo</a> with the help of <a href="https://www.linkedin.com/in/gelieza-k/">Gelieza Kötterheinrich</a>. Part of the notebooks are based on the course slides by <a href="https://www.vuhpdc.net/henri-bal/">Henri Bal</a>.</p><h2 id="License"><a class="docs-heading-anchor" href="#License">License</a><a id="License-1"></a><a class="docs-heading-anchor-permalink" href="#License" title="Permalink"></a></h2><p>All material on this page that is original to this course may be used under a <a href="https://creativecommons.org/licenses/by/4.0/">CC BY 4.0</a> license.</p><h2 id="Acknowledgment"><a class="docs-heading-anchor" href="#Acknowledgment">Acknowledgment</a><a id="Acknowledgment-1"></a><a class="docs-heading-anchor-permalink" href="#Acknowledgment" title="Permalink"></a></h2><p>This page was created with the support of the Faculty of Science of <a href="https://vu.nl">Vrije Universiteit Amsterdam</a> 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".</p></article><nav class="docs-footer"><a class="docs-footer-nextpage" href="getting_started_with_julia/">Getting started »</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="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.14.1 on <span class="colophon-date" title="Wednesday 24 September 2025 05:37">Wednesday 24 September 2025</span>. Using Julia version 1.11.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
|
||||
@@ -1,17 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>- · XM_40017</title><meta name="title" content="- · XM_40017"/><meta property="og:title" content="- · XM_40017"/><meta property="twitter:title" content="- · XM_40017"/><meta name="description" content="Documentation for XM_40017."/><meta property="og:description" content="Documentation for XM_40017."/><meta property="twitter:description" content="Documentation for XM_40017."/><meta property="og:url" content="https://fverdugo.github.io/XM_40017/jacobi_2D/"/><meta property="twitter:url" content="https://fverdugo.github.io/XM_40017/jacobi_2D/"/><link rel="canonical" href="https://fverdugo.github.io/XM_40017/jacobi_2D/"/><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../search_index.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script><link href="../assets/favicon.ico" rel="icon" type="image/x-icon"/><script src="../assets/iframeResizer.min.js"></script><link href="../assets/custom.css" rel="stylesheet" type="text/css"/></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="../"><img src="../assets/logo.png" alt="XM_40017 logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../">XM_40017</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li><a class="tocitem" href="../getting_started_with_julia/">Getting started</a></li><li><span class="tocitem">Notebooks</span><ul><li><a class="tocitem" href="../julia_basics/">Julia Basics</a></li><li><a class="tocitem" href="../julia_async/">Asynchronous programming in Julia</a></li><li><a class="tocitem" href="../julia_distributed/">Distributed computing in Julia</a></li><li><a class="tocitem" href="../matrix_matrix/">Matrix-matrix multiplication</a></li><li><a class="tocitem" href="../julia_mpi/">MPI (point-to-point)</a></li><li><a class="tocitem" href="../mpi_collectives/">MPI (collectives)</a></li><li><a class="tocitem" href="../jacobi_method/">Jacobi method</a></li><li><a class="tocitem" href="../asp/">All pairs of shortest paths</a></li><li><a class="tocitem" href="../LEQ/">Gaussian elimination</a></li><li><a class="tocitem" href="../tsp/">Traveling salesperson problem</a></li></ul></li><li><a class="tocitem" href="../solutions_for_all_notebooks/">Solutions</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li claLine truncated
|
||||
<header class="admonition-header">Tip</header>
|
||||
<div class="admonition-body">
|
||||
<ul>
|
||||
<li>
|
||||
Download this notebook and run it locally on your machine [highly recommended]. Click <a href="https://www.francescverdugo.com/XM_40017/dev/jacobi_2D.ipynb" download>here</a>.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div><iframe id="notebook" src="../jacobi_2D_src/" style="width:100%"></iframe>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function(){
|
||||
var myIframe = document.getElementById("notebook");
|
||||
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="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.14.1 on <span class="colophon-date" title="Wednesday 24 September 2025 05:37">Wednesday 24 September 2025</span>. Using Julia version 1.11.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
|
||||
@@ -1,17 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Jacobi method · XM_40017</title><meta name="title" content="Jacobi method · XM_40017"/><meta property="og:title" content="Jacobi method · XM_40017"/><meta property="twitter:title" content="Jacobi method · XM_40017"/><meta name="description" content="Documentation for XM_40017."/><meta property="og:description" content="Documentation for XM_40017."/><meta property="twitter:description" content="Documentation for XM_40017."/><meta property="og:url" content="https://fverdugo.github.io/XM_40017/jacobi_method/"/><meta property="twitter:url" content="https://fverdugo.github.io/XM_40017/jacobi_method/"/><link rel="canonical" href="https://fverdugo.github.io/XM_40017/jacobi_method/"/><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../search_index.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script><link href="../assets/favicon.ico" rel="icon" type="image/x-icon"/><script src="../assets/iframeResizer.min.js"></script><link href="../assets/custom.css" rel="stylesheet" type="text/css"/></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="../"><img src="../assets/logo.png" alt="XM_40017 logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../">XM_40017</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li><a class="tocitem" href="../getting_started_with_julia/">Getting started</a></li><li><span class="tocitem">Notebooks</span><ul><li><a class="tocitem" href="../julia_basics/">Julia Basics</a></li><li><a class="tocitem" href="../julia_async/">Asynchronous programming in Julia</a></li><li><a class="tocitem" href="../julia_distributed/">Distributed computing in Julia</a></li><li><a class="tocitem" href="../matrix_matrix/">Matrix-matrix multiplication</a></li><li><a class="tocitem" href="../julia_mpi/">MPI (point-to-point)</a></li><li><a class="tocitem" href="../mpi_collectives/">MPI (collectives)</a></li><li class="is-active"><a class="tocitem" href>Jacobi method</a></li><li><a class="tocitem" href="../asp/">All pairs of shortest paths</a></li><li><a class="tocitem" href="../LEQ/">Gaussian elimination</a></li><li><a class="tocitem" href="../tsp/">Traveling salesperson problem</a></li></ul></li><li><a class="tocitem" href="../solutions_for_all_notebooks/">Solutions</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nLine truncated
|
||||
<header class="admonition-header">Tip</header>
|
||||
<div class="admonition-body">
|
||||
<ul>
|
||||
<li>
|
||||
Download this notebook and run it locally on your machine [highly recommended]. Click <a href="https://www.francescverdugo.com/XM_40017/dev/jacobi_method.ipynb" download>here</a>.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div><iframe id="notebook" src="../jacobi_method_src/" style="width:100%"></iframe>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function(){
|
||||
var myIframe = document.getElementById("notebook");
|
||||
iFrameResize({log:true}, myIframe);
|
||||
});
|
||||
</script></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../mpi_collectives/">« MPI (collectives)</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="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.14.1 on <span class="colophon-date" title="Wednesday 24 September 2025 05:37">Wednesday 24 September 2025</span>. Using Julia version 1.11.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
|
||||
@@ -1,17 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Asynchronous programming in Julia · XM_40017</title><meta name="title" content="Asynchronous programming in Julia · XM_40017"/><meta property="og:title" content="Asynchronous programming in Julia · XM_40017"/><meta property="twitter:title" content="Asynchronous programming in Julia · XM_40017"/><meta name="description" content="Documentation for XM_40017."/><meta property="og:description" content="Documentation for XM_40017."/><meta property="twitter:description" content="Documentation for XM_40017."/><meta property="og:url" content="https://fverdugo.github.io/XM_40017/julia_async/"/><meta property="twitter:url" content="https://fverdugo.github.io/XM_40017/julia_async/"/><link rel="canonical" href="https://fverdugo.github.io/XM_40017/julia_async/"/><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../search_index.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script><link href="../assets/favicon.ico" rel="icon" type="image/x-icon"/><script src="../assets/iframeResizer.min.js"></script><link href="../assets/custom.css" rel="stylesheet" type="text/css"/></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="../"><img src="../assets/logo.png" alt="XM_40017 logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../">XM_40017</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li><a class="tocitem" href="../getting_started_with_julia/">Getting started</a></li><li><span class="tocitem">Notebooks</span><ul><li><a class="tocitem" href="../julia_basics/">Julia Basics</a></li><li class="is-active"><a class="tocitem" href>Asynchronous programming in Julia</a></li><li><a class="tocitem" href="../julia_distributed/">Distributed computing in Julia</a></li><li><a class="tocitem" href="../matrix_matrix/">Matrix-matrix multiplication</a></li><li><a class="tocitem" href="../julia_mpi/">MPI (point-to-point)</a></li><li><a class="tocitem" href="../mpi_collectives/">MPI (collectives)</a></li><li><a class="tocitem" href="../jacobi_method/">Jacobi method</a></li><li><a class="tocitem" href="../asp/">All pairs of shortest paths</a></li><li><a class="tocitem" href="../LEQ/">Gaussian elimination</a></li><li><a class="tocitem" href="../tsp/">Traveling salesperson problem</a></li></ul></li><li><a class="tocitem" href="../solutions_for_all_notebooks/">Solutions</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solLine truncated
|
||||
<header class="admonition-header">Tip</header>
|
||||
<div class="admonition-body">
|
||||
<ul>
|
||||
<li>
|
||||
Download this notebook and run it locally on your machine [highly recommended]. Click <a href="https://www.francescverdugo.com/XM_40017/dev/julia_async.ipynb" download>here</a>.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div><iframe id="notebook" src="../julia_async_src/" style="width:100%"></iframe>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function(){
|
||||
var myIframe = document.getElementById("notebook");
|
||||
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="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.14.1 on <span class="colophon-date" title="Wednesday 24 September 2025 05:37">Wednesday 24 September 2025</span>. Using Julia version 1.11.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
|
||||
@@ -1,17 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Julia Basics · XM_40017</title><meta name="title" content="Julia Basics · XM_40017"/><meta property="og:title" content="Julia Basics · XM_40017"/><meta property="twitter:title" content="Julia Basics · XM_40017"/><meta name="description" content="Documentation for XM_40017."/><meta property="og:description" content="Documentation for XM_40017."/><meta property="twitter:description" content="Documentation for XM_40017."/><meta property="og:url" content="https://fverdugo.github.io/XM_40017/julia_basics/"/><meta property="twitter:url" content="https://fverdugo.github.io/XM_40017/julia_basics/"/><link rel="canonical" href="https://fverdugo.github.io/XM_40017/julia_basics/"/><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../search_index.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script><link href="../assets/favicon.ico" rel="icon" type="image/x-icon"/><script src="../assets/iframeResizer.min.js"></script><link href="../assets/custom.css" rel="stylesheet" type="text/css"/></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="../"><img src="../assets/logo.png" alt="XM_40017 logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../">XM_40017</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li><a class="tocitem" href="../getting_started_with_julia/">Getting started</a></li><li><span class="tocitem">Notebooks</span><ul><li class="is-active"><a class="tocitem" href>Julia Basics</a></li><li><a class="tocitem" href="../julia_async/">Asynchronous programming in Julia</a></li><li><a class="tocitem" href="../julia_distributed/">Distributed computing in Julia</a></li><li><a class="tocitem" href="../matrix_matrix/">Matrix-matrix multiplication</a></li><li><a class="tocitem" href="../julia_mpi/">MPI (point-to-point)</a></li><li><a class="tocitem" href="../mpi_collectives/">MPI (collectives)</a></li><li><a class="tocitem" href="../jacobi_method/">Jacobi method</a></li><li><a class="tocitem" href="../asp/">All pairs of shortest paths</a></li><li><a class="tocitem" href="../LEQ/">Gaussian elimination</a></li><li><a class="tocitem" href="../tsp/">Traveling salesperson problem</a></li></ul></li><li><a class="tocitem" href="../solutions_for_all_notebooks/">Solutions</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav claLine truncated
|
||||
<header class="admonition-header">Tip</header>
|
||||
<div class="admonition-body">
|
||||
<ul>
|
||||
<li>
|
||||
Download this notebook and run it locally on your machine [highly recommended]. Click <a href="https://www.francescverdugo.com/XM_40017/dev/julia_basics.ipynb" download>here</a>.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div><iframe id="notebook" src="../julia_basics_src/" style="width:100%"></iframe>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function(){
|
||||
var myIframe = document.getElementById("notebook");
|
||||
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="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.14.1 on <span class="colophon-date" title="Wednesday 24 September 2025 05:37">Wednesday 24 September 2025</span>. Using Julia version 1.11.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
|
||||
@@ -1,17 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Distributed computing in Julia · XM_40017</title><meta name="title" content="Distributed computing in Julia · XM_40017"/><meta property="og:title" content="Distributed computing in Julia · XM_40017"/><meta property="twitter:title" content="Distributed computing in Julia · XM_40017"/><meta name="description" content="Documentation for XM_40017."/><meta property="og:description" content="Documentation for XM_40017."/><meta property="twitter:description" content="Documentation for XM_40017."/><meta property="og:url" content="https://fverdugo.github.io/XM_40017/julia_distributed/"/><meta property="twitter:url" content="https://fverdugo.github.io/XM_40017/julia_distributed/"/><link rel="canonical" href="https://fverdugo.github.io/XM_40017/julia_distributed/"/><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../search_index.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script><link href="../assets/favicon.ico" rel="icon" type="image/x-icon"/><script src="../assets/iframeResizer.min.js"></script><link href="../assets/custom.css" rel="stylesheet" type="text/css"/></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="../"><img src="../assets/logo.png" alt="XM_40017 logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../">XM_40017</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li><a class="tocitem" href="../getting_started_with_julia/">Getting started</a></li><li><span class="tocitem">Notebooks</span><ul><li><a class="tocitem" href="../julia_basics/">Julia Basics</a></li><li><a class="tocitem" href="../julia_async/">Asynchronous programming in Julia</a></li><li class="is-active"><a class="tocitem" href>Distributed computing in Julia</a></li><li><a class="tocitem" href="../matrix_matrix/">Matrix-matrix multiplication</a></li><li><a class="tocitem" href="../julia_mpi/">MPI (point-to-point)</a></li><li><a class="tocitem" href="../mpi_collectives/">MPI (collectives)</a></li><li><a class="tocitem" href="../jacobi_method/">Jacobi method</a></li><li><a class="tocitem" href="../asp/">All pairs of shortest paths</a></li><li><a class="tocitem" href="../LEQ/">Gaussian elimination</a></li><li><a class="tocitem" href="../tsp/">Traveling salesperson problem</a></li></ul></li><li><a class="tocitem" href="../solutions_for_all_notebooks/">Solutions</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solLine truncated
|
||||
<header class="admonition-header">Tip</header>
|
||||
<div class="admonition-body">
|
||||
<ul>
|
||||
<li>
|
||||
Download this notebook and run it locally on your machine [highly recommended]. Click <a href="https://www.francescverdugo.com/XM_40017/dev/julia_distributed.ipynb" download>here</a>.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div><iframe id="notebook" src="../julia_distributed_src/" style="width:100%"></iframe>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function(){
|
||||
var myIframe = document.getElementById("notebook");
|
||||
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="../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="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.14.1 on <span class="colophon-date" title="Wednesday 24 September 2025 05:37">Wednesday 24 September 2025</span>. Using Julia version 1.11.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
|
||||
@@ -1,17 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>- · XM_40017</title><meta name="title" content="- · XM_40017"/><meta property="og:title" content="- · XM_40017"/><meta property="twitter:title" content="- · XM_40017"/><meta name="description" content="Documentation for XM_40017."/><meta property="og:description" content="Documentation for XM_40017."/><meta property="twitter:description" content="Documentation for XM_40017."/><meta property="og:url" content="https://fverdugo.github.io/XM_40017/julia_intro/"/><meta property="twitter:url" content="https://fverdugo.github.io/XM_40017/julia_intro/"/><link rel="canonical" href="https://fverdugo.github.io/XM_40017/julia_intro/"/><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../search_index.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script><link href="../assets/favicon.ico" rel="icon" type="image/x-icon"/><script src="../assets/iframeResizer.min.js"></script><link href="../assets/custom.css" rel="stylesheet" type="text/css"/></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="../"><img src="../assets/logo.png" alt="XM_40017 logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../">XM_40017</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li><a class="tocitem" href="../getting_started_with_julia/">Getting started</a></li><li><span class="tocitem">Notebooks</span><ul><li><a class="tocitem" href="../julia_basics/">Julia Basics</a></li><li><a class="tocitem" href="../julia_async/">Asynchronous programming in Julia</a></li><li><a class="tocitem" href="../julia_distributed/">Distributed computing in Julia</a></li><li><a class="tocitem" href="../matrix_matrix/">Matrix-matrix multiplication</a></li><li><a class="tocitem" href="../julia_mpi/">MPI (point-to-point)</a></li><li><a class="tocitem" href="../mpi_collectives/">MPI (collectives)</a></li><li><a class="tocitem" href="../jacobi_method/">Jacobi method</a></li><li><a class="tocitem" href="../asp/">All pairs of shortest paths</a></li><li><a class="tocitem" href="../LEQ/">Gaussian elimination</a></li><li><a class="tocitem" href="../tsp/">Traveling salesperson problem</a></li></ul></li><li><a class="tocitem" href="../solutions_for_all_notebooks/">Solutions</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><Line truncated
|
||||
<header class="admonition-header">Tip</header>
|
||||
<div class="admonition-body">
|
||||
<ul>
|
||||
<li>
|
||||
Download this notebook and run it locally on your machine [highly recommended]. Click <a href="https://www.francescverdugo.com/XM_40017/dev/julia_intro.ipynb" download>here</a>.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div><iframe id="notebook" src="../julia_intro_src/" style="width:100%"></iframe>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function(){
|
||||
var myIframe = document.getElementById("notebook");
|
||||
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="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.14.1 on <span class="colophon-date" title="Wednesday 24 September 2025 05:37">Wednesday 24 September 2025</span>. Using Julia version 1.11.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
|
||||
@@ -1,17 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>- · XM_40017</title><meta name="title" content="- · XM_40017"/><meta property="og:title" content="- · XM_40017"/><meta property="twitter:title" content="- · XM_40017"/><meta name="description" content="Documentation for XM_40017."/><meta property="og:description" content="Documentation for XM_40017."/><meta property="twitter:description" content="Documentation for XM_40017."/><meta property="og:url" content="https://fverdugo.github.io/XM_40017/julia_jacobi/"/><meta property="twitter:url" content="https://fverdugo.github.io/XM_40017/julia_jacobi/"/><link rel="canonical" href="https://fverdugo.github.io/XM_40017/julia_jacobi/"/><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../search_index.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script><link href="../assets/favicon.ico" rel="icon" type="image/x-icon"/><script src="../assets/iframeResizer.min.js"></script><link href="../assets/custom.css" rel="stylesheet" type="text/css"/></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="../"><img src="../assets/logo.png" alt="XM_40017 logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../">XM_40017</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li><a class="tocitem" href="../getting_started_with_julia/">Getting started</a></li><li><span class="tocitem">Notebooks</span><ul><li><a class="tocitem" href="../julia_basics/">Julia Basics</a></li><li><a class="tocitem" href="../julia_async/">Asynchronous programming in Julia</a></li><li><a class="tocitem" href="../julia_distributed/">Distributed computing in Julia</a></li><li><a class="tocitem" href="../matrix_matrix/">Matrix-matrix multiplication</a></li><li><a class="tocitem" href="../julia_mpi/">MPI (point-to-point)</a></li><li><a class="tocitem" href="../mpi_collectives/">MPI (collectives)</a></li><li><a class="tocitem" href="../jacobi_method/">Jacobi method</a></li><li><a class="tocitem" href="../asp/">All pairs of shortest paths</a></li><li><a class="tocitem" href="../LEQ/">Gaussian elimination</a></li><li><a class="tocitem" href="../tsp/">Traveling salesperson problem</a></li></ul></li><li><a class="tocitem" href="../solutions_for_all_notebooks/">Solutions</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobileLine truncated
|
||||
<header class="admonition-header">Tip</header>
|
||||
<div class="admonition-body">
|
||||
<ul>
|
||||
<li>
|
||||
Download this notebook and run it locally on your machine [highly recommended]. Click <a href="https://www.francescverdugo.com/XM_40017/dev/julia_jacobi.ipynb" download>here</a>.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div><iframe id="notebook" src="../julia_jacobi_src/" style="width:100%"></iframe>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function(){
|
||||
var myIframe = document.getElementById("notebook");
|
||||
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="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.14.1 on <span class="colophon-date" title="Wednesday 24 September 2025 05:37">Wednesday 24 September 2025</span>. Using Julia version 1.11.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
|
||||
@@ -1,17 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>MPI (point-to-point) · XM_40017</title><meta name="title" content="MPI (point-to-point) · XM_40017"/><meta property="og:title" content="MPI (point-to-point) · XM_40017"/><meta property="twitter:title" content="MPI (point-to-point) · XM_40017"/><meta name="description" content="Documentation for XM_40017."/><meta property="og:description" content="Documentation for XM_40017."/><meta property="twitter:description" content="Documentation for XM_40017."/><meta property="og:url" content="https://fverdugo.github.io/XM_40017/julia_mpi/"/><meta property="twitter:url" content="https://fverdugo.github.io/XM_40017/julia_mpi/"/><link rel="canonical" href="https://fverdugo.github.io/XM_40017/julia_mpi/"/><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../search_index.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script><link href="../assets/favicon.ico" rel="icon" type="image/x-icon"/><script src="../assets/iframeResizer.min.js"></script><link href="../assets/custom.css" rel="stylesheet" type="text/css"/></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="../"><img src="../assets/logo.png" alt="XM_40017 logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../">XM_40017</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li><a class="tocitem" href="../getting_started_with_julia/">Getting started</a></li><li><span class="tocitem">Notebooks</span><ul><li><a class="tocitem" href="../julia_basics/">Julia Basics</a></li><li><a class="tocitem" href="../julia_async/">Asynchronous programming in Julia</a></li><li><a class="tocitem" href="../julia_distributed/">Distributed computing in Julia</a></li><li><a class="tocitem" href="../matrix_matrix/">Matrix-matrix multiplication</a></li><li class="is-active"><a class="tocitem" href>MPI (point-to-point)</a></li><li><a class="tocitem" href="../mpi_collectives/">MPI (collectives)</a></li><li><a class="tocitem" href="../jacobi_method/">Jacobi method</a></li><li><a class="tocitem" href="../asp/">All pairs of shortest paths</a></li><li><a class="tocitem" href="../LEQ/">Gaussian elimination</a></li><li><a class="tocitem" href="../tsp/">Traveling salesperson problem</a></li></ul></li><li><a class="tocitem" href="../solutions_for_all_notebooks/">Solutions</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-butLine truncated
|
||||
<header class="admonition-header">Tip</header>
|
||||
<div class="admonition-body">
|
||||
<ul>
|
||||
<li>
|
||||
Download this notebook and run it locally on your machine [highly recommended]. Click <a href="https://www.francescverdugo.com/XM_40017/dev/julia_mpi.ipynb" download>here</a>.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div><iframe id="notebook" src="../julia_mpi_src/" style="width:100%"></iframe>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function(){
|
||||
var myIframe = document.getElementById("notebook");
|
||||
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="../mpi_collectives/">MPI (collectives) »</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="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.14.1 on <span class="colophon-date" title="Wednesday 24 September 2025 05:37">Wednesday 24 September 2025</span>. Using Julia version 1.11.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
|
||||
@@ -1,17 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>- · XM_40017</title><meta name="title" content="- · XM_40017"/><meta property="og:title" content="- · XM_40017"/><meta property="twitter:title" content="- · XM_40017"/><meta name="description" content="Documentation for XM_40017."/><meta property="og:description" content="Documentation for XM_40017."/><meta property="twitter:description" content="Documentation for XM_40017."/><meta property="og:url" content="https://fverdugo.github.io/XM_40017/julia_tutorial/"/><meta property="twitter:url" content="https://fverdugo.github.io/XM_40017/julia_tutorial/"/><link rel="canonical" href="https://fverdugo.github.io/XM_40017/julia_tutorial/"/><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../search_index.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script><link href="../assets/favicon.ico" rel="icon" type="image/x-icon"/><script src="../assets/iframeResizer.min.js"></script><link href="../assets/custom.css" rel="stylesheet" type="text/css"/></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="../"><img src="../assets/logo.png" alt="XM_40017 logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../">XM_40017</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li><a class="tocitem" href="../getting_started_with_julia/">Getting started</a></li><li><span class="tocitem">Notebooks</span><ul><li><a class="tocitem" href="../julia_basics/">Julia Basics</a></li><li><a class="tocitem" href="../julia_async/">Asynchronous programming in Julia</a></li><li><a class="tocitem" href="../julia_distributed/">Distributed computing in Julia</a></li><li><a class="tocitem" href="../matrix_matrix/">Matrix-matrix multiplication</a></li><li><a class="tocitem" href="../julia_mpi/">MPI (point-to-point)</a></li><li><a class="tocitem" href="../mpi_collectives/">MPI (collectives)</a></li><li><a class="tocitem" href="../jacobi_method/">Jacobi method</a></li><li><a class="tocitem" href="../asp/">All pairs of shortest paths</a></li><li><a class="tocitem" href="../LEQ/">Gaussian elimination</a></li><li><a class="tocitem" href="../tsp/">Traveling salesperson problem</a></li></ul></li><li><a class="tocitem" href="../solutions_for_all_notebooks/">Solutions</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-Line truncated
|
||||
<header class="admonition-header">Tip</header>
|
||||
<div class="admonition-body">
|
||||
<ul>
|
||||
<li>
|
||||
Download this notebook and run it locally on your machine [highly recommended]. Click <a href="https://www.francescverdugo.com/XM_40017/dev/julia_tutorial.ipynb" download>here</a>.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div><iframe id="notebook" src="../julia_tutorial_src/" style="width:100%"></iframe>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function(){
|
||||
var myIframe = document.getElementById("notebook");
|
||||
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="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.14.1 on <span class="colophon-date" title="Wednesday 24 September 2025 05:37">Wednesday 24 September 2025</span>. Using Julia version 1.11.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
|
||||
@@ -1,17 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Matrix-matrix multiplication · XM_40017</title><meta name="title" content="Matrix-matrix multiplication · XM_40017"/><meta property="og:title" content="Matrix-matrix multiplication · XM_40017"/><meta property="twitter:title" content="Matrix-matrix multiplication · XM_40017"/><meta name="description" content="Documentation for XM_40017."/><meta property="og:description" content="Documentation for XM_40017."/><meta property="twitter:description" content="Documentation for XM_40017."/><meta property="og:url" content="https://fverdugo.github.io/XM_40017/matrix_matrix/"/><meta property="twitter:url" content="https://fverdugo.github.io/XM_40017/matrix_matrix/"/><link rel="canonical" href="https://fverdugo.github.io/XM_40017/matrix_matrix/"/><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../search_index.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script><link href="../assets/favicon.ico" rel="icon" type="image/x-icon"/><script src="../assets/iframeResizer.min.js"></script><link href="../assets/custom.css" rel="stylesheet" type="text/css"/></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="../"><img src="../assets/logo.png" alt="XM_40017 logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../">XM_40017</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li><a class="tocitem" href="../getting_started_with_julia/">Getting started</a></li><li><span class="tocitem">Notebooks</span><ul><li><a class="tocitem" href="../julia_basics/">Julia Basics</a></li><li><a class="tocitem" href="../julia_async/">Asynchronous programming in Julia</a></li><li><a class="tocitem" href="../julia_distributed/">Distributed computing in Julia</a></li><li class="is-active"><a class="tocitem" href>Matrix-matrix multiplication</a></li><li><a class="tocitem" href="../julia_mpi/">MPI (point-to-point)</a></li><li><a class="tocitem" href="../mpi_collectives/">MPI (collectives)</a></li><li><a class="tocitem" href="../jacobi_method/">Jacobi method</a></li><li><a class="tocitem" href="../asp/">All pairs of shortest paths</a></li><li><a class="tocitem" href="../LEQ/">Gaussian elimination</a></li><li><a class="tocitem" href="../tsp/">Traveling salesperson problem</a></li></ul></li><li><a class="tocitem" href="../solutions_for_all_notebooks/">Solutions</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hiLine truncated
|
||||
<header class="admonition-header">Tip</header>
|
||||
<div class="admonition-body">
|
||||
<ul>
|
||||
<li>
|
||||
Download this notebook and run it locally on your machine [highly recommended]. Click <a href="https://www.francescverdugo.com/XM_40017/dev/matrix_matrix.ipynb" download>here</a>.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div><iframe id="notebook" src="../matrix_matrix_src/" style="width:100%"></iframe>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function(){
|
||||
var myIframe = document.getElementById("notebook");
|
||||
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="../julia_mpi/">MPI (point-to-point) »</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="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.14.1 on <span class="colophon-date" title="Wednesday 24 September 2025 05:37">Wednesday 24 September 2025</span>. Using Julia version 1.11.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
|
||||
@@ -1,962 +0,0 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "7606d30a",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<img src=\"https://upload.wikimedia.org/wikipedia/commons/thumb/3/39/VU_logo.png/800px-VU_logo.png?20161029201021\" width=\"350\">\n",
|
||||
"\n",
|
||||
"### Programming large-scale parallel systems"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "4ac1e5d9",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Intro to MPI (collectives)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "a341be2e",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Contents\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"In this notebook, we will continue learning the basics of parallel computing using the Message Passing Interface (MPI) from Julia. In particular, we will learn:\n",
|
||||
"\n",
|
||||
"- How to use basic collective communication directives\n",
|
||||
"- How to use MPI communicators\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "c87b3c82",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Collective communication\n",
|
||||
"\n",
|
||||
"MPI provides a set of routines for communication involving multiple processes. These are called *collective communication* operations. Some usual collective operations are:\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"- `MPI_Barrier`: Synchronize all processes\n",
|
||||
"- `MPI_Bcast`: Send the same data from one to all processes\n",
|
||||
"- `MPI_Gather`: Gather data from all processes to one\n",
|
||||
"- `MPI_Scatter`: Scatter data from one to all all processes\n",
|
||||
"- `MPI_Reduce`: Reduce data from all processes to a single one\n",
|
||||
"- `MPI_Scan`: Scan (or prefix) reduction\n",
|
||||
"- `MPI_Allgather`: Like a `MPI_Gather` but all processes receive the result\n",
|
||||
"- `MPI_Allreduce`: Like `MPI_Reduce` but all processes receive the result\n",
|
||||
"- `MPI_Alltoall`: Exchange data from all to all processes\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"We will discuss some of them in greater detail in this notebook."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "4ffa5e56",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Why collective operations?\n",
|
||||
"\n",
|
||||
"Point-to-point communication functions provide all the building blocks needed in parallel programs and could be used to implement the collective functions described above. Then, why does MPI provide collective communication functions? There are several reasons:\n",
|
||||
"\n",
|
||||
"- Ease of use: It is handy for users to have these functions readily available instead of having to implement them.\n",
|
||||
"- Performance: Library implementations typically use efficient algorithms (such as reduction trees).\n",
|
||||
"- Hardware support: Hardware vendors can optimize the MPI library for their machine and even develop hardware specially design to perform MPI operations efficiently. For instance, [IMB Blue Gene](https://en.wikipedia.org/wiki/IBM_Blue_Gene) was equipped with auxiliary networks for MPI collectives.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "53a0f5fa",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Semantics of collective operations\n",
|
||||
"\n",
|
||||
"These are key properties of collective operations:\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"- Completeness: All the collective communication directives above are *complete* operations. Thus, it is safe to use and reset the buffers once the function returns.\n",
|
||||
"- Standard mode: Collective directives are in standard mode only, like `MPI_Send`. Assuming that they block is erroneous, assuming that they do not block is also erroneous.\n",
|
||||
"- Synchronization: Completion of a call does not guarantee that other processes have completed the operation. A collective operation may or may not have the effect of synchronizing all processes, the only exception is `MPI_Barrier` of course.\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"<div class=\"alert alert-block alert-info\">\n",
|
||||
"<b>Note:</b> Recent versions of the MPI standard also include non-blocking (i.e., incomplete) versions of collective operations (not covered in this notebook). A particularly funny one is the non-blocking barrier `MPI_Ibarrier`.\n",
|
||||
"</div>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "e9e2a219",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## MPI_Barrier\n",
|
||||
"\n",
|
||||
"This function is used to synchronizes a group of processes. All processes block until all have reached the barrier. It is often invoked at the end of for loops to make sure all processes have finished the current loop iteration to move to the next one. We will see a practical example later in another notebook when studying the traveling sales person problem (TSP).\n",
|
||||
"\n",
|
||||
"In Julia:\n",
|
||||
"```julia\n",
|
||||
"MPI.Barrier(comm)\n",
|
||||
"```\n",
|
||||
"\n",
|
||||
"In C:\n",
|
||||
"```c\n",
|
||||
"int MPI_Barrier(MPI_Comm comm)\n",
|
||||
"```"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "d9753e4b",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Example\n",
|
||||
"\n",
|
||||
"In this example the ranks sleep for a random amount of time and then they call barrier. It is guaranteed that the message \"Done!\" will be printed after all processes printed \"I woke up\" since we used a barrier. Try also to comment out the call to `MPI.Barrier`. You will see that the message can be printed in any order."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "c6e78389",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"using MPI"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "9a66c717",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"code = quote\n",
|
||||
" using MPI\n",
|
||||
" MPI.Init()\n",
|
||||
" comm = MPI.COMM_WORLD\n",
|
||||
" rank = MPI.Comm_rank(comm)\n",
|
||||
" sleep(rand(1:3))\n",
|
||||
" println(\"[rank $rank] I woke up\")\n",
|
||||
" MPI.Barrier(comm)\n",
|
||||
" println(\"[rank $rank] Done!\")\n",
|
||||
"end\n",
|
||||
"run(`$(mpiexec()) -np 4 julia --project=. -e $code`);"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "df0223ff",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## MPI_Reduce\n",
|
||||
"\n",
|
||||
"This function combines values provided by different processors according to a given reduction operation. The result is received in a single process (called the root process). The root process can be any process and it is rank 0 by default in Julia.\n",
|
||||
"\n",
|
||||
"In Julia:\n",
|
||||
"```julia\n",
|
||||
"MPI.Reduce!(sendbuf, recvbuf, op, comm; root)\n",
|
||||
"```\n",
|
||||
"\n",
|
||||
"In C:\n",
|
||||
"```\n",
|
||||
"int MPI_Reduce(const void *sendbuf, void *recvbuf, int count,\n",
|
||||
" MPI_Datatype datatype, MPI_Op op, int root,\n",
|
||||
" MPI_Comm comm)\n",
|
||||
"```\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"<div class=\"alert alert-block alert-info\">\n",
|
||||
"<b>Note:</b> `MPI_Reduce` (and related functions like `MPI_Allreduce`) use operations that are *commutative* and *associative*, such as addition, multiplication, maximum, minimum, logical and, logical or. Otherwise the result will be undefined as it will depend in which order the operations are done.\n",
|
||||
"</div>\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "2fc1aa28",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Example\n",
|
||||
"Each process generates a random integer. Compute the sum of all these integers. Receive the result on rank 0."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "341b8438",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"code = quote\n",
|
||||
" using MPI\n",
|
||||
" MPI.Init()\n",
|
||||
" comm = MPI.COMM_WORLD\n",
|
||||
" rank = MPI.Comm_rank(comm)\n",
|
||||
" value = rand(1:4)\n",
|
||||
" root = 0\n",
|
||||
" sndbuf = [value]\n",
|
||||
" if rank == root\n",
|
||||
" rcvbuf = [0]\n",
|
||||
" else\n",
|
||||
" # This can be anything as only the root process\n",
|
||||
" # Will receive data\n",
|
||||
" rcvbuf = nothing\n",
|
||||
" end\n",
|
||||
" println(\"[rank $rank] I am contributing with $sndbuf\")\n",
|
||||
" MPI.Reduce!(sndbuf, rcvbuf, +, comm; root)\n",
|
||||
" println(\"[rank $rank] The sum is $rcvbuf\")\n",
|
||||
"end\n",
|
||||
"run(`$(mpiexec()) -np 3 julia --project=. -e $code`);"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "3ea77a8f",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Reducing multiple values\n",
|
||||
"\n",
|
||||
"If more than one item is provided in the send buffers, `MPI_Reduce` does the reduction element by element.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "b26fd0b2",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Example\n",
|
||||
"\n",
|
||||
"Each process generates 2 random integers. Take a look to the result of reduce. Note that the values have ben reduced \"element by element\". "
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "1a145948",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"code = quote\n",
|
||||
" using MPI\n",
|
||||
" MPI.Init()\n",
|
||||
" comm = MPI.COMM_WORLD\n",
|
||||
" rank = MPI.Comm_rank(comm)\n",
|
||||
" sndbuf = rand(1:4,2)\n",
|
||||
" root = 0\n",
|
||||
" if rank == root\n",
|
||||
" rcvbuf = [0,0]\n",
|
||||
" else\n",
|
||||
" rcvbuf = nothing\n",
|
||||
" end\n",
|
||||
" println(\"[rank $rank] I am contributing with $sndbuf\")\n",
|
||||
" MPI.Reduce!(sndbuf, rcvbuf, +, comm; root)\n",
|
||||
" println(\"[rank $rank] The sum is $rcvbuf\")\n",
|
||||
"end\n",
|
||||
"run(`$(mpiexec()) -np 3 julia --project=. -e $code`);"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "539df34f",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## MPI_Allreduce\n",
|
||||
"\n",
|
||||
"This is a variant of `MPI_Reduce` in which all processes get the result."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "be0381bb",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Example\n",
|
||||
"\n",
|
||||
"This is the same example as above, but all processes get the result."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "1595f4f5",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"code = quote\n",
|
||||
" using MPI\n",
|
||||
" MPI.Init()\n",
|
||||
" comm = MPI.COMM_WORLD\n",
|
||||
" rank = MPI.Comm_rank(comm)\n",
|
||||
" sndbuf = rand(1:4,2)\n",
|
||||
" # All ranks allocate a receive buffer\n",
|
||||
" rcvbuf = [0,0]\n",
|
||||
" println(\"[rank $rank] I am contributing with $sndbuf\")\n",
|
||||
" MPI.Allreduce!(sndbuf, rcvbuf, +, comm)\n",
|
||||
" println(\"[rank $rank] The sum is $rcvbuf\")\n",
|
||||
"end\n",
|
||||
"run(`$(mpiexec()) -np 3 julia --project=. -e $code`);"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "97dc2886",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## MPI_Gather\n",
|
||||
"\n",
|
||||
"Each rank sends a message to the root rank (the root rank also sends a message to itself). The root rank receives all these values in a buffer (e.g. a vector).\n",
|
||||
"\n",
|
||||
"<div class=\"alert alert-block alert-info\">\n",
|
||||
"<b>Note:</b> This function assumes that the amount of data sent from each rank is the same. See `MPI_Gatherv` below for more general cases.\n",
|
||||
"</div>\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"In Julia:\n",
|
||||
"```julia\n",
|
||||
"MPI.Gather!(sendbuf, recvbuf, comm; root=0)\n",
|
||||
"```\n",
|
||||
"\n",
|
||||
"In C:\n",
|
||||
"```c\n",
|
||||
"int MPI_Gather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,\n",
|
||||
" void *recvbuf, int recvcount, MPI_Datatype recvtype, int root,\n",
|
||||
" MPI_Comm comm)\n",
|
||||
"```"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "3d0a1e9d",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Example\n",
|
||||
"\n",
|
||||
"Each process sends an integer to rank 0.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"attachments": {
|
||||
"g13884.png": {
|
||||
"image/png": "iVBORw0KGgoAAAANSUhEUgAABFEAAANWCAYAAAA2uxORAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAewgAAHsIBbtB1PgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAACAASURBVHic7N13mGRlnf7/d01iYMg5BxUlKCiggiImDKiYV9c16xpXZY3o6q7u18SuusZVMcvq+jMHRFcRTBgQDICIiGSQnAcmz/3745xmTp+uTtXV/VR3v1/XVVdPV9c5dVd1z3PO+dQTOkiSJM24LAG2AbZufd0I2AxYCmxc/3sRsBWwGNi0vn9p/bPFwJaTfPKh/dwKrANWACuBNcDy+jE31V+X1/evrB+3DrgFuLl+zM317ZbGv2+GzqpJZpIkSbNAp3QASZI0F2QpsAuwM7A7sC0bCiNDRZJtG//erEzOGbOCYUUVbgauB64G/gZcA1wJXFt97dxWKKckSZoEiyiSJGkcWUZVGNmlvu1Wf921vu0MbF8sHqwC7pjkNquBJfW/N6XqnVLSHcBVVEWWdqHlKuBi4BLorC4VUJIkWUSRJEkAZBtg7/p298a/7wps0ecnuwm4ob7d2Pq6iqrXxhrgNjYMoxkaVnMTsLb+2QrorOxfrAwNIVoIbF7fuQWwANiEaqjRkvpnWzZuW7W+b96W0D/rqYorF49yuxI66/v4fJIkqcUiiiRJ80Y2Z0NxpF0s2XoKO14FXE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id": "4bdf9c02",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<div>\n",
|
||||
"<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABFEAAANWCAYAAAA2uxORAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAewgAAHsIBbtB1PgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAACAASURBVHic7N13mGRlnf7/d01iYMg5BxUlKCiggiImDKiYV9c16xpXZY3o6q7u18SuusZVMcvq+jMHRFcRTBgQDICIiGSQnAcmz/3745xmTp+uTtXV/VR3v1/XVVdPV9c5dVd1z3PO+dQTOkiSJM24LAG2AbZufd0I2AxYCmxc/3sRsBWwGNi0vn9p/bPFwJaTfPKh/dwKrANWACuBNcDy+jE31V+X1/evrB+3DrgFuLl+zM317ZbGv2+GzqpJZpIkSbNAp3QASZI0F2QpsAuwM7A7sC0bCiNDRZJtG//erEzOGbOCYUUVbgauB64G/gZcA1wJXFt97dxWKKckSZoEiyiSJGkcWUZVGNmlvu1Wf921vu0MbF8sHqwC7pjkNquBJfW/N6XqnVLSHcBVVEWWdqHlKuBi4BLorC4VUJIkWUSRJEkAZBtg7/p298a/7wps0ecnuwm4ob7d2Pq6iqrXxhrgNjYMoxkaVnMTsLb+2QrorOxfrAwNIVoIbF7fuQWwANiEaqjRkvpnWzZuW7W+b96W0D/rqYorF49yuxI66/v4fJIkqcUiiiRJ80Y2Z0NxpF0s2XoKO14FXEF1gX9Z/fVquhdJbphfF/rZhA0Fle2oevBsT9V7Z0dgp/q2A9Vwp6lYDVzKhqLKRcB5wJ+oerGsm+L+JUma9yyiSJI052QRVYHkAODA+usBVENvJusOqgvzK+vb5fXXK7izcNK5tg+hRTaiKrDs0vi6A7AHsFd924Wqp8xkrQT+XN/OZUNx5a/QWTPl6JIkzRMWUSRJmtWyNXBvNhRKDgD2p1q9ZqJWAhfUt782/n0BdP7W17iaoiymmp9mr1Fuk52bZg3V7/pPjCiwWFyRJK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w6XSSJEma1/IAyIWtE9WvQ7YtnUySNJ/lSMgfuhRTTobcs3Q6SZIkzStZDHlbq9v0rZAXl04mSVIlCyB/B7mkVUhZU6/ks2PphJIkSZrzsl+XpYtPg+xVOpkkSSNlGeTfILe1jl23QP4FsknphJIkSZqT8szWSejq+gR0YelkkiSNLTtCPl73RGkWUy6HPK/quSJJkiRNWTaCfKzL0sUHl04mSdLkZD/IiV3mSzkTcmjpdJIkSZrVsjvk160TzW9Uq/JIkjRb5TDIL1rHt/X1inM7lE4nSZKkWSePh9zUOLlcCXl56VSSJPVHOpBnQa5oFVNuhhwDWVQ6oSRJkgZeFnVZfedSuzlLkuambFIf91a2iil/hjyqdDpJkiQNrGwP+VHrJPJEyNalk0mSNL2yN+SkLvOlnAjZo3Q6SZIkDZQ8BPK3xknj2vqTOVcskCTNIzkaclGrkHJ7fUxcWjqdJEmSissb6qLJ0Mni3yBHlE4lSVIZ2bgumtzRKqb8BfKY0ukkSZJURDaCfLZ1gvgTyE6lk0mSVF52rVfs6TbE5y6l00mSJGnGZHvIaa2TwndDFpZOJknSYMmj6olmm8fMFZB/gywpnU6SJEnTKveCXNxavvi5pVNJkjS4srhe+viWLkN8Hlo6nSRJkqZFHg+5rXHydzXksNKpJEmaHbIL5H9bhZR1kI9BtiidTpIkSX2TY+oTvaGTvrMhe5ZOJUnS7JOHQM5vFLine truncated
|
||||
"</div>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "1f8a70c6",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"code = quote\n",
|
||||
" using MPI\n",
|
||||
" MPI.Init()\n",
|
||||
" comm = MPI.COMM_WORLD\n",
|
||||
" rank = MPI.Comm_rank(comm)\n",
|
||||
" msg = 10*(rank+2)\n",
|
||||
" root = 0\n",
|
||||
" sndbuf = [msg]\n",
|
||||
" if rank == root\n",
|
||||
" nranks = MPI.Comm_size(comm)\n",
|
||||
" rcvbuf = zeros(Int,nranks)\n",
|
||||
" else\n",
|
||||
" # This can be anything as only the root process\n",
|
||||
" # Will receive data\n",
|
||||
" rcvbuf = nothing\n",
|
||||
" end\n",
|
||||
" println(\"[rank $rank] I am sending $sndbuf\")\n",
|
||||
" MPI.Gather!(sndbuf, rcvbuf, comm; root)\n",
|
||||
" println(\"[rank $rank] I received $rcvbuf\")\n",
|
||||
"end\n",
|
||||
"run(`$(mpiexec()) -np 3 julia --project=. -e $code`);"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "0f85f08d",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## MPI_Allgather\n",
|
||||
"\n",
|
||||
"This is a variant of `MPI_Gather` in which all processes get the result."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "4bf2ef34",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Example"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "070e1fc1",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"code = quote\n",
|
||||
" using MPI\n",
|
||||
" MPI.Init()\n",
|
||||
" comm = MPI.COMM_WORLD\n",
|
||||
" rank = MPI.Comm_rank(comm)\n",
|
||||
" msg = 10*(rank+2)\n",
|
||||
" sndbuf = [msg]\n",
|
||||
" nranks = MPI.Comm_size(comm)\n",
|
||||
" rcvbuf = zeros(Int,nranks)\n",
|
||||
" println(\"[rank $rank] I am sending $sndbuf\")\n",
|
||||
" MPI.Allgather!(sndbuf, rcvbuf, comm)\n",
|
||||
" # All ranks receive the result\n",
|
||||
" println(\"[rank $rank] I received $rcvbuf\")\n",
|
||||
"end\n",
|
||||
"run(`$(mpiexec()) -np 3 julia --project=. -e $code`);"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "fb6a9034",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## MPI_Gatherv\n",
|
||||
"\n",
|
||||
"This function is similar to `MPI_Gather`, but it is used when there is a different amount of data sent from each process. There is also `MPI_Allgatherv` for which all processes will receive the result."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "e0d2998c",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Example\n",
|
||||
"\n",
|
||||
"Each processes sends `rank+1` integers to rank 0."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "23814278",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"code = quote\n",
|
||||
" using MPI\n",
|
||||
" MPI.Init()\n",
|
||||
" comm = MPI.COMM_WORLD\n",
|
||||
" rank = MPI.Comm_rank(comm)\n",
|
||||
" sndbuf = fill(10*rank,rank+1)\n",
|
||||
" root = 0\n",
|
||||
" if rank == root\n",
|
||||
" nranks = MPI.Comm_size(comm)\n",
|
||||
" # Define the amount of data to be received\n",
|
||||
" # from each rank\n",
|
||||
" counts = [ rank+1 for rank in 0:(nranks-1)]\n",
|
||||
" # Total amount of receive data\n",
|
||||
" ndata = sum(counts)\n",
|
||||
" data = zeros(Int,ndata)\n",
|
||||
" rcvbuf = MPI.VBuffer(data,counts)\n",
|
||||
" else\n",
|
||||
" # This can be anything as only the root process\n",
|
||||
" # Will receive data\n",
|
||||
" rcvbuf = nothing\n",
|
||||
" end\n",
|
||||
" println(\"[rank $rank] I am sending $sndbuf\")\n",
|
||||
" MPI.Gatherv!(sndbuf, rcvbuf, comm; root)\n",
|
||||
" if rank == root\n",
|
||||
" println(\"[rank $rank] I received $data\")\n",
|
||||
" end\n",
|
||||
"end\n",
|
||||
"run(`$(mpiexec()) -np 4 julia --project=. -e $code`);"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "25c2fb1e",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## How to get the amount of data to be received?\n",
|
||||
"\n",
|
||||
"Remember that `MPI_Probe` allows you to query the amount of data to be received with `MPI_Recv`. Unfortunately, this mechanism does not work for MPI collectives. A workaround is to first communicate the amount of data to be gathered, allocate the receive buffer accordingly, and then communicate the actual message.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "12f9e2ca",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Example\n",
|
||||
"\n",
|
||||
"Each process sends a random amount of integers to rank 0. The root process will not know the amount of data to be gathered from each rank in advance. We need an auxiliary gather to inform about the message size."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "b10430a9",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"code = quote\n",
|
||||
" using MPI\n",
|
||||
" MPI.Init()\n",
|
||||
" comm = MPI.COMM_WORLD\n",
|
||||
" rank = MPI.Comm_rank(comm)\n",
|
||||
" # Get number of ints to send\n",
|
||||
" count = rand(1:4)\n",
|
||||
" # Generate data to send\n",
|
||||
" sndbuf = fill(rank,count)\n",
|
||||
" # Communicate counts\n",
|
||||
" root = 0\n",
|
||||
" if rank == root\n",
|
||||
" nranks = MPI.Comm_size(comm)\n",
|
||||
" counts = zeros(Int,nranks)\n",
|
||||
" else\n",
|
||||
" counts = nothing\n",
|
||||
" end\n",
|
||||
" MPI.Gather!([count], counts, comm; root)\n",
|
||||
" # Allocate receive buffer\n",
|
||||
" if rank == root\n",
|
||||
" ndata = sum(counts)\n",
|
||||
" data = zeros(Int,ndata)\n",
|
||||
" rcvbuf = MPI.VBuffer(data,counts)\n",
|
||||
" else\n",
|
||||
" rcvbuf = nothing\n",
|
||||
" end\n",
|
||||
" # Communicate data\n",
|
||||
" println(\"[rank $rank] I am sending $sndbuf\")\n",
|
||||
" MPI.Gatherv!(sndbuf, rcvbuf, comm; root)\n",
|
||||
" if rank == root\n",
|
||||
" println(\"[rank $rank] I received $data\")\n",
|
||||
" end\n",
|
||||
"end\n",
|
||||
"run(`$(mpiexec()) -np 4 julia --project=. -e $code`);"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "8b4254d1",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## MPI_Scatter\n",
|
||||
"\n",
|
||||
"This is the inverse operation of `MPI_Gather`. The root rank sends a distinct message to each rank.\n",
|
||||
"\n",
|
||||
"In Julia:\n",
|
||||
"```julia\n",
|
||||
"MPI.Scatter!(sendbuf, recvbuf, comm; root=0)\n",
|
||||
"```\n",
|
||||
"\n",
|
||||
"In C:\n",
|
||||
"```c\n",
|
||||
"int MPI_Scatter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,\n",
|
||||
" void *recvbuf, int recvcount, MPI_Datatype recvtype, int root,\n",
|
||||
" MPI_Comm comm)\n",
|
||||
"```\n",
|
||||
"\n",
|
||||
"<div class=\"alert alert-block alert-info\">\n",
|
||||
"<b>Note:</b> `MPI_Scatter` sends the same amount of data to each rank. To send a variable amount of data there is `MPI_Scatterv` (`MPI.Scatterv!` in julia), which works similar to `MPI_Gatherv`. \n",
|
||||
"</div>\n",
|
||||
"\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "e55aa353",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Example\n",
|
||||
"\n",
|
||||
"Rank 0 sends a unique integer to each rank. "
|
||||
]
|
||||
},
|
||||
{
|
||||
"attachments": {
|
||||
"g13389.png": {
|
||||
"image/png": "iVBORw0KGgoAAAANSUhEUgAABFEAAANWCAYAAAA2uxORAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAewgAAHsIBbtB1PgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAACAASURBVHic7N13nGV1ff/x190Ou5SlI10FKQpSBaLYsBB7xW6sUSMhxoJGjRiNIbGXRIk1qD8TuwI2FBsWBAsoICC91wUWtu++f3+cM+yZs3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HjInNIJJUmS1Pcyp8vqO1dBDi+dTJKk3sum9XFvRauY8mfIY0unkyRJUt/KdpAftk4iT4VsVTqZJEkTK3tCTu8yX8qpkN1Kp5MkSVJfySMg1zdOGtfUn8y5YoEkaQbJkyCXtwop99THxPml00mSJKm4vKkumgycLF4POap0KkmSysgmddFkWauYcgnkmNLpJEmSVETmQz7bOkH8CWTH0skkSSovO9cr9nQb4nPf0ukkSZI0abId5KzWSeG/QWaXTiZJUn/J4+qJZpvHzOWQt0PmlU4nSZKkCZUHQa5oLV/84tKpJEnqX5lbL318Z5chPo8snU6SJEkTIk+GLG2c/N0IOaJ0KkmSpobsBPl/rULKWsh/QbYonU6SJEk9k+PrE72Bk77zIbuXTiVJ0tSTR0AubhVTboC8qHQySZIkbZSuE8ieDtm8dDJJkqauLine truncated
|
||||
}
|
||||
},
|
||||
"cell_type": "markdown",
|
||||
"id": "74d5b606",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<div>\n",
|
||||
"<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABFEAAANWCAYAAAA2uxORAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAewgAAHsIBbtB1PgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAACAASURBVHic7N13nGV1ff/x190Ou5SlI10FKQpSBaLYsBB7xW6sUSMhxoJGjRiNIbGXRIk1qD8TuwI2FBsWBAsoICC91wUWtu++f3+cM+yZs3fq3pnvnZnX8/G4j9l7555z33Nn9nvO+dxv6SBJkjTpMg/YGtiq9XU+sBmwANik/vccYDEwF1hUP76g/t5cYMsxvvjAfu4C1gLLgRXAauDu+jlL6q9314+vqJ+3FrgTuKN+zh317c7Gv++AzsoxZpIkSVNAp3QASZI0HWQBsBNwH2BXYBvWF0YGiiTbNP69WZmck2Y5g4oq3AHcCtwIXA/cBFwH3Fx97SwtlFOSJI2BRRRJkjSCLKQqjOxU33apv+5c3+4DbFcsHqwElo1xm1XAvPrf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ZUHQa5oLV/84tKpJEnqX5lbL318Z5chPo8snU6SJEkTIk+GLG2c/N0IOaJ0KkmSpobsBPl/rULKWsh/QbYonU6SJEk9k+PrE72Bk77zIbuXTiVJ0tSTR0AubhVTboC8qHQySZIkbLine truncated
|
||||
"</div>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "5ea413fd",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"code = quote\n",
|
||||
" using MPI\n",
|
||||
" MPI.Init()\n",
|
||||
" comm = MPI.COMM_WORLD\n",
|
||||
" nranks = MPI.Comm_size(comm)\n",
|
||||
" rank = MPI.Comm_rank(comm)\n",
|
||||
" root = 0\n",
|
||||
" rcv = Ref(0) \n",
|
||||
" if rank == root\n",
|
||||
" snd = [10*(i+1) for i in 1:nranks]\n",
|
||||
" println(\"[rank $rank] I am sending: $snd\")\n",
|
||||
" else\n",
|
||||
" # Only the root rank sends data\n",
|
||||
" # so this can be anything\n",
|
||||
" snd = nothing\n",
|
||||
" end \n",
|
||||
" MPI.Scatter!(snd,rcv,comm;root)\n",
|
||||
" println(\"[rank $rank] I have received: $(rcv[])\")\n",
|
||||
"end\n",
|
||||
"run(`$(mpiexec()) -np 4 julia --project=. -e $code`);"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "ed8da7f9",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## MPI_Bcast\n",
|
||||
"\n",
|
||||
"Similar to `MPI_Scatter`, but we send the same message to all processes.\n",
|
||||
"\n",
|
||||
"In Julia:\n",
|
||||
"```julia\n",
|
||||
"MPI.Bcast!(buf, comm; root)\n",
|
||||
"```\n",
|
||||
"\n",
|
||||
"In C:\n",
|
||||
"```c\n",
|
||||
"int MPI_Bcast(void *buffer, int count, MPI_Datatype datatype,\n",
|
||||
" int root, MPI_Comm comm)\n",
|
||||
"```\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "97369713",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Example\n",
|
||||
"\n",
|
||||
"Rank 0 sends the same integer to all processes."
|
||||
]
|
||||
},
|
||||
{
|
||||
"attachments": {
|
||||
"g1657.png": {
|
||||
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA9MAAANWCAYAAAD9cN8uAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAewgAAHsIBbtB1PgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAACAASURBVHic7N13nC1lYf/xz7n9ApdeLyACgghIUbEhVowVOxqN0RhLjJpgDfYYuybGoPGn2BLRWIgVCyq2SBGlKCBNFOm9t9vv9/fHzMLs7Nm9Z8+W5+zu5/16zWvvPbsz892zu8/MM0/rIElSUekAWwJbNT5uBSwBNgcWAJvW/18KbAIsrD+3EFjW+Nyy+uvHYwtgBbASWAvcXr9+c/3xDmBN/fkVwDrgtvpzt9bbLaNvnTvHmUeSJM0AndIBJEmzTeYB2wM7ATsCOzCystysNG/J7L4erWFkhft64DrgGuAq4Nr643XQubZQTkmSNA6z+eZFkjTpsoiqcrwT91SWd64/7gjci6oiPd7W4cmynqriOh6hapFeCCwGNprsUOO0hqqifRVVZfvqersWuBK4BPgzdG4f7QCSJGnqWZmWJLVkCbBHl+0+VBXpybx23AncBNxYbzc0/n9H/fnVVBXkNVTdq1cBd3FP9+tbqo+TWbnMfKqu5QCbAfOoKtmLgUXAxlTvw+b15zfvYdt48vIB1Xv1Z+6uXA/bLoXOqkk+nyRJarAyLUlzUhYCuwJ71luz0rwz/V8f1lO1pl5B1bJ6GVWL6vXcU2G+6Z6PnZX9fw8zTYbGeW8ObANsR9Wav239cTuqhxXb1/+eP4GTrad6/4cq1xcDFwLnAxdY0ZYkaeKsTEvSrJcdgf3qbf/6430Zf1fstVTdjK9geGX5ynq7HLgaOmsnJ/dclnlUlex2hXs51UOQoW1xHwdfR1XBPpeq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X2rdsFwNeXLpZJKkuSz7QL7fZebv30AeWTqdJEma0/I4yOWtm5T/hWxVOpkkSZUcCjmrS6X6u5A9SqeTJElzShZBPtpa8uoWyAtLJ5MkaaTMh7wcclWrQr0aclQ13lqSJGlK5V6QU1s3I7+A7FI6mSRJY8smkHdB7mhdx26GHAlZUjqhJEmalfKkelbUoZuPVZB/gswrnUySpN5lB8hnukxSdjHk6aXTSZKkWSPz6yf56xo3HJdDHl46mSRJ/ctekGO7jKf+CWTv0ukkSdKMlu0gP23dZBzv+DJJ0uyRQyHntK51qyAfqLqGS5IkjUsOgVzZWjv6g3brliTNPlkAOaKeULNZqb7S9aklSVKP0qlvKFY3biauh/xF6WSSJE2tbFXP8L2OkZNt7lc6nSRJGljZFPL11g3ELyHLSyeTJGn65EGQX7Wuh2sgR1cVbkmSpLtlX8ifWt26P1x1fZMkaa7JPMjftVayCOQayEvs+i1JkoA8sTVO7FbIc0qnkiSpvGxRd/1uL6V1OuShpdNJkqRi8obWDcJZkN1Kp5IkabDkQMjJrQr1Osj/g2xWOp0kSZo2WQT5XOum4AfeEEiSNJp0IIdDLmtdP6+uZv2WJEmzXLauJxZr3gh82GWvJEnqRTaF/Hs9KVnzWvptyI6l00mSpCmRPSEXNi78qyB/UzqVJEkzT/aH/LpVob4DciRkful0kiRp0uQJrYnGboA8unQqSZJmrsyDvAJyW6tSfQbkAaXTSZKkCcsrWt3RzoHsWjqVJEmzQ3aEfKtVoV4N+SBkSel0kiRp3LIA8unWxf27kGWlk0mSNPvk+ZBrW9fdC+0JJmmyuMi9NC2yLine truncated
|
||||
}
|
||||
},
|
||||
"cell_type": "markdown",
|
||||
"id": "26b56c81",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<div>\n",
|
||||
"<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA9MAAANWCAYAAAD9cN8uAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAewgAAHsIBbtB1PgAAABl0RVh0U29mdHdhcmUAd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dZBzv+DJJ0uyRQyHntK51qyAfqLqGS5IkjUsOgVzZWjv6g3brliTNPlkAOaKeULNZqb7S9aklSVKP0qlvKFY3biauh/xF6WSSJE2tbFXP8L2OkZNt7lc6nSRJGljZFPL11g3ELyHLSyeTJGn65EGQX7Wuh2sgR1cVbkmSpLtlX8ifWt26P1x1fZMkaa7JPMjftVayCOQayEvs+i1JkoA8sTVO7FbIc0qnkiSpvGxRd/1uL6V1OuShpdNJkqRi8obWDcJZkN1Kp5IkabDkQMjJrQr1Osj/g2xWOp0kSZo2WQT5XOum4AfeEEiSNJp0IIdDLmtdP6+uZv2WJEmzXLauJxZr3gh82GWvJEnqRTaF/Hs9KVnzWvptyI6l00mSpCmRPSEXNi78qyB/UzqVJEkzT/aH/LpVob4DciRkful0kiRp0uQJrYnGboA8unQqSZJmrsyDvAJyW6tSfQbkAaXTSZKkCcsrWt3RzoHsWjqVJEmzQ3aEfKtVoV4N+SBkSel0kiRp3LIA8unWxf27kGWlk0mSNPvk+ZBrWLine truncated
|
||||
"</div>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "4de15781",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"code = quote\n",
|
||||
" using MPI\n",
|
||||
" MPI.Init()\n",
|
||||
" comm = MPI.COMM_WORLD\n",
|
||||
" nranks = MPI.Comm_size(comm)\n",
|
||||
" rank = MPI.Comm_rank(comm)\n",
|
||||
" root = 0\n",
|
||||
" buffer = Ref(0)\n",
|
||||
" if rank == root\n",
|
||||
" buffer[] = 20\n",
|
||||
" println(\"[rank $rank] I am sending: $(buffer[])\")\n",
|
||||
" end \n",
|
||||
" MPI.Bcast!(buffer,comm;root)\n",
|
||||
" println(\"[rank $rank] I have received: $(buffer[])\")\n",
|
||||
"end\n",
|
||||
"run(`$(mpiexec()) -np 4 julia --project=. -e $code`);"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "e83be96d",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Communicators\n",
|
||||
"\n",
|
||||
"A key component in MPI programming are so-called communicators. A communicator object has to main purposes:\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"1. To provide an isolated communication context\n",
|
||||
"2. To define a group of processes\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"### Communication context\n",
|
||||
"\n",
|
||||
"When you write an MPI program it is very likely that you are going to use libraries that also use MPI to send messages. Ideally, these libraries should not interfere with application messages. Using tags to isolate the messages send by your application does not solve the problem. MPI communicators fix this problem as they provided an isolated communication context. For instance, `MPI_SEND` and `MPI_RECV` specify a communicator. `MPI_RECV` can only receive messages sent to same communicator. The same is also true for collective communication directives. If two libraries use different communicators, their message will never interfere. In particular it is recommended to never use the default communicator, `MPI_COMM_WORLD`, directly when working with other libraries. A new isolated communicator can be created with `MPI_Comm_dup`.\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"### Groups of processes\n",
|
||||
"\n",
|
||||
"On the other hand, imagine that we want to use an MPI communication directive like `MPI_Gather`, but we only want a subset of the processes to participate in the operation. So far, we have used always the default communication `MPI_COMM_WORLD`, which represents all processes. Thus, by using this communicator, we are including all processes in the operation. We can create other communicators that contain only a subset of processes. To this end, we can use function `MPI_Comm_split`.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "556ca223",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## MPI_Comm_dup\n",
|
||||
"\n",
|
||||
"Duplicate a given communicator, creating a new one with an new communication context.\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"In Julia:\n",
|
||||
"```julia\n",
|
||||
"newcomm = MPI.Comm_dup(comm)\n",
|
||||
"```\n",
|
||||
"\n",
|
||||
"In C:\n",
|
||||
"```c\n",
|
||||
"int MPI_Comm_dup(MPI_Comm comm, MPI_Comm *newcomm)\n",
|
||||
"```"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "9acfb792",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Example\n",
|
||||
"\n",
|
||||
"Send value 2 from rank 2 to rank 3. Then send value 1 also from rank 2 to rank 3. Note that we are using 2 different communicators for each send receive pair in such a way that we first receive value 1 and then value 2, even if this not was the other in which the data was sent. Try also to define `comm2 = comm` and see how the result will change."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "e50d44f6",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"code = quote\n",
|
||||
" using MPI\n",
|
||||
" MPI.Init()\n",
|
||||
" comm = MPI.COMM_WORLD\n",
|
||||
" # We create a new communicator\n",
|
||||
" comm2 = MPI.Comm_dup(comm)\n",
|
||||
" rank = MPI.Comm_rank(comm)\n",
|
||||
" if rank == 2\n",
|
||||
" sndbuf = [2]\n",
|
||||
" req1 = MPI.Isend(sndbuf, comm2; dest=3, tag=0)\n",
|
||||
" sndbuf = [1]\n",
|
||||
" req2 = MPI.Isend(sndbuf, comm; dest=3, tag=0)\n",
|
||||
" MPI.Wait(req2)\n",
|
||||
" MPI.Wait(req1)\n",
|
||||
" end\n",
|
||||
" if rank == 3\n",
|
||||
" rcvbuf = zeros(Int,1)\n",
|
||||
" MPI.Recv!(rcvbuf, comm; source=2, tag=0)\n",
|
||||
" @show rcvbuf\n",
|
||||
" MPI.Recv!(rcvbuf, comm2; source=2, tag=0)\n",
|
||||
" @show rcvbuf\n",
|
||||
" end\n",
|
||||
"end\n",
|
||||
"run(`$(mpiexec()) -np 4 julia --project=. -e $code`);"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "5e1b13eb",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## MPI_Comm_split\n",
|
||||
"\n",
|
||||
"Split a given communicator.\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"In Julia:\n",
|
||||
"\n",
|
||||
"```julia\n",
|
||||
"newcomm = MPI.Comm_split(comm, color, key)\n",
|
||||
"```\n",
|
||||
"\n",
|
||||
"In C:\n",
|
||||
"```c\n",
|
||||
"int MPI_Comm_split(MPI_Comm comm, int color, int key,\n",
|
||||
" MPI_Comm *newcomm)\n",
|
||||
"```\n",
|
||||
"\n",
|
||||
"There are two key parameters:\n",
|
||||
"\n",
|
||||
"- `color`: all processes with the same color will be grouped in the same new communicator.\n",
|
||||
"- `key`: The processes will be ranked in the new communicator according to key, breaking ties with the rank in the old communicator. \n",
|
||||
"\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "2b128840",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Example\n",
|
||||
"\n",
|
||||
"Create two groups of processes, one for processes with rank id even, and another for the rest. Note that the rank id will be function of the given communicator."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "b18cb74d",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"code = quote\n",
|
||||
" using MPI\n",
|
||||
" MPI.Init()\n",
|
||||
" comm = MPI.COMM_WORLD\n",
|
||||
" rank = MPI.Comm_rank(comm)\n",
|
||||
" color = mod(rank,2)\n",
|
||||
" key = 0\n",
|
||||
" newcomm = MPI.Comm_split(comm, color, key)\n",
|
||||
" newrank = MPI.Comm_rank(newcomm)\n",
|
||||
" println(\"Hello, I am rank $rank in world and rank $newrank in group $color.\")\n",
|
||||
"end\n",
|
||||
"run(`$(mpiexec()) -np 4 julia --project=. -e $code`);"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "b22e4bf4",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Example\n",
|
||||
"\n",
|
||||
"Processes with odd rank id generate a random integer. Sum all these integers and send them to the first process with odd rank id. Note that we are using a new communicator to perform the reduction."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "4c0e504b",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"code = quote\n",
|
||||
" using MPI\n",
|
||||
" MPI.Init()\n",
|
||||
" comm = MPI.COMM_WORLD\n",
|
||||
" rank = MPI.Comm_rank(comm)\n",
|
||||
" color = mod(rank,2)\n",
|
||||
" key = 0\n",
|
||||
" newcomm = MPI.Comm_split(comm, color, key)\n",
|
||||
" # Only odd rank ids will execute this\n",
|
||||
" if color == 1\n",
|
||||
" newrank = MPI.Comm_rank(newcomm)\n",
|
||||
" newroot = 0\n",
|
||||
" sndbuf = [rand(1:4)]\n",
|
||||
" if newrank == newroot\n",
|
||||
" rcvbuf = [0]\n",
|
||||
" else\n",
|
||||
" rcvbuf = nothing\n",
|
||||
" end\n",
|
||||
" println(\"[rank $rank, newrank $newrank] I am contributing with $sndbuf\")\n",
|
||||
" MPI.Reduce!(sndbuf, rcvbuf, +, newcomm;root=newroot)\n",
|
||||
" println(\"[rank $rank, newrank $newrank] The sum is $rcvbuf\")\n",
|
||||
" end\n",
|
||||
"end\n",
|
||||
"run(`$(mpiexec()) -np 4 julia --project=. -e $code`);"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "d465ebce",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Try to run the code without splitting the communicator. I.e., replace `newcomm = MPI.Comm_split(comm, color, key)` with `newcomm = comm`. Try to figure out what will happen before executing the code."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "d334aea1",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Conclusion\n",
|
||||
"\n",
|
||||
"- MPI also defines operations involving several processes called, collective operations.\n",
|
||||
"- These are provided both for convenience and performance.\n",
|
||||
"- The semantics are equivalent to \"standard mode\" `MPI_Send`, but there are also non-blocking versions (not discussed in this notebook).\n",
|
||||
"- Discovering message sizes is often done by communicating the message size, instead of using `MPI_Probe`.\n",
|
||||
"- Finally, we discussed MPI communicators. They provide two key features: isolated communication context and creating groups of processes. They are useful, for instance, to combine different libraries using MPI in the same application, and to use collective operations in a subset of the processes.\n",
|
||||
"\n",
|
||||
"After learning this material and the previous MPI notebook, you have a solid basis to start implementing sophisticated parallel algorithms using MPI."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "843b40cd",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Exercises"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "5c2045d9",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Exercise 1\n",
|
||||
"\n",
|
||||
"Implement the parallel matrix-matrix multiplication (Algorithm 3) using MPI collectives instead of point-to-point communication. I.e., this is the same exercise as in previous notebook, but using different functions for communication."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "5e8f6e6a",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# License\n",
|
||||
"\n",
|
||||
"This notebook is part of the course [Programming Large Scale Parallel Systems](https://www.francescverdugo.com/XM_40017) at Vrije Universiteit Amsterdam and may be used under a [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) license."
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Julia 1.11.6",
|
||||
"language": "julia",
|
||||
"name": "julia-1.11"
|
||||
},
|
||||
"language_info": {
|
||||
"file_extension": ".jl",
|
||||
"mimetype": "application/julia",
|
||||
"name": "julia",
|
||||
"version": "1.11.6"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 5
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>MPI (collectives) · XM_40017</title><meta name="title" content="MPI (collectives) · XM_40017"/><meta property="og:title" content="MPI (collectives) · XM_40017"/><meta property="twitter:title" content="MPI (collectives) · XM_40017"/><meta name="description" content="Documentation for XM_40017."/><meta property="og:description" content="Documentation for XM_40017."/><meta property="twitter:description" content="Documentation for XM_40017."/><meta property="og:url" content="https://fverdugo.github.io/XM_40017/mpi_collectives/"/><meta property="twitter:url" content="https://fverdugo.github.io/XM_40017/mpi_collectives/"/><link rel="canonical" href="https://fverdugo.github.io/XM_40017/mpi_collectives/"/><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../search_index.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script><link href="../assets/favicon.ico" rel="icon" type="image/x-icon"/><script src="../assets/iframeResizer.min.js"></script><link href="../assets/custom.css" rel="stylesheet" type="text/css"/></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="../"><img src="../assets/logo.png" alt="XM_40017 logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../">XM_40017</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li><a class="tocitem" href="../getting_started_with_julia/">Getting started</a></li><li><span class="tocitem">Notebooks</span><ul><li><a class="tocitem" href="../julia_basics/">Julia Basics</a></li><li><a class="tocitem" href="../julia_async/">Asynchronous programming in Julia</a></li><li><a class="tocitem" href="../julia_distributed/">Distributed computing in Julia</a></li><li><a class="tocitem" href="../matrix_matrix/">Matrix-matrix multiplication</a></li><li><a class="tocitem" href="../julia_mpi/">MPI (point-to-point)</a></li><li class="is-active"><a class="tocitem" href>MPI (collectives)</a></li><li><a class="tocitem" href="../jacobi_method/">Jacobi method</a></li><li><a class="tocitem" href="../asp/">All pairs of shortest paths</a></li><li><a class="tocitem" href="../LEQ/">Gaussian elimination</a></li><li><a class="tocitem" href="../tsp/">Traveling salesperson problem</a></li></ul></li><li><a class="tocitem" href="../solutions_for_all_notebooks/">Solutions</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-butLine truncated
|
||||
<header class="admonition-header">Tip</header>
|
||||
<div class="admonition-body">
|
||||
<ul>
|
||||
<li>
|
||||
Download this notebook and run it locally on your machine [highly recommended]. Click <a href="https://www.francescverdugo.com/XM_40017/dev/mpi_collectives.ipynb" download>here</a>.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div><iframe id="notebook" src="../mpi_collectives_src/" style="width:100%"></iframe>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function(){
|
||||
var myIframe = document.getElementById("notebook");
|
||||
iFrameResize({log:true}, myIframe);
|
||||
});
|
||||
</script></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../julia_mpi/">« MPI (point-to-point)</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="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.14.1 on <span class="colophon-date" title="Wednesday 24 September 2025 05:37">Wednesday 24 September 2025</span>. Using Julia version 1.11.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
|
||||
@@ -1,17 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>- · XM_40017</title><meta name="title" content="- · XM_40017"/><meta property="og:title" content="- · XM_40017"/><meta property="twitter:title" content="- · XM_40017"/><meta name="description" content="Documentation for XM_40017."/><meta property="og:description" content="Documentation for XM_40017."/><meta property="twitter:description" content="Documentation for XM_40017."/><meta property="og:url" content="https://fverdugo.github.io/XM_40017/mpi_tutorial/"/><meta property="twitter:url" content="https://fverdugo.github.io/XM_40017/mpi_tutorial/"/><link rel="canonical" href="https://fverdugo.github.io/XM_40017/mpi_tutorial/"/><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../search_index.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script><link href="../assets/favicon.ico" rel="icon" type="image/x-icon"/><script src="../assets/iframeResizer.min.js"></script><link href="../assets/custom.css" rel="stylesheet" type="text/css"/></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="../"><img src="../assets/logo.png" alt="XM_40017 logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../">XM_40017</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li><a class="tocitem" href="../getting_started_with_julia/">Getting started</a></li><li><span class="tocitem">Notebooks</span><ul><li><a class="tocitem" href="../julia_basics/">Julia Basics</a></li><li><a class="tocitem" href="../julia_async/">Asynchronous programming in Julia</a></li><li><a class="tocitem" href="../julia_distributed/">Distributed computing in Julia</a></li><li><a class="tocitem" href="../matrix_matrix/">Matrix-matrix multiplication</a></li><li><a class="tocitem" href="../julia_mpi/">MPI (point-to-point)</a></li><li><a class="tocitem" href="../mpi_collectives/">MPI (collectives)</a></li><li><a class="tocitem" href="../jacobi_method/">Jacobi method</a></li><li><a class="tocitem" href="../asp/">All pairs of shortest paths</a></li><li><a class="tocitem" href="../LEQ/">Gaussian elimination</a></li><li><a class="tocitem" href="../tsp/">Traveling salesperson problem</a></li></ul></li><li><a class="tocitem" href="../solutions_for_all_notebooks/">Solutions</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobileLine truncated
|
||||
<header class="admonition-header">Tip</header>
|
||||
<div class="admonition-body">
|
||||
<ul>
|
||||
<li>
|
||||
Download this notebook and run it locally on your machine [highly recommended]. Click <a href="https://www.francescverdugo.com/XM_40017/dev/mpi_tutorial.ipynb" download>here</a>.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div><iframe id="notebook" src="../mpi_tutorial_src/" style="width:100%"></iframe>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function(){
|
||||
var myIframe = document.getElementById("notebook");
|
||||
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="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.14.1 on <span class="colophon-date" title="Wednesday 24 September 2025 05:37">Wednesday 24 September 2025</span>. Using Julia version 1.11.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
|
||||
@@ -1,17 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>- · XM_40017</title><meta name="title" content="- · XM_40017"/><meta property="og:title" content="- · XM_40017"/><meta property="twitter:title" content="- · XM_40017"/><meta name="description" content="Documentation for XM_40017."/><meta property="og:description" content="Documentation for XM_40017."/><meta property="twitter:description" content="Documentation for XM_40017."/><meta property="og:url" content="https://fverdugo.github.io/XM_40017/notebook-hello/"/><meta property="twitter:url" content="https://fverdugo.github.io/XM_40017/notebook-hello/"/><link rel="canonical" href="https://fverdugo.github.io/XM_40017/notebook-hello/"/><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../search_index.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script><link href="../assets/favicon.ico" rel="icon" type="image/x-icon"/><script src="../assets/iframeResizer.min.js"></script><link href="../assets/custom.css" rel="stylesheet" type="text/css"/></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="../"><img src="../assets/logo.png" alt="XM_40017 logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../">XM_40017</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li><a class="tocitem" href="../getting_started_with_julia/">Getting started</a></li><li><span class="tocitem">Notebooks</span><ul><li><a class="tocitem" href="../julia_basics/">Julia Basics</a></li><li><a class="tocitem" href="../julia_async/">Asynchronous programming in Julia</a></li><li><a class="tocitem" href="../julia_distributed/">Distributed computing in Julia</a></li><li><a class="tocitem" href="../matrix_matrix/">Matrix-matrix multiplication</a></li><li><a class="tocitem" href="../julia_mpi/">MPI (point-to-point)</a></li><li><a class="tocitem" href="../mpi_collectives/">MPI (collectives)</a></li><li><a class="tocitem" href="../jacobi_method/">Jacobi method</a></li><li><a class="tocitem" href="../asp/">All pairs of shortest paths</a></li><li><a class="tocitem" href="../LEQ/">Gaussian elimination</a></li><li><a class="tocitem" href="../tsp/">Traveling salesperson problem</a></li></ul></li><li><a class="tocitem" href="../solutions_for_all_notebooks/">Solutions</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-Line truncated
|
||||
<header class="admonition-header">Tip</header>
|
||||
<div class="admonition-body">
|
||||
<ul>
|
||||
<li>
|
||||
Download this notebook and run it locally on your machine [highly recommended]. Click <a href="https://www.francescverdugo.com/XM_40017/dev/notebook-hello.ipynb" download>here</a>.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div><iframe id="notebook" src="../notebook-hello_src/" style="width:100%"></iframe>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function(){
|
||||
var myIframe = document.getElementById("notebook");
|
||||
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="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.14.1 on <span class="colophon-date" title="Wednesday 24 September 2025 05:37">Wednesday 24 September 2025</span>. Using Julia version 1.11.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
|
||||
@@ -1,17 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>- · XM_40017</title><meta name="title" content="- · XM_40017"/><meta property="og:title" content="- · XM_40017"/><meta property="twitter:title" content="- · XM_40017"/><meta name="description" content="Documentation for XM_40017."/><meta property="og:description" content="Documentation for XM_40017."/><meta property="twitter:description" content="Documentation for XM_40017."/><meta property="og:url" content="https://fverdugo.github.io/XM_40017/pdes/"/><meta property="twitter:url" content="https://fverdugo.github.io/XM_40017/pdes/"/><link rel="canonical" href="https://fverdugo.github.io/XM_40017/pdes/"/><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../search_index.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script><link href="../assets/favicon.ico" rel="icon" type="image/x-icon"/><script src="../assets/iframeResizer.min.js"></script><link href="../assets/custom.css" rel="stylesheet" type="text/css"/></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="../"><img src="../assets/logo.png" alt="XM_40017 logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../">XM_40017</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li><a class="tocitem" href="../getting_started_with_julia/">Getting started</a></li><li><span class="tocitem">Notebooks</span><ul><li><a class="tocitem" href="../julia_basics/">Julia Basics</a></li><li><a class="tocitem" href="../julia_async/">Asynchronous programming in Julia</a></li><li><a class="tocitem" href="../julia_distributed/">Distributed computing in Julia</a></li><li><a class="tocitem" href="../matrix_matrix/">Matrix-matrix multiplication</a></li><li><a class="tocitem" href="../julia_mpi/">MPI (point-to-point)</a></li><li><a class="tocitem" href="../mpi_collectives/">MPI (collectives)</a></li><li><a class="tocitem" href="../jacobi_method/">Jacobi method</a></li><li><a class="tocitem" href="../asp/">All pairs of shortest paths</a></li><li><a class="tocitem" href="../LEQ/">Gaussian elimination</a></li><li><a class="tocitem" href="../tsp/">Traveling salesperson problem</a></li></ul></li><li><a class="tocitem" href="../solutions_for_all_notebooks/">Solutions</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active">Line truncated
|
||||
<header class="admonition-header">Tip</header>
|
||||
<div class="admonition-body">
|
||||
<ul>
|
||||
<li>
|
||||
Download this notebook and run it locally on your machine [highly recommended]. Click <a href="https://www.francescverdugo.com/XM_40017/dev/pdes.ipynb" download>here</a>.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div><iframe id="notebook" src="../pdes_src/" style="width:100%"></iframe>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function(){
|
||||
var myIframe = document.getElementById("notebook");
|
||||
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="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.14.1 on <span class="colophon-date" title="Wednesday 24 September 2025 05:37">Wednesday 24 September 2025</span>. Using Julia version 1.11.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
|
||||
@@ -1,3 +0,0 @@
|
||||
var documenterSearchIndex = {"docs":
|
||||
[{"location":"getting_started_with_julia/#Getting-started","page":"Getting started","title":"Getting started","text":"","category":"section"},{"location":"getting_started_with_julia/#Introduction","page":"Getting started","title":"Introduction","text":"","category":"section"},{"location":"getting_started_with_julia/","page":"Getting started","title":"Getting started","text":"The programming of this course will be done using the Julia programming language. Thus, we start by explaining how to get up and running with Julia. After studying this page, you will be able to:","category":"page"},{"location":"getting_started_with_julia/","page":"Getting started","title":"Getting started","text":"Use the Julia REPL,\nRun serial and parallel code,\nInstall and manage Julia packages.","category":"page"},{"location":"getting_started_with_julia/#Why-Julia?","page":"Getting started","title":"Why Julia?","text":"","category":"section"},{"location":"getting_started_with_julia/","page":"Getting started","title":"Getting started","text":"Courses related with high-performance computing (HPC) often use languages such as C, C++, or Fortran. We use Julia instead to make the course accessible to a wider set of students, including the ones that have no experience with C/C++ or Fortran, but are willing to learn parallel programming. Julia is a relatively new programming language specifically designed for scientific computing. It combines a high-level syntax close to interpreted languages like Python with the performance of compiled languages like C, C++, or Fortran. Thus, Julia will allow us to write efficient parallel algorithms with a syntax that is convenient in a teaching setting. In addition, Julia provides easy access to different programming models to write distributed algorithms, which will be useful to learn and experiment with them.","category":"page"},{"location":"getting_started_with_julia/","page":"Getting started","title":"Getting started","text":"tip: Tip\nYou can run the code in this link to learn how Julia compares to other languages (C and Python) in terms of performance.","category":"page"},{"location":"getting_started_with_julia/#Installing-Julia","page":"Getting started","title":"Installing Julia","text":"","category":"section"},{"location":"getting_started_with_julia/","page":"Getting started","title":"Getting started","text":"This is a tutorial-like page. Follow these steps before you continue reading the document.","category":"page"},{"location":"getting_started_with_julia/","page":"Getting started","title":"Getting started","text":"Download and install Julia from julialang.org;\nFollow the specific instructions for your operating system: Windows, MacOS, or Linux\nDownload and install VSCode and its Julia extension;","category":"page"},{"location":"getting_started_with_julia/#The-Julia-REPL","page":"Getting started","title":"The Julia REPL","text":"","category":"section"},{"location":"getting_started_with_julia/#Starting-Julia","page":"Getting started","title":"Starting Julia","text":"","category":"section"},{"location":"getting_started_with_julia/","page":"Getting started","title":"Getting started","text":"There are several ways of opening Julia depending on your operating system and your IDE, but it is usually as simple as launching the Julia app. With VSCode, open a folder (File > Open Folder). Then, press Ctrl+Shift+P to open the command bar, and execute Julia: Start REPL. If this does not work, make sure you have the Julia extension for VSCode installed. Independently of the method you use, opening Julia results in a window with some text ending with:","category":"page"},{"location":"getting_started_with_julia/","page":"Getting started","title":"Getting started","text":"julia>","category":"page"},{"location":"getting_started_with_julia/","page":"Getting started","title":"Getting started","text":"You have just opened the Julia read-evaluate-print loop, or simply the Julia REPL. Congrats! You will spend most of time using the REPL, when working in Julia. The REPL is a console waiting for user input. Just as in other consoles, the string of text right before the input area (julia> in the case) is called the command prompt or simply the prompt.","category":"page"},{"location":"getting_started_with_julia/#Basic-usage","page":"Getting started","title":"Basic usage","text":"","category":"section"},{"location":"getting_started_with_julia/","page":"Getting started","title":"Getting started","text":"The usage of the REPL is as follows:","category":"page"},{"location":"getting_started_with_julia/","page":"Getting started","title":"Getting started","text":"You write some input\npress enter\nyou get the output","category":"page"},{"location":"getting_started_with_julia/","page":"Getting started","title":"Getting started","text":"For instance, try this","category":"page"},{"location":"getting_started_with_julia/","page":"Getting started","title":"Getting started","text":"julia> 1 + 1","category":"page"},{"location":Line truncated
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
var DOCUMENTER_CURRENT_VERSION = "dev";
|
||||
var DOCUMENTER_IS_DEV_VERSION = true;
|
||||
@@ -1,17 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>- · XM_40017</title><meta name="title" content="- · XM_40017"/><meta property="og:title" content="- · XM_40017"/><meta property="twitter:title" content="- · XM_40017"/><meta name="description" content="Documentation for XM_40017."/><meta property="og:description" content="Documentation for XM_40017."/><meta property="twitter:description" content="Documentation for XM_40017."/><meta property="og:url" content="https://fverdugo.github.io/XM_40017/solutions/"/><meta property="twitter:url" content="https://fverdugo.github.io/XM_40017/solutions/"/><link rel="canonical" href="https://fverdugo.github.io/XM_40017/solutions/"/><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../search_index.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script><link href="../assets/favicon.ico" rel="icon" type="image/x-icon"/><script src="../assets/iframeResizer.min.js"></script><link href="../assets/custom.css" rel="stylesheet" type="text/css"/></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="../"><img src="../assets/logo.png" alt="XM_40017 logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../">XM_40017</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li><a class="tocitem" href="../getting_started_with_julia/">Getting started</a></li><li><span class="tocitem">Notebooks</span><ul><li><a class="tocitem" href="../julia_basics/">Julia Basics</a></li><li><a class="tocitem" href="../julia_async/">Asynchronous programming in Julia</a></li><li><a class="tocitem" href="../julia_distributed/">Distributed computing in Julia</a></li><li><a class="tocitem" href="../matrix_matrix/">Matrix-matrix multiplication</a></li><li><a class="tocitem" href="../julia_mpi/">MPI (point-to-point)</a></li><li><a class="tocitem" href="../mpi_collectives/">MPI (collectives)</a></li><li><a class="tocitem" href="../jacobi_method/">Jacobi method</a></li><li><a class="tocitem" href="../asp/">All pairs of shortest paths</a></li><li><a class="tocitem" href="../LEQ/">Gaussian elimination</a></li><li><a class="tocitem" href="../tsp/">Traveling salesperson problem</a></li></ul></li><li><a class="tocitem" href="../solutions_for_all_notebooks/">Solutions</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li claLine truncated
|
||||
<header class="admonition-header">Tip</header>
|
||||
<div class="admonition-body">
|
||||
<ul>
|
||||
<li>
|
||||
Download this notebook and run it locally on your machine [highly recommended]. Click <a href="https://www.francescverdugo.com/XM_40017/dev/solutions.ipynb" download>here</a>.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div><iframe id="notebook" src="../solutions_src/" style="width:100%"></iframe>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function(){
|
||||
var myIframe = document.getElementById("notebook");
|
||||
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="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.14.1 on <span class="colophon-date" title="Wednesday 24 September 2025 05:37">Wednesday 24 September 2025</span>. Using Julia version 1.11.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
|
||||
@@ -1,346 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Solutions · XM_40017</title><meta name="title" content="Solutions · XM_40017"/><meta property="og:title" content="Solutions · XM_40017"/><meta property="twitter:title" content="Solutions · XM_40017"/><meta name="description" content="Documentation for XM_40017."/><meta property="og:description" content="Documentation for XM_40017."/><meta property="twitter:description" content="Documentation for XM_40017."/><meta property="og:url" content="https://fverdugo.github.io/XM_40017/solutions_for_all_notebooks/"/><meta property="twitter:url" content="https://fverdugo.github.io/XM_40017/solutions_for_all_notebooks/"/><link rel="canonical" href="https://fverdugo.github.io/XM_40017/solutions_for_all_notebooks/"/><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../search_index.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script><link href="../assets/favicon.ico" rel="icon" type="image/x-icon"/><script src="../assets/iframeResizer.min.js"></script><link href="../assets/custom.css" rel="stylesheet" type="text/css"/></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="../"><img src="../assets/logo.png" alt="XM_40017 logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../">XM_40017</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li><a class="tocitem" href="../getting_started_with_julia/">Getting started</a></li><li><span class="tocitem">Notebooks</span><ul><li><a class="tocitem" href="../julia_basics/">Julia Basics</a></li><li><a class="tocitem" href="../julia_async/">Asynchronous programming in Julia</a></li><li><a class="tocitem" href="../julia_distributed/">Distributed computing in Julia</a></li><li><a class="tocitem" href="../matrix_matrix/">Matrix-matrix multiplication</a></li><li><a class="tocitem" href="../julia_mpi/">MPI (point-to-point)</a></li><li><a class="tocitem" href="../mpi_collectives/">MPI (collectives)</a></li><li><a class="tocitem" href="../jacobi_method/">Jacobi method</a></li><li><a class="tocitem" href="../asp/">All pairs of shortest paths</a></li><li><a class="tocitem" href="../LEQ/">Gaussian elimination</a></li><li><a class="tocitem" href="../tsp/">Traveling salesperson problem</a></li></ul></li><li class="is-active"><a class="tocitem" href>Solutions</a><ul class="internal"><li><a class="tocitem" href="#Julia-Basics"><span>Julia Basics</span></a></li><li><a class="tocitem" href="#Asynchronous-programming-in-Julia"><span>Asynchronous programming in Julia</span></a></li><li><a class="tocitem" href="#Distributed-computing-in-Julia"><span>Distributed computing in Julia</span></a></li><li><a class="tocitem" href="#Matrix-matrix-multiplication"><span>Matrix-matrix multiplication</span></a></li><li><a class="tocitem" href="#MPI-(Point-to-Line truncated
|
||||
j = 1
|
||||
m = a[j]
|
||||
for (i,ai) in enumerate(a)
|
||||
if m < ai
|
||||
m = ai
|
||||
j = i
|
||||
end
|
||||
end
|
||||
(m,j)
|
||||
end</code></pre><h3 id="Exercise-2"><a class="docs-heading-anchor" href="#Exercise-2">Exercise 2</a><a id="Exercise-2-1"></a><a class="docs-heading-anchor-permalink" href="#Exercise-2" title="Permalink"></a></h3><pre><code class="language-julia hljs">ex2(f,g) = x -> f(x) + g(x)</code></pre><h3 id="Exercise-3"><a class="docs-heading-anchor" href="#Exercise-3">Exercise 3</a><a id="Exercise-3-1"></a><a class="docs-heading-anchor-permalink" href="#Exercise-3" title="Permalink"></a></h3><pre><code class="language-julia hljs">n = 1000
|
||||
x = LinRange(-1.7,0.7,n)
|
||||
y = LinRange(-1.2,1.2,n)
|
||||
values = zeros(n,n)
|
||||
for j in 1:n
|
||||
for i in 1:n
|
||||
values[i,j] = surprise(x[i],y[j])
|
||||
end
|
||||
end
|
||||
using GLMakie
|
||||
heatmap(x,y,values)</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><h2 id="Distributed-computing-in-Julia"><a class="docs-heading-anchor" href="#Distributed-computing-in-Julia">Distributed computing in Julia</a><a id="Distributed-computing-in-Julia-1"></a><a class="docs-heading-anchor-permalink" href="#Distributed-computing-in-Julia" title="Permalink"></a></h2><h3 id="Exercise-1-2"><a class="docs-heading-anchor" href="#Exercise-1-2">Exercise 1</a><a class="docs-heading-anchor-permalink" href="#Exercise-1-2" title="Permalink"></a></h3><pre><code class="language-julia hljs">f = () -> Channel{Int}(1)
|
||||
worker_ids = workers()
|
||||
chnls = [ RemoteChannel(f,w) for w in worker_ids ]
|
||||
@sync for (iw,w) in enumerate(worker_ids)
|
||||
@spawnat w begin
|
||||
chnl_snd = chnls[iw]
|
||||
if iw == 1
|
||||
chnl_rcv = chnls[end]
|
||||
msg = 2
|
||||
println("msg = $msg")
|
||||
put!(chnl_snd,msg)
|
||||
msg = take!(chnl_rcv)
|
||||
println("msg = $msg")
|
||||
else
|
||||
chnl_rcv = chnls[iw-1]
|
||||
msg = take!(chnl_rcv)
|
||||
msg += 1
|
||||
println("msg = $msg")
|
||||
put!(chnl_snd,msg)
|
||||
end
|
||||
end
|
||||
end</code></pre><p>This is another possible solution that does not use remote channels.</p><pre><code class="language-julia hljs">@everywhere function work(msg,iw,worker_ids)
|
||||
println("msg = $msg")
|
||||
if iw < length(worker_ids)
|
||||
inext = iw+1
|
||||
next = worker_ids[iw+1]
|
||||
@fetchfrom next work(msg+1,inext,worker_ids)
|
||||
else
|
||||
@fetchfrom worker_ids[1] println("msg = $msg")
|
||||
end
|
||||
return nothing
|
||||
end
|
||||
msg = 2
|
||||
iw = 1
|
||||
worker_ids = workers()
|
||||
@fetchfrom worker_ids[iw] work(msg,iw,worker_ids)</code></pre><h2 id="Matrix-matrix-multiplication"><a class="docs-heading-anchor" href="#Matrix-matrix-multiplication">Matrix-matrix multiplication</a><a id="Matrix-matrix-multiplication-1"></a><a class="docs-heading-anchor-permalink" href="#Matrix-matrix-multiplication" title="Permalink"></a></h2><h3 id="Exercise-1-3"><a class="docs-heading-anchor" href="#Exercise-1-3">Exercise 1</a><a class="docs-heading-anchor-permalink" href="#Exercise-1-3" title="Permalink"></a></h3><pre><code class="language-julia hljs">function matmul_dist_3!(C,A,B)
|
||||
m = size(C,1)
|
||||
n = size(C,2)
|
||||
l = size(A,2)
|
||||
@assert size(A,1) == m
|
||||
@assert size(B,2) == n
|
||||
@assert size(B,1) == l
|
||||
@assert mod(m,nworkers()) == 0
|
||||
nrows_w = div(m,nworkers())
|
||||
@sync for (iw,w) in enumerate(workers())
|
||||
lb = 1 + (iw-1)*nrows_w
|
||||
ub = iw*nrows_w
|
||||
A_w = A[lb:ub,:]
|
||||
ftr = @spawnat w begin
|
||||
C_w = similar(A_w)
|
||||
matmul_seq!(C_w,A_w,B)
|
||||
C_w
|
||||
end
|
||||
@async C[lb:ub,:] = fetch(ftr)
|
||||
end
|
||||
C
|
||||
end
|
||||
|
||||
@everywhere function matmul_seq!(C,A,B)
|
||||
m = size(C,1)
|
||||
n = size(C,2)
|
||||
l = size(A,2)
|
||||
@assert size(A,1) == m
|
||||
@assert size(B,2) == n
|
||||
@assert size(B,1) == l
|
||||
z = zero(eltype(C))
|
||||
for j in 1:n
|
||||
for i in 1:m
|
||||
Cij = z
|
||||
for k in 1:l
|
||||
@inbounds Cij = Cij + A[i,k]*B[k,j]
|
||||
end
|
||||
C[i,j] = Cij
|
||||
end
|
||||
end
|
||||
C
|
||||
end</code></pre><h2 id="MPI-(Point-to-point)"><a class="docs-heading-anchor" href="#MPI-(Point-to-point)">MPI (Point-to-point)</a><a id="MPI-(Point-to-point)-1"></a><a class="docs-heading-anchor-permalink" href="#MPI-(Point-to-point)" title="Permalink"></a></h2><h3 id="Exercise-1-4"><a class="docs-heading-anchor" href="#Exercise-1-4">Exercise 1</a><a class="docs-heading-anchor-permalink" href="#Exercise-1-4" title="Permalink"></a></h3><pre><code class="language-julia hljs">function matmul_mpi_3!(C,A,B)
|
||||
comm = MPI.COMM_WORLD
|
||||
rank = MPI.Comm_rank(comm)
|
||||
P = MPI.Comm_size(comm)
|
||||
if rank == 0
|
||||
N = size(A,1)
|
||||
myB = B
|
||||
for dest in 1:(P-1)
|
||||
MPI.Send(B,comm;dest)
|
||||
end
|
||||
else
|
||||
source = 0
|
||||
status = MPI.Probe(comm,MPI.Status;source)
|
||||
count = MPI.Get_count(status,eltype(B))
|
||||
N = Int(sqrt(count))
|
||||
myB = zeros(N,N)
|
||||
MPI.Recv!(myB,comm;source)
|
||||
end
|
||||
L = div(N,P)
|
||||
myA = zeros(L,N)
|
||||
if rank == 0
|
||||
lb = L*rank+1
|
||||
ub = L*(rank+1)
|
||||
myA[:,:] = view(A,lb:ub,:)
|
||||
for dest in 1:(P-1)
|
||||
lb = L*dest+1
|
||||
ub = L*(dest+1)
|
||||
MPI.Send(view(A,lb:ub,:),comm;dest)
|
||||
end
|
||||
else
|
||||
source = 0
|
||||
MPI.Recv!(myA,comm;source)
|
||||
end
|
||||
myC = myA*myB
|
||||
if rank == 0
|
||||
lb = L*rank+1
|
||||
ub = L*(rank+1)
|
||||
C[lb:ub,:] = myC
|
||||
for source in 1:(P-1)
|
||||
lb = L*source+1
|
||||
ub = L*(source+1)
|
||||
MPI.Recv!(view(C,lb:ub,:),comm;source)
|
||||
end
|
||||
else
|
||||
dest = 0
|
||||
MPI.Send(myC,comm;dest)
|
||||
end
|
||||
C
|
||||
end</code></pre><h3 id="Exercise-2-2"><a class="docs-heading-anchor" href="#Exercise-2-2">Exercise 2</a><a class="docs-heading-anchor-permalink" href="#Exercise-2-2" title="Permalink"></a></h3><pre><code class="language-julia hljs">using MPI
|
||||
MPI.Init()
|
||||
comm = MPI.COMM_WORLD
|
||||
rank = MPI.Comm_rank(comm)
|
||||
nranks = MPI.Comm_size(comm)
|
||||
buffer = Ref(0)
|
||||
if rank == 0
|
||||
msg = 2
|
||||
buffer[] = msg
|
||||
println("msg = $(buffer[])")
|
||||
MPI.Send(buffer,comm;dest=rank+1,tag=0)
|
||||
MPI.Recv!(buffer,comm;source=nranks-1,tag=0)
|
||||
println("msg = $(buffer[])")
|
||||
else
|
||||
dest = if (rank != nranks-1)
|
||||
rank+1
|
||||
else
|
||||
0
|
||||
end
|
||||
MPI.Recv!(buffer,comm;source=rank-1,tag=0)
|
||||
buffer[] += 1
|
||||
println("msg = $(buffer[])")
|
||||
MPI.Send(buffer,comm;dest,tag=0)
|
||||
end</code></pre><h2 id="MPI-(collectives)"><a class="docs-heading-anchor" href="#MPI-(collectives)">MPI (collectives)</a><a id="MPI-(collectives)-1"></a><a class="docs-heading-anchor-permalink" href="#MPI-(collectives)" title="Permalink"></a></h2><h3 id="Exercise-1-5"><a class="docs-heading-anchor" href="#Exercise-1-5">Exercise 1</a><a class="docs-heading-anchor-permalink" href="#Exercise-1-5" title="Permalink"></a></h3><pre><code class="language-julia hljs">function matmul_mpi_3!(C,A,B)
|
||||
comm = MPI.COMM_WORLD
|
||||
rank = MPI.Comm_rank(comm)
|
||||
P = MPI.Comm_size(comm)
|
||||
root = 0
|
||||
if rank == root
|
||||
N = size(A,1)
|
||||
Nref = Ref(N)
|
||||
else
|
||||
Nref = Ref(0)
|
||||
end
|
||||
MPI.Bcast!(Nref,comm;root)
|
||||
N = Nref[]
|
||||
if rank == root
|
||||
myB = B
|
||||
else
|
||||
myB = zeros(N,N)
|
||||
end
|
||||
MPI.Bcast!(myB,comm;root)
|
||||
L = div(N,P)
|
||||
# Tricky part
|
||||
# Julia works "col major"
|
||||
myAt = zeros(N,L)
|
||||
At = collect(transpose(A))
|
||||
MPI.Scatter!(At,myAt,comm;root)
|
||||
myCt = transpose(myB)*myAt
|
||||
Ct = similar(C)
|
||||
MPI.Gather!(myCt,Ct,comm;root)
|
||||
C .= transpose(Ct)
|
||||
C
|
||||
end</code></pre><p>This other solution uses a column partition instead of a row partition. It is more natural to work with column partitions in Julia if possible since matrices are in "col major" format. Note that we do not need all the auxiliary transposes anymore.</p><pre><code class="language-julia hljs">function matmul_mpi_3!(C,A,B)
|
||||
comm = MPI.COMM_WORLD
|
||||
rank = MPI.Comm_rank(comm)
|
||||
P = MPI.Comm_size(comm)
|
||||
root = 0
|
||||
if rank == root
|
||||
N = size(A,1)
|
||||
Nref = Ref(N)
|
||||
else
|
||||
Nref = Ref(0)
|
||||
end
|
||||
MPI.Bcast!(Nref,comm;root)
|
||||
N = Nref[]
|
||||
if rank == root
|
||||
myA = A
|
||||
else
|
||||
myA = zeros(N,N)
|
||||
end
|
||||
MPI.Bcast!(myA,comm;root)
|
||||
L = div(N,P)
|
||||
myB = zeros(N,L)
|
||||
MPI.Scatter!(B,myB,comm;root)
|
||||
myC = myA*myB
|
||||
MPI.Gather!(myC,C,comm;root)
|
||||
C
|
||||
end</code></pre><h2 id="Jacobi-method"><a class="docs-heading-anchor" href="#Jacobi-method">Jacobi method</a><a id="Jacobi-method-1"></a><a class="docs-heading-anchor-permalink" href="#Jacobi-method" title="Permalink"></a></h2><h3 id="Exercise-1-6"><a class="docs-heading-anchor" href="#Exercise-1-6">Exercise 1</a><a class="docs-heading-anchor-permalink" href="#Exercise-1-6" title="Permalink"></a></h3><pre><code class="language-julia hljs">function jacobi_mpi(n,niters)
|
||||
u, u_new = init(n,comm)
|
||||
load = length(u)-2
|
||||
rank = MPI.Comm_rank(comm)
|
||||
nranks = MPI.Comm_size(comm)
|
||||
nreqs = 2*((rank != 0) + (rank != (nranks-1)))
|
||||
reqs = MPI.MultiRequest(nreqs)
|
||||
for t in 1:niters
|
||||
ireq = 0
|
||||
if rank != 0
|
||||
neig_rank = rank-1
|
||||
u_snd = view(u,2:2)
|
||||
u_rcv = view(u,1:1)
|
||||
dest = neig_rank
|
||||
source = neig_rank
|
||||
ireq += 1
|
||||
MPI.Isend(u_snd,comm,reqs[ireq];dest)
|
||||
ireq += 1
|
||||
MPI.Irecv!(u_rcv,comm,reqs[ireq];source)
|
||||
end
|
||||
if rank != (nranks-1)
|
||||
neig_rank = rank+1
|
||||
u_snd = view(u,(load+1):(load+1))
|
||||
u_rcv = view(u,(load+2):(load+2))
|
||||
dest = neig_rank
|
||||
source = neig_rank
|
||||
ireq += 1
|
||||
MPI.Isend(u_snd,comm,reqs[ireq];dest)
|
||||
ireq += 1
|
||||
MPI.Irecv!(u_rcv,comm,reqs[ireq];source)
|
||||
end
|
||||
# Upload interior cells
|
||||
for i in 3:load
|
||||
u_new[i] = 0.5*(u[i-1]+u[i+1])
|
||||
end
|
||||
# Wait for the communications to finish
|
||||
MPI.Waitall(reqs)
|
||||
# Update boundaries
|
||||
for i in (2,load+1)
|
||||
u_new[i] = 0.5*(u[i-1]+u[i+1])
|
||||
end
|
||||
u, u_new = u_new, u
|
||||
end
|
||||
return u
|
||||
end</code></pre><h3 id="Exercise-2-3"><a class="docs-heading-anchor" href="#Exercise-2-3">Exercise 2</a><a class="docs-heading-anchor-permalink" href="#Exercise-2-3" title="Permalink"></a></h3><pre><code class="language-julia hljs">function jacobi_mpi(n,niters,tol,comm) # new tol arg
|
||||
u, u_new = init(n,comm)
|
||||
load = length(u)-2
|
||||
rank = MPI.Comm_rank(comm)
|
||||
nranks = MPI.Comm_size(comm)
|
||||
nreqs = 2*((rank != 0) + (rank != (nranks-1)))
|
||||
reqs = MPI.MultiRequest(nreqs)
|
||||
for t in 1:niters
|
||||
ireq = 0
|
||||
if rank != 0
|
||||
neig_rank = rank-1
|
||||
u_snd = view(u,2:2)
|
||||
u_rcv = view(u,1:1)
|
||||
dest = neig_rank
|
||||
source = neig_rank
|
||||
ireq += 1
|
||||
MPI.Isend(u_snd,comm,reqs[ireq];dest)
|
||||
ireq += 1
|
||||
MPI.Irecv!(u_rcv,comm,reqs[ireq];source)
|
||||
end
|
||||
if rank != (nranks-1)
|
||||
neig_rank = rank+1
|
||||
u_snd = view(u,(load+1):(load+1))
|
||||
u_rcv = view(u,(load+2):(load+2))
|
||||
dest = neig_rank
|
||||
source = neig_rank
|
||||
ireq += 1
|
||||
MPI.Isend(u_snd,comm,reqs[ireq];dest)
|
||||
ireq += 1
|
||||
MPI.Irecv!(u_rcv,comm,reqs[ireq];source)
|
||||
end
|
||||
MPI.Waitall(reqs)
|
||||
# Compute the max diff in the current
|
||||
# rank while doing the local update
|
||||
mydiff = 0.0
|
||||
for i in 2:load+1
|
||||
u_new[i] = 0.5*(u[i-1]+u[i+1])
|
||||
diff_i = abs(u_new[i] - u[i])
|
||||
mydiff = max(mydiff,diff_i)
|
||||
end
|
||||
# Now we need to find the global diff
|
||||
diff_ref = Ref(mydiff)
|
||||
MPI.Allreduce!(diff_ref,max,comm)
|
||||
diff = diff_ref[]
|
||||
# If global diff below tol, stop!
|
||||
if diff < tol
|
||||
return u_new
|
||||
end
|
||||
u, u_new = u_new, u
|
||||
end
|
||||
return u
|
||||
end</code></pre><h2 id="All-pairs-of-shortest-paths"><a class="docs-heading-anchor" href="#All-pairs-of-shortest-paths">All pairs of shortest paths</a><a id="All-pairs-of-shortest-paths-1"></a><a class="docs-heading-anchor-permalink" href="#All-pairs-of-shortest-paths" title="Permalink"></a></h2><h3 id="Exercise-1-7"><a class="docs-heading-anchor" href="#Exercise-1-7">Exercise 1</a><a class="docs-heading-anchor-permalink" href="#Exercise-1-7" title="Permalink"></a></h3><pre><code class="language-julia hljs">function floyd_iterations!(myC,comm)
|
||||
L = size(myC,1)
|
||||
N = size(myC,2)
|
||||
rank = MPI.Comm_rank(comm)
|
||||
P = MPI.Comm_size(comm)
|
||||
lb = L*rank+1
|
||||
ub = L*(rank+1)
|
||||
C_k = similar(myC,N)
|
||||
for k in 1:N
|
||||
if (lb<=k) && (k<=ub)
|
||||
# If I have the row, fill in the buffer
|
||||
myk = (k-lb)+1
|
||||
C_k[:] = view(myC,myk,:)
|
||||
end
|
||||
# We need to find out the owner of row k.
|
||||
# Easy since N is a multiple of P
|
||||
root = div(k-1,L)
|
||||
MPI.Bcast!(C_k,comm;root)
|
||||
# Now, we have the data dependencies and
|
||||
# we can do the updates locally
|
||||
for j in 1:N
|
||||
for i in 1:L
|
||||
myC[i,j] = min(myC[i,j],myC[i,k]+C_k[j])
|
||||
end
|
||||
end
|
||||
end
|
||||
myC
|
||||
end</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../tsp/">« Traveling salesperson problem</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="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.14.1 on <span class="colophon-date" title="Wednesday 24 September 2025 05:37">Wednesday 24 September 2025</span>. Using Julia version 1.11.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
|
||||
@@ -1,17 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Traveling salesperson problem · XM_40017</title><meta name="title" content="Traveling salesperson problem · XM_40017"/><meta property="og:title" content="Traveling salesperson problem · XM_40017"/><meta property="twitter:title" content="Traveling salesperson problem · XM_40017"/><meta name="description" content="Documentation for XM_40017."/><meta property="og:description" content="Documentation for XM_40017."/><meta property="twitter:description" content="Documentation for XM_40017."/><meta property="og:url" content="https://fverdugo.github.io/XM_40017/tsp/"/><meta property="twitter:url" content="https://fverdugo.github.io/XM_40017/tsp/"/><link rel="canonical" href="https://fverdugo.github.io/XM_40017/tsp/"/><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../search_index.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script><link href="../assets/favicon.ico" rel="icon" type="image/x-icon"/><script src="../assets/iframeResizer.min.js"></script><link href="../assets/custom.css" rel="stylesheet" type="text/css"/></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="../"><img src="../assets/logo.png" alt="XM_40017 logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../">XM_40017</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li><a class="tocitem" href="../getting_started_with_julia/">Getting started</a></li><li><span class="tocitem">Notebooks</span><ul><li><a class="tocitem" href="../julia_basics/">Julia Basics</a></li><li><a class="tocitem" href="../julia_async/">Asynchronous programming in Julia</a></li><li><a class="tocitem" href="../julia_distributed/">Distributed computing in Julia</a></li><li><a class="tocitem" href="../matrix_matrix/">Matrix-matrix multiplication</a></li><li><a class="tocitem" href="../julia_mpi/">MPI (point-to-point)</a></li><li><a class="tocitem" href="../mpi_collectives/">MPI (collectives)</a></li><li><a class="tocitem" href="../jacobi_method/">Jacobi method</a></li><li><a class="tocitem" href="../asp/">All pairs of shortest paths</a></li><li><a class="tocitem" href="../LEQ/">Gaussian elimination</a></li><li class="is-active"><a class="tocitem" href>Traveling salesperson problem</a></li></ul></li><li><a class="tocitem" href="../solutions_for_all_notebooks/">Solutions</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" idLine truncated
|
||||
<header class="admonition-header">Tip</header>
|
||||
<div class="admonition-body">
|
||||
<ul>
|
||||
<li>
|
||||
Download this notebook and run it locally on your machine [highly recommended]. Click <a href="https://www.francescverdugo.com/XM_40017/dev/tsp.ipynb" download>here</a>.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div><iframe id="notebook" src="../tsp_src/" style="width:100%"></iframe>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function(){
|
||||
var myIframe = document.getElementById("notebook");
|
||||
iFrameResize({log:true}, myIframe);
|
||||
});
|
||||
</script></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../LEQ/">« Gaussian elimination</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="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.14.1 on <span class="colophon-date" title="Wednesday 24 September 2025 05:37">Wednesday 24 September 2025</span>. Using Julia version 1.11.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
|
||||
@@ -0,0 +1,8 @@
|
||||
build/
|
||||
site/
|
||||
src/notebook-output/
|
||||
src/notebooks/
|
||||
Manifest.toml
|
||||
src/*.ipynb
|
||||
src/*/index.html
|
||||
src/*.md
|
||||
@@ -0,0 +1,4 @@
|
||||
[deps]
|
||||
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
|
||||
Glob = "c27321d9-0574-5035-807b-f59d2c89b15c"
|
||||
XM_40017 = "97f213cd-d64a-481d-bc9d-afa871b8c535"
|
||||
@@ -0,0 +1,137 @@
|
||||
using XM_40017
|
||||
using Documenter
|
||||
using Glob
|
||||
|
||||
const md_nb_template = """
|
||||
```@meta
|
||||
EditURL = "https://github.com/fverdugo/XM_40017/blob/main/notebooks/SCRIPT_NAME.ipynb"
|
||||
```
|
||||
|
||||
```@raw html
|
||||
<div class="admonition is-success">
|
||||
<header class="admonition-header">Tip</header>
|
||||
<div class="admonition-body">
|
||||
<ul>
|
||||
<li>
|
||||
Download this notebook and run it locally on your machine [recommended]. Click <a href="https://www.francescverdugo.com/XM_40017/dev/SCRIPT_NAME.ipynb" download>here</a>.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
```@raw html
|
||||
<iframe id="notebook" src="../SCRIPT_NAME_src/" style="width:100%"></iframe>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function(){
|
||||
var myIframe = document.getElementById("notebook");
|
||||
iFrameResize({log:true}, myIframe);
|
||||
});
|
||||
</script>
|
||||
```
|
||||
"""
|
||||
|
||||
function convert_embedded_img_to_base64(notebook_path)
|
||||
doc = open(io->read(io, String), notebook_path)
|
||||
# Regex matching: extract filename and base64 code
|
||||
regex = r"attachments\\\":\s*\{\s*\\\"(?<filename>.*).png\\\":\s*\{\s*\\\"image/png\\\":\s*\\\"(?<base64code>.*)\\\""
|
||||
res = eachmatch(regex, doc)
|
||||
matches = collect(res)
|
||||
# Replace img src with base64 code
|
||||
for m in matches
|
||||
filename = m[:filename]
|
||||
base64 = m[:base64code]
|
||||
doc = replace(doc, "attachment:$filename.png" => "data:image/png;base64,$base64")
|
||||
end
|
||||
filename = splitpath(notebook_path)[end]
|
||||
open("docs/src/$filename","w") do f
|
||||
write(f, doc)
|
||||
end
|
||||
end
|
||||
|
||||
# Write markdown file that includes notebook html
|
||||
function create_md_nb_file( filename )
|
||||
global md_nb_template;
|
||||
content = replace(md_nb_template, "SCRIPT_NAME" => filename)
|
||||
md_path = joinpath(@__DIR__, "src", filename * ".md" )
|
||||
open(md_path, "w") do md_file
|
||||
write(md_file, content)
|
||||
end
|
||||
return md_path
|
||||
end
|
||||
|
||||
# Convert to html using nbconvert
|
||||
function convert_notebook_to_html(notebook_path; output_name,output_dir, theme = "light")
|
||||
command_jup = "jupyter"
|
||||
command_nbc = "nbconvert"
|
||||
output_format = "--to=html"
|
||||
theme = "--theme=$theme"
|
||||
output = "--output=$output_name"
|
||||
output_dir = "--output-dir=$output_dir"
|
||||
infile = notebook_path
|
||||
run(`$command_jup $command_nbc $output_format $output $output_dir $theme $infile`)
|
||||
end
|
||||
|
||||
# Modify html contents
|
||||
function modify_notebook_html( html_filepath )
|
||||
content = open( html_filepath, "r" ) do html_file
|
||||
read( html_file, String )
|
||||
end
|
||||
# Resize iframes using IframeResizer
|
||||
content = replace(content,
|
||||
r"(<script\b[^>]*>[\s\S]*?<\/script>\K)" =>
|
||||
s"\1\n\t<script src='../assets/iframeResizer.contentWindow.min.js'></script>\n";
|
||||
count = 1
|
||||
)
|
||||
open( html_filepath, "w" ) do html_file
|
||||
write( html_file, content )
|
||||
end
|
||||
return nothing
|
||||
end
|
||||
|
||||
|
||||
# Loop over notebooks and generate html and markdown
|
||||
repo_root = joinpath(@__DIR__,"..") |> normpath
|
||||
notebook_files = glob("*.ipynb", joinpath(repo_root,"notebooks/"))
|
||||
for filepath in notebook_files
|
||||
#continue
|
||||
convert_embedded_img_to_base64(filepath)
|
||||
filename_with_ext = splitpath(filepath)[end]
|
||||
filename = splitext(filename_with_ext)[1]
|
||||
pth = mkpath(joinpath(repo_root,"docs","src",filename*"_src"))
|
||||
create_md_nb_file(filename)
|
||||
convert_notebook_to_html("docs/src/$filename_with_ext", output_dir=pth, output_name = "index")
|
||||
modify_notebook_html("docs/src/$(filename)_src/index.html")
|
||||
end
|
||||
|
||||
makedocs(;
|
||||
modules=[XM_40017],
|
||||
authors="Francesc Verdugo <f.verdugo.rojano@vu.nl>",
|
||||
repo="https://github.com/fverdugo/XM_40017/blob/{commit}{path}#{line}",
|
||||
sitename="XM_40017",
|
||||
format=Documenter.HTML(;
|
||||
assets = ["assets/favicon.ico", "assets/iframeResizer.min.js", "assets/custom.css"],
|
||||
prettyurls=get(ENV, "CI", "false") == "true",
|
||||
canonical="https://fverdugo.github.io/XM_40017",
|
||||
edit_link="main",),
|
||||
pages=["Home" => "index.md","Getting started"=>"getting_started_with_julia.md",
|
||||
"Notebooks"=>[
|
||||
"Julia Basics" => "julia_basics.md",
|
||||
"Asynchronous programming in Julia" => "julia_async.md",
|
||||
"Distributed computing in Julia" => "julia_distributed.md",
|
||||
"Distributed computing with MPI" => "mpi_tutorial.md",
|
||||
"Matrix-matrix multiplication"=>"matrix_matrix.md",
|
||||
"Jacobi method" => "jacobi_method.md",
|
||||
"All pairs of shortest paths" => "asp.md",
|
||||
"Gaussian elimination" => "LEQ.md",
|
||||
"Traveling salesperson problem" => "tsp.md",
|
||||
"Partial differential equations" => "pdes.md",
|
||||
],
|
||||
"Solutions" => "solutions_for_all_notebooks.md",
|
||||
],
|
||||
)
|
||||
|
||||
deploydocs(;
|
||||
repo="github.com/fverdugo/XM_40017",
|
||||
devbranch="main",
|
||||
)
|
||||
@@ -0,0 +1,370 @@
|
||||
# Getting started
|
||||
|
||||
|
||||
## Introduction
|
||||
|
||||
The programming of this course will be done using the [Julia programming language](https://julialang.org). Thus, we start by explaining how to get up and running with Julia. After studying this page, you will be able to:
|
||||
|
||||
- Use the Julia REPL,
|
||||
- Run serial and parallel code,
|
||||
- Install and manage Julia packages.
|
||||
|
||||
## Why Julia?
|
||||
|
||||
Courses related with high-performance computing (HPC) often use languages such as C, C++, or Fortran. We use Julia instead to make the course accessible to a wider set of students, including the ones that have no experience with
|
||||
C/C++ or Fortran, but are willing to learn parallel programming. Julia is a relatively new programming language specifically designed for scientific computing. It combines a high-level syntax close to interpreted languages like Python with the performance of compiled languages like C, C++, or Fortran. Thus, Julia will allow us to write efficient parallel algorithms with a syntax that is convenient in a teaching setting. In addition, Julia provides easy access to different programming models to write distributed algorithms, which will be useful to learn and experiment with them.
|
||||
|
||||
!!! tip
|
||||
You can run the code [in this link](https://github.com/JuliaAcademy/JuliaTutorials/blob/724e15a350d150a9773afe51a3830709dbed422f/introductory-tutorials/intro-to-julia/09.%20Julia%20is%20fast.ipynb) to learn how Julia compares to other languages (C and Python) in terms of performance.
|
||||
|
||||
|
||||
## Installing Julia
|
||||
|
||||
This is a tutorial-like page. Follow these steps before you continue reading the document.
|
||||
|
||||
- Download and install Julia from [julialang.org](https://julialang.org);
|
||||
- Follow the specific instructions for your operating system: [Windows](https://julialang.org/downloads/platform/#windows), [MacOS](https://julialang.org/downloads/platform/#macos), or [Linux](https://julialang.org/downloads/platform/#linux_and_freebsd)
|
||||
- Download and install [VSCode and its Julia extension](https://www.julia-vscode.org/docs/dev/gettingstarted/);
|
||||
|
||||
|
||||
## The Julia REPL
|
||||
|
||||
### Starting Julia
|
||||
|
||||
There are several ways of opening Julia depending on your operating system and your IDE, but it is usually as simple as launching the Julia app. With VSCode, open a folder (File > Open Folder). Then, press `Ctrl`+`Shift`+`P` to open the command bar, and execute `Julia: Start REPL`. If this does not work, make sure you have the Julia extension for VSCode installed. Independently of the method you use, opening Julia results in a window with some text ending with:
|
||||
|
||||
```
|
||||
julia>
|
||||
```
|
||||
|
||||
You have just opened the Julia *read-evaluate-print loop*, or simply the Julia *REPL*. Congrats! You will spend most of time using the REPL, when working in Julia. The REPL is a console waiting for user input. Just as in other consoles, the string of text right before the input area (`julia>` in the case) is called the *command prompt* or simply the *prompt*.
|
||||
|
||||
### Basic usage
|
||||
|
||||
The usage of the REPL is as follows:
|
||||
- You write some input
|
||||
- press enter
|
||||
- you get the output
|
||||
|
||||
For instance, try this
|
||||
|
||||
```julia
|
||||
julia> 1 + 1
|
||||
```
|
||||
|
||||
A "Hello world" example looks like this in Julia
|
||||
|
||||
```julia
|
||||
julia> println("Hello, world!")
|
||||
```
|
||||
|
||||
Try to run it in the REPL.
|
||||
|
||||
### Help mode
|
||||
|
||||
Curious about what the function `println` does? Enter into *help* mode to look into the documentation. This is done by typing a question mark (`?`) into the input field:
|
||||
|
||||
```julia
|
||||
julia> ?
|
||||
```
|
||||
|
||||
After typing `?`, the command prompt changes to `help?>`. It means we are in help mode. Now, we can type a function name to see its documentation.
|
||||
|
||||
```julia
|
||||
help?> println
|
||||
```
|
||||
|
||||
### Package and shell modes
|
||||
|
||||
The REPL comes with two more modes, namely *package* and *shell* modes. To enter package mode type
|
||||
|
||||
```julia
|
||||
julia> ]
|
||||
```
|
||||
|
||||
Package mode is used to install and manage packages. We are going to discuss the package mode in greater detail later. To return back to normal mode press the backspace key several times.
|
||||
|
||||
To enter shell mode type semicolon (`;`)
|
||||
```julia
|
||||
julia> ;
|
||||
```
|
||||
The prompt should have changed to `shell>` indicating that we are in shell mode. Now you can type commands that you would normally do on your system command line. For instance,
|
||||
|
||||
```julia
|
||||
shell> ls
|
||||
```
|
||||
will display the contents of the current folder in Mac or Linux. Using shell mode in Windows is not straightforward, and thus not recommended for beginners.
|
||||
|
||||
|
||||
|
||||
## Running Julia code
|
||||
|
||||
### Running more complex code
|
||||
|
||||
Real-world Julia programs are not typed in the REPL in practice. They are written in one or more files and *included* in the REPL. To try this, create a new file called `hello.jl`, write the code of the "Hello world" example above, and save it. If you are using VSCode, you can create the file using File > New File > Julia File. Once the file is saved with the name `hello.jl`, execute it as follows
|
||||
|
||||
```julia
|
||||
julia> include("hello.jl")
|
||||
```
|
||||
|
||||
!!! warning
|
||||
Make sure that the file `"hello.jl"` is located in the current working directory of your Julia session. You can query the current directory with function `pwd()`. You can change to another directory with function `cd()` if needed. Also, make sure that the file extension is `.jl`.
|
||||
|
||||
The recommended way of running Julia code is using the REPL as we did. But it is also possible to run code directly from the system command line. To this end, open a terminal and call Julia followed by the path to the file containing the code you want to execute.
|
||||
|
||||
```
|
||||
$ julia hello.jl
|
||||
```
|
||||
|
||||
The previous line assumes that you have Julia properly installed in the system and that it's usable from the terminal. In UNIX systems (Linux and Mac), the Julia binary needs to be in one of the directories listed in the `PATH` environment variable. To check that Julia is properly installed, you can use
|
||||
|
||||
```
|
||||
$ julia --version
|
||||
```
|
||||
|
||||
If this runs without error and you see a version number, you are good to go!
|
||||
|
||||
|
||||
!!! note
|
||||
In this tutorial, when a code snipped starts with `$`, it should be run in the terminal. Otherwise, the code is to be run in the Julia REPL.
|
||||
|
||||
!!! tip
|
||||
Avoid calling Julia code from the terminal, use the Julia REPL instead! Each time you call Julia from the terminal, you start a fresh Julia session and Julia will need to compile your code from scratch. This can be time consuming for large projects. In contrast, if you execute code in the REPL, Julia will compile code incrementally, which is much faster. Running code in a cluster (like in DAS-5 for the Julia assignment) is among the few situations you need to run Julia code from the terminal.
|
||||
|
||||
### Running parallel code
|
||||
|
||||
|
||||
Since we are in a parallel computing course, let's run a parallel "Hello world" example in Julia. Open a Julia REPL and write
|
||||
|
||||
```julia
|
||||
julia> using Distributed
|
||||
julia> @everywhere println("Hello, world! I am proc $(myid()) from $(nprocs())")
|
||||
```
|
||||
|
||||
Here, we are using the `Distributed` package, which is part of the Julia standard library that provides distributed memory parallel support. The code prints the process id and the number of processes in the current Julia session.
|
||||
|
||||
You will probably only see output from 1 process. We need to add more processes to run the example in parallel. This is done with the `addprocs` function.
|
||||
|
||||
```julia
|
||||
julia> addprocs(3)
|
||||
```
|
||||
We have added 3 new processes. Plus the old one, we have 4 processes. Run the code again.
|
||||
|
||||
```julia
|
||||
julia> @everywhere println("Hello, world! I am proc $(myid()) from $(nprocs())")
|
||||
```
|
||||
|
||||
Now, you should see output from 4 processes.
|
||||
|
||||
It is possible to specify the number of processes when starting Julia from the terminal with the `-p` argument (useful, e.g., when running in a cluster). If you launch Julia from the terminal as
|
||||
|
||||
```
|
||||
$ julia -p 3
|
||||
```
|
||||
and then run
|
||||
|
||||
```julia
|
||||
julia> @everywhere println("Hello, world! I am proc $(myid()) from $(nprocs())")
|
||||
```
|
||||
|
||||
You should get output from 4 processes as before.
|
||||
|
||||
### Installing packages
|
||||
|
||||
One of the most useful features of Julia is its package manager. It allows one to install Julia packages in a straightforward and platform independent way. To illustrate this, let us consider the following parallel "Hello world" example. This example uses the Message Passing Interface (MPI). We will learn more about MPI later in the course.
|
||||
|
||||
|
||||
Copy the following block of code into a new file named `"hello_mpi.jl"`
|
||||
|
||||
```julia
|
||||
# file hello_mpi.jl
|
||||
using MPI
|
||||
MPI.Init()
|
||||
comm = MPI.COMM_WORLD
|
||||
rank = MPI.Comm_rank(comm)
|
||||
nranks = MPI.Comm_size(comm)
|
||||
println("Hello world, I am rank $rank of $nranks")
|
||||
```
|
||||
|
||||
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.
|
||||
|
||||
Now, run the file from the REPL
|
||||
```julia
|
||||
julia> include("hello_mpi.jl")
|
||||
```
|
||||
|
||||
It probably didn't work, right? Read the error message and note that the MPI package needs to be installed to run this code.
|
||||
|
||||
To install a package, we need to enter *package* mode. Remember that we entered into help mode by typing `?`. Package mode is activated by typing `]` :
|
||||
```julia
|
||||
julia> ]
|
||||
```
|
||||
At this point, the prompt should have changed to `(@v1.8) pkg>` indicating that we are in package mode. The text between the parentheses indicates which is the active *project*, 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).
|
||||
|
||||
To install the MPI package, type
|
||||
```julia
|
||||
(@v1.8) pkg> add MPI
|
||||
```
|
||||
Congrats, you have installed MPI!
|
||||
|
||||
!!! note
|
||||
Many Julia package names end with `.jl`. This is just a way of signaling that a package is written in Julia. When using such packages, the `.jl` needs to be omitted. In this case, we have installed the `MPI.jl` package even though we have only typed `MPI` in the REPL.
|
||||
|
||||
!!! note
|
||||
The package you have installed is the Julia interface to MPI, called `MPI.jl`. 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 [documentation](https://juliaparallel.org/MPI.jl/stable/configuration/) of `MPI.jl` for further details.
|
||||
|
||||
To check that the package was installed properly, exit package mode by pressing the backspace key several times, and run it again
|
||||
|
||||
```julia
|
||||
julia> include("hello_mpi.jl")
|
||||
```
|
||||
|
||||
Now, it should work, but you probably get output from a single MPI rank only.
|
||||
|
||||
### Running MPI code
|
||||
|
||||
To run MPI applications in parallel, you need a launcher like `mpiexec`. MPI codes written in Julia are not an exception to this rule. From the system terminal, you can run
|
||||
```
|
||||
$ mpiexec -np 4 julia hello_mpi.jl
|
||||
```
|
||||
But it will probably not work since the version of `mpiexec` needs to match with the MPI version we are using from Julia. Don'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:
|
||||
```julia
|
||||
julia> using MPI
|
||||
julia> mpiexec(cmd->run(`$cmd -np 4 julia hello_mpi.jl`))
|
||||
```
|
||||
|
||||
Now, you should see output from 4 ranks.
|
||||
|
||||
## Package manager
|
||||
|
||||
### Installing packages locally
|
||||
|
||||
We have installed the `MPI` 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.
|
||||
|
||||
A project is simply a folder in the hard disk. To use a particular folder as your project, you need to *activate* it. This is done by entering package mode and using the `activate` command followed by the path to the folder you want to activate.
|
||||
```julia
|
||||
(@v1.8) pkg> activate .
|
||||
```
|
||||
The previous command will activate the current working directory. Note that the dot `.` is indeed the path to the current folder.
|
||||
|
||||
The prompt has changed to `(lessons) pkg>` indicating that we are in the project within the `lessons` folder. The particular folder name can be different in your case.
|
||||
|
||||
!!! tip
|
||||
You can activate a project directly when opening Julia from the terminal using the `--project` flag. The command `$ julia --project=.` will open Julia and activate a project in the current directory. You can also achieve the same effect by setting the environment variable `JULIA_PROJECT` with the path of the folder you want to activate.
|
||||
|
||||
!!! note
|
||||
The active project folder and the current working directory are two independent concepts! For instance, `(@v1.8) pkg> activate folderB` and then `julia> cd("folderA")`, will activate the project in `folderB` and change the current working directory to `folderA`.
|
||||
|
||||
At this point all package-related operations will be local to the new project. For instance, install the `DataFrames` package.
|
||||
|
||||
```julia
|
||||
(lessons) pkg> add DataFrames
|
||||
```
|
||||
Use the package to check that it is installed
|
||||
|
||||
```julia
|
||||
julia> using DataFrames
|
||||
julia> DataFrame(a=[1,2],b=[3,4])
|
||||
```
|
||||
Now, we can return to the global project to check that `DataFrames` has not been installed there. To return to the global environment, use `activate` without a folder name.
|
||||
|
||||
```julia
|
||||
(lessons) pkg> activate
|
||||
```
|
||||
The prompt is again `(@v1.8) pkg>`
|
||||
|
||||
Now, try to use `DataFrames`.
|
||||
|
||||
```julia
|
||||
julia> using DataFrames
|
||||
julia> DataFrame(a=[1,2],b=[3,4])
|
||||
```
|
||||
You should get an error or a warning unless you already had `DataFrames` installed globally.
|
||||
|
||||
### Project and Manifest files
|
||||
|
||||
The information about a project is stored in two files `Project.toml` and `Manifest.toml`.
|
||||
|
||||
- `Project.toml` contains the packages explicitly installed (the direct dependencies)
|
||||
|
||||
- `Manifest.toml` contains direct and indirect dependencies along with the concrete version of each package.
|
||||
|
||||
|
||||
In other words, `Project.toml` contains the packages relevant for the user, whereas `Manifest.toml` is the detailed snapshot of all dependencies. The `Manifest.toml` can be used to reproduce the same environment in another machine.
|
||||
|
||||
You can see the path to the current `Project.toml` file by using the `status` operator (or `st` in its short form) while in package mode
|
||||
|
||||
```julia
|
||||
(@v1.8) pkg> status
|
||||
```
|
||||
|
||||
The information about the `Manifest.toml` can be inspected by passing the `-m` flag.
|
||||
|
||||
```julia
|
||||
(@v1.8) pkg> status -m
|
||||
```
|
||||
|
||||
### Installing packages from a project file
|
||||
|
||||
Project files can be used to install lists of packages defined by others. E.g., to install all the dependencies of a Julia application.
|
||||
|
||||
Assume that a colleague has sent to you a `Project.toml` file with this content:
|
||||
|
||||
```
|
||||
[deps]
|
||||
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
|
||||
julia> mkdir("newproject")
|
||||
```
|
||||
|
||||
To install all the packages registered in this file you need to activate the folder containing your `Project.toml` file
|
||||
```julia
|
||||
(@v1.8) pkg> activate newproject
|
||||
```
|
||||
and then *instantiating* it
|
||||
```julia
|
||||
(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
|
||||
|
||||
```julia
|
||||
(@v1.8) pkg> help activate
|
||||
```
|
||||
|
||||
You can get an overview of all package commands by typing `help` alone
|
||||
```julia
|
||||
(@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
|
||||
julia> using Pkg
|
||||
julia> Pkg.status()
|
||||
```
|
||||
is equivalent to calling `status` in package mode.
|
||||
```julia
|
||||
(@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 Manual](https://docs.julialang.org/en/v1/manual/getting-started/)
|
||||
- [Package manager](https://pkgdocs.julialang.org/v1/getting-started/)
|
||||
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
```@meta
|
||||
CurrentModule = XM_40017
|
||||
```
|
||||
# Programming Large-Scale Parallel Systems (XM_40017)
|
||||
|
||||
Welcome to the interactive lecture notes of the [Programming Large-Scale Parallel Systems course](https://studiegids.vu.nl/EN/courses/2023-2024/XM_40017#/) at [VU Amsterdam](https://vu.nl)!
|
||||
|
||||
## 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](https://studiegids.vu.nl/EN/courses/2023-2024/XM_40017#/)) 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](@ref).
|
||||
- Download the notebook.
|
||||
- Launch Julia. More information in [Getting started](@ref).
|
||||
- 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](https://github.com/fverdugo/) with the help of [Gelieza Kötterheinrich](https://www.linkedin.com/in/gelieza-k/). Part of the notebooks are based on the course slides by [Henri Bal](https://www.vuhpdc.net/henri-bal/).
|
||||
|
||||
|
||||
## License
|
||||
|
||||
All material on this page that is original to this course may be used under a [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) license.
|
||||
|
||||
|
||||
## Acknowledgment
|
||||
|
||||
This page was created with the support of the Faculty of Science of [Vrije Universiteit Amsterdam](https://vu.nl) 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".
|
||||
@@ -0,0 +1,270 @@
|
||||
# Solutions
|
||||
|
||||
## Julia Basics
|
||||
|
||||
### NB1-Q1
|
||||
|
||||
In the first, line we assign a variable to a value. In the second line, we assign another variable to the same value. Thus,we have 2 variables associated with the same value. In line 3, we associate `y` to a new value (re-assignment). Thus, we have 2 variables associated with 2 different values. Variable `x` is still associated with its original value. Thus, the value at the final line is `x=1`.
|
||||
|
||||
### NB1-Q2
|
||||
|
||||
It will be `1` for very similar reasons as in the previous questions: we are reassigning a local variable, not the global variable defined outside the function.
|
||||
|
||||
### NB1-Q3
|
||||
|
||||
It will be `6`. In the returned function `f2`, `x` is equal to `2`. Thus, when calling `f2(3)` we compute `2*3`.
|
||||
|
||||
|
||||
### Exercise 1
|
||||
|
||||
```julia
|
||||
function ex1(a)
|
||||
j = 1
|
||||
m = a[j]
|
||||
for (i,ai) in enumerate(a)
|
||||
if m < ai
|
||||
m = ai
|
||||
j = i
|
||||
end
|
||||
end
|
||||
(m,j)
|
||||
end
|
||||
```
|
||||
|
||||
### Exercise 2
|
||||
|
||||
```julia
|
||||
ex2(f,g) = x -> f(x) + g(x)
|
||||
```
|
||||
|
||||
### Exercise 3
|
||||
|
||||
```julia
|
||||
using GLMakie
|
||||
max_iters = 100
|
||||
n = 1000
|
||||
x = LinRange(-1.7,0.7,n)
|
||||
y = LinRange(-1.2,1.2,n)
|
||||
heatmap(x,y,(i,j)->mandel(i,j,max_iters))
|
||||
```
|
||||
|
||||
## Asynchronous programming in Julia
|
||||
|
||||
### NB2-Q1
|
||||
|
||||
Evaluating `compute_π(100_000_000)` takes about 0.25 seconds. Thus, the loop would take about 2.5 seconds since we are calling the function 10 times.
|
||||
|
||||
### NB2-Q2
|
||||
|
||||
The time in doing the loop will be almost zero since the loop just schedules 10 tasks, which should be very fast.
|
||||
|
||||
### NB2-Q3
|
||||
|
||||
It will take 2.5 seconds, like in question 1. The `@sync` macro forces to wait for all tasks we have generated with the `@async` 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.
|
||||
|
||||
### NB2-Q4
|
||||
|
||||
It will take about 3 seconds. The channel has buffer size 4, thus the call to `put!`will not block. The call to `take!` 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.
|
||||
|
||||
### NB2-Q5
|
||||
|
||||
The channel is not buffered and therefore the call to `put!` will block. The cell will run forever, since there is no other task that calls `take!` on this channel.
|
||||
|
||||
## Distributed computing in Julia
|
||||
|
||||
### NB3-Q1
|
||||
|
||||
We send the matrix (16 entries) and then we receive back the result (1 extra integer). Thus, the total number of transferred integers in 17.
|
||||
|
||||
### NB3-Q2
|
||||
|
||||
Even though we only use a single entry of the matrix in the remote worker, the entire matrix is captured and sent to the worker. Thus, we will transfer 17 integers like in Question 1.
|
||||
|
||||
### NB3-Q3
|
||||
|
||||
The value of `x` will still be zero since the worker receives a copy of the matrix and it modifies this copy, not the original one.
|
||||
|
||||
### NB3-Q4
|
||||
|
||||
In this case, the code `a[2]=2` is executed in the main process. Since the matrix is already in the main process, it is not needed to create and send a copy of it. Thus, the code modifies the original matrix and the value of `x` will be 2.
|
||||
|
||||
## Distributed computing with MPI
|
||||
|
||||
### Exercise 1
|
||||
|
||||
```julia
|
||||
using MPI
|
||||
MPI.Init()
|
||||
comm = MPI.Comm_dup(MPI.COMM_WORLD)
|
||||
rank = MPI.Comm_rank(comm)
|
||||
nranks = MPI.Comm_size(comm)
|
||||
buffer = Ref(0)
|
||||
if rank == 0
|
||||
msg = 2
|
||||
buffer[] = msg
|
||||
println("msg = $(buffer[])")
|
||||
MPI.Send(buffer,comm;dest=rank+1,tag=0)
|
||||
MPI.Recv!(buffer,comm;source=nranks-1,tag=0)
|
||||
println("msg = $(buffer[])")
|
||||
else
|
||||
dest = if (rank != nranks-1)
|
||||
rank+1
|
||||
else
|
||||
0
|
||||
end
|
||||
MPI.Recv!(buffer,comm;source=rank-1,tag=0)
|
||||
buffer[] += 1
|
||||
println("msg = $(buffer[])")
|
||||
MPI.Send(buffer,comm;dest,tag=0)
|
||||
end
|
||||
```
|
||||
|
||||
### Exercise 2
|
||||
|
||||
```julia
|
||||
f = () -> Channel{Int}(1)
|
||||
chnls = [ RemoteChannel(f,w) for w in workers() ]
|
||||
@sync for (iw,w) in enumerate(workers())
|
||||
@spawnat w begin
|
||||
chnl_snd = chnls[iw]
|
||||
if w == 2
|
||||
chnl_rcv = chnls[end]
|
||||
msg = 2
|
||||
println("msg = $msg")
|
||||
put!(chnl_snd,msg)
|
||||
msg = take!(chnl_rcv)
|
||||
println("msg = $msg")
|
||||
else
|
||||
chnl_rcv = chnls[iw-1]
|
||||
msg = take!(chnl_rcv)
|
||||
msg += 1
|
||||
println("msg = $msg")
|
||||
put!(chnl_snd,msg)
|
||||
end
|
||||
end
|
||||
end
|
||||
```
|
||||
|
||||
This is another possible solution.
|
||||
|
||||
```julia
|
||||
@everywhere function work(msg)
|
||||
println("msg = $msg")
|
||||
if myid() != nprocs()
|
||||
next = myid() + 1
|
||||
@fetchfrom next work(msg+1)
|
||||
else
|
||||
@fetchfrom 2 println("msg = $msg")
|
||||
end
|
||||
end
|
||||
msg = 2
|
||||
@fetchfrom 2 work(msg)
|
||||
```
|
||||
## Matrix-matrix multiplication
|
||||
|
||||
### Exercise 1
|
||||
|
||||
```julia
|
||||
function matmul_dist_3!(C,A,B)
|
||||
m = size(C,1)
|
||||
n = size(C,2)
|
||||
l = size(A,2)
|
||||
@assert size(A,1) == m
|
||||
@assert size(B,2) == n
|
||||
@assert size(B,1) == l
|
||||
@assert mod(m,nworkers()) == 0
|
||||
nrows_w = div(m,nworkers())
|
||||
@sync for (iw,w) in enumerate(workers())
|
||||
lb = 1 + (iw-1)*nrows_w
|
||||
ub = iw*nrows_w
|
||||
A_w = A[lb:ub,:]
|
||||
ftr = @spawnat w begin
|
||||
C_w = similar(A_w)
|
||||
matmul_seq!(C_w,A_w,B)
|
||||
C_w
|
||||
end
|
||||
@async C[lb:ub,:] = fetch(ftr)
|
||||
end
|
||||
C
|
||||
end
|
||||
|
||||
@everywhere function matmul_seq!(C,A,B)
|
||||
m = size(C,1)
|
||||
n = size(C,2)
|
||||
l = size(A,2)
|
||||
@assert size(A,1) == m
|
||||
@assert size(B,2) == n
|
||||
@assert size(B,1) == l
|
||||
z = zero(eltype(C))
|
||||
for j in 1:n
|
||||
for i in 1:m
|
||||
Cij = z
|
||||
for k in 1:l
|
||||
@inbounds Cij = Cij + A[i,k]*B[k,j]
|
||||
end
|
||||
C[i,j] = Cij
|
||||
end
|
||||
end
|
||||
C
|
||||
end
|
||||
```
|
||||
|
||||
### Exercise 2
|
||||
|
||||
At each call to @spawnat we will communicate O(N) and compute O(N) in a worker process just like in algorithm 1. However, we will do this work N^2/P times on average at each worker. Thus, the total communication and computation on a worker will be O(N^3/P) for both communication and computation. Thus, the communication over computation ratio will still be O(1) and thus the communication will dominate in practice, making the algorithm inefficient.
|
||||
|
||||
## Jacobi method
|
||||
|
||||
### Exercise 1
|
||||
|
||||
```julia
|
||||
@everywhere workers() begin
|
||||
using MPI
|
||||
comm = MPI.Comm_dup(MPI.COMM_WORLD)
|
||||
function jacobi_mpi(n,niters)
|
||||
nranks = MPI.Comm_size(comm)
|
||||
rank = MPI.Comm_rank(comm)
|
||||
if mod(n,nranks) != 0
|
||||
println("n must be a multiple of nranks")
|
||||
MPI.Abort(comm,1)
|
||||
end
|
||||
n_own = div(n,nranks)
|
||||
u = zeros(n_own+2)
|
||||
u[1] = -1
|
||||
u[end] = 1
|
||||
u_new = copy(u)
|
||||
for t in 1:niters
|
||||
reqs = MPI.Request[]
|
||||
if rank != 0
|
||||
neig_rank = rank-1
|
||||
req = MPI.Isend(view(u,2:2),comm,dest=neig_rank,tag=0)
|
||||
push!(reqs,req)
|
||||
req = MPI.Irecv!(view(u,1:1),comm,source=neig_rank,tag=0)
|
||||
push!(reqs,req)
|
||||
end
|
||||
if rank != (nranks-1)
|
||||
neig_rank = rank+1
|
||||
s = n_own+1
|
||||
r = n_own+2
|
||||
req = MPI.Isend(view(u,s:s),comm,dest=neig_rank,tag=0)
|
||||
push!(reqs,req)
|
||||
req = MPI.Irecv!(view(u,r:r),comm,source=neig_rank,tag=0)
|
||||
push!(reqs,req)
|
||||
end
|
||||
for i in 3:n_own
|
||||
u_new[i] = 0.5*(u[i-1]+u[i+1])
|
||||
end
|
||||
MPI.Waitall(reqs)
|
||||
for i in (2,n_own+1)
|
||||
u_new[i] = 0.5*(u[i-1]+u[i+1])
|
||||
end
|
||||
u, u_new = u_new, u
|
||||
end
|
||||
return u
|
||||
end
|
||||
end
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
<!--This file is automatically generated by Documenter.jl-->
|
||||
<meta http-equiv="refresh" content="0; url=./dev/"/>
|
||||
@@ -0,0 +1,497 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "46d0dd15",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<img src=\"https://upload.wikimedia.org/wikipedia/commons/thumb/3/39/VU_logo.png/800px-VU_logo.png?20161029201021\" width=\"350\">\n",
|
||||
"\n",
|
||||
"### Programming large-scale parallel systems\n",
|
||||
"\n",
|
||||
"# Gaussian elimination"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "ff0fbd76",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Contents\n",
|
||||
"\n",
|
||||
"In this notebook, we will learn\n",
|
||||
"\n",
|
||||
"- How to parallelize Gaussian elimination\n",
|
||||
"- How to fix static load imbalance"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "480af594",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<div class=\"alert alert-block alert-info\">\n",
|
||||
"<b>Note:</b> Do not forget to execute the cell below before starting this notebook! \n",
|
||||
"</div>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "7e93809a",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"using Printf\n",
|
||||
"function answer_checker(answer,solution)\n",
|
||||
" if answer == solution\n",
|
||||
" \"🥳 Well done! \"\n",
|
||||
" else\n",
|
||||
" \"It's not correct. Keep trying! 💪\"\n",
|
||||
" end |> println\n",
|
||||
"end\n",
|
||||
"ge_par_check(answer) = answer_checker(answer, \"a\")\n",
|
||||
"ge_dep_check(answer) = answer_checker(answer, \"b\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "8dcee319",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Gaussian elimination\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"[Gaussian elimination](https://en.wikipedia.org/wiki/Gaussian_elimination) is a method to solve systems of linear equations, e.g.\n",
|
||||
"\n",
|
||||
"$$\n",
|
||||
"\\left[\n",
|
||||
"\\begin{matrix}\n",
|
||||
"1 & 3 & 1 \\\\\n",
|
||||
"1 & 2 & -1 \\\\\n",
|
||||
"3 & 11 & 5 \\\\\n",
|
||||
"\\end{matrix}\n",
|
||||
"\\right]\n",
|
||||
"\\left[\n",
|
||||
"\\begin{matrix}\n",
|
||||
"x \\\\\n",
|
||||
"y \\\\\n",
|
||||
"z \\\\\n",
|
||||
"\\end{matrix}\n",
|
||||
"\\right]\n",
|
||||
"=\n",
|
||||
"\\left[\n",
|
||||
"\\begin{matrix}\n",
|
||||
"9 \\\\\n",
|
||||
"1 \\\\\n",
|
||||
"35 \\\\\n",
|
||||
"\\end{matrix}\n",
|
||||
"\\right]\n",
|
||||
"$$\n",
|
||||
"\n",
|
||||
"The steps of the Gaussian elimination will transform the system into an upper triangular matrix. The system of linear equations can now easily be solved by backward substitution. \n",
|
||||
"\n",
|
||||
"\n",
|
||||
"$$\n",
|
||||
"\\left[\n",
|
||||
"\\begin{matrix}\n",
|
||||
"1 & 3 & 1 & 9 \\\\\n",
|
||||
"1 & 2 & -1 & 1 \\\\\n",
|
||||
"3 & 11 & 5 & 35 \\\\\n",
|
||||
"\\end{matrix}\n",
|
||||
"\\right]\n",
|
||||
"\\rightarrow\n",
|
||||
"\\left[\n",
|
||||
"\\begin{matrix}\n",
|
||||
"1 & 3 & 1 & 9 \\\\\n",
|
||||
"0 & -1 & -2 & -8 \\\\\n",
|
||||
"0 & 2 & 2 & 8 \\\\\n",
|
||||
"\\end{matrix}\n",
|
||||
"\\right]\n",
|
||||
"\\rightarrow\n",
|
||||
"\\left[\n",
|
||||
"\\begin{matrix}\n",
|
||||
"1 & 3 & 1 & 9 \\\\\n",
|
||||
"0 & 1 & 2 & 8 \\\\\n",
|
||||
"0 & 2 & 2 & 8 \\\\\n",
|
||||
"\\end{matrix}\n",
|
||||
"\\right]\n",
|
||||
"\\rightarrow\n",
|
||||
"\\left[\n",
|
||||
"\\begin{matrix}\n",
|
||||
"1 & 3 & 1 & 9 \\\\\n",
|
||||
"0 & 1 & 2 & 8 \\\\\n",
|
||||
"0 & 0 & -2 & -8 \\\\\n",
|
||||
"\\end{matrix}\n",
|
||||
"\\right]\n",
|
||||
"\\rightarrow\n",
|
||||
"\\left[\n",
|
||||
"\\begin{matrix}\n",
|
||||
"1 & 3 & 1 & 9 \\\\\n",
|
||||
"0 & 1 & 2 & 8 \\\\\n",
|
||||
"0 & 0 & 1 & 4 \\\\\n",
|
||||
"\\end{matrix}\n",
|
||||
"\\right]\n",
|
||||
"$$\n",
|
||||
"\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "94c10106",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Serial implementation\n",
|
||||
"The following algorithm computes the Gaussian elimination on a matrix which represents a system of linear equations.\n",
|
||||
"- The first inner loop in line 4 divides the current row by the value of the diagonal entry, thus transforming the diagonal to contain only ones. \n",
|
||||
"- The second inner loop beginning in line 8 substracts the rows from one another such that all entries below the diagonal become zero. "
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "e4070214",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"function gaussian_elimination!(B)\n",
|
||||
" n,m = size(B)\n",
|
||||
" @inbounds for k in 1:n\n",
|
||||
" for t in (k+1):m\n",
|
||||
" B[k,t] = B[k,t]/B[k,k]\n",
|
||||
" end\n",
|
||||
" B[k,k] = 1\n",
|
||||
" for i in (k+1):n \n",
|
||||
" for j in (k+1):m\n",
|
||||
" B[i,j] = B[i,j] - B[i,k]*B[k,j]\n",
|
||||
" end\n",
|
||||
" B[i,k] = 0\n",
|
||||
" end\n",
|
||||
" end\n",
|
||||
" B\n",
|
||||
"end"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "3763b000",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<div class=\"alert alert-block alert-info\">\n",
|
||||
"<b>Note:</b> This algorithm is not correct for all matrices: if any diagonal element <code>B[k,k]</code> is zero, the computation in the first inner loop fails. To get around this problem, another step can be added to the algorithm that swaps the rows until the diagonal entry of the current row is not zero. This process of finding a nonzero value is called <b>pivoting</b>. \n",
|
||||
"</div>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "fbb3d1eb",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"You can verify that the algorithm computes the upper triangular matrix correctly for the example in the introduction by running the following code cell. "
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "eb30df0d",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"A = Float64[1 3 1; 1 2 -1; 3 11 5]\n",
|
||||
"b = Float64[9,1,35]\n",
|
||||
"B = [A b]\n",
|
||||
"gaussian_elimination!(B)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "39f2e8ef",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Parallelization\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "1b1a6469",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Where can we extract parallelism?\n",
|
||||
"\n",
|
||||
"```julia\n",
|
||||
"n,m = size(B)\n",
|
||||
"for k in 1:n\n",
|
||||
" for t in (k+1):m\n",
|
||||
" B[k,t] = B[k,t]/B[k,k]\n",
|
||||
" end\n",
|
||||
" B[k,k] = 1\n",
|
||||
" for i in (k+1):n \n",
|
||||
" for j in (k+1):m\n",
|
||||
" B[i,j] = B[i,j] - B[i,k]*B[k,j]\n",
|
||||
" end\n",
|
||||
" B[i,k] = 0\n",
|
||||
" end\n",
|
||||
"end\n",
|
||||
"```"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "e52c4b38",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<div class=\"alert alert-block alert-success\">\n",
|
||||
"<b>Question:</b> Which of the loops can be parallelized?\n",
|
||||
"</div>\n",
|
||||
"\n",
|
||||
" a) the inner loops, but not the outer loop\n",
|
||||
" b) the outer loop, but not the inner loops\n",
|
||||
" c) all loops\n",
|
||||
" d) only the first inner loop"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "078e974e",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"answer = \"x\" # replace x with a, b, c, or d \n",
|
||||
"ge_par_check(answer)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "14d57c52",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Two possible data partitions"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "6b17aee4",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"The outer loop of the algorithm is not parallelizable, since the iterations depend on the results of the previous iterations. However, we can extract parallelism from the inner loops. Let's have a look at two different parallelization schemes. \n",
|
||||
"\n",
|
||||
"1. **Block-wise partitioning**: Each processor gets a block of subsequent rows. \n",
|
||||
"2. **Cyclic partitioning**: The rows are alternately assigned to different processors. "
|
||||
]
|
||||
},
|
||||
{
|
||||
"attachments": {
|
||||
"fig-asp-1d-partition.png": {
|
||||
"image/png": "iVBORw0KGgoAAAANSUhEUgAABL4AAAI0CAYAAAATGeCIAAAACXBIWXMAAB7CAAAewgFu0HU+AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAIABJREFUeJzs3XmcXFWZ//HvU1XdnU5nIyEhCYRVGBYBWRwQERFk2JRVUBxEXAYXXEcUB3QE11FREcF12BQFQWRRGJBNVFBQdhAwkIXsezq9d1Xd5/fHrfzsVN1Oeq17cvN5v155Kae2p+69ffv09557jrm7AGy+zOxsSVdXNX/N3S+oYw3Nkjqrmue4+y71qmFzYmbtklr6NLW5+4S06gEAAEA2mdmnJX2jqvk8d/9WGvUAaSikXQC2XGZ2uqRJfZpud/elI/Teh2tgx3e7pF5JayV1S+p097UjUQMAAACyzcxOkbR1n6Y73X3hCL33oZLGDOCpHZJ6FPd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EM8QYAAKMglf5sZXXv7aqaS4pX9httP1LtBezDzKx6lfMNmNlUSadXNa+T9NNNvG5XxaPK+uqV9MSmS908VKbpODjhoerpSIC6IvgChi9p/oPRHJo9qipDrVckPDTS8zzMTGhLCt0GrHKVLWmVzW37eUl1R0uSnhpODcNRCb2uUO0S2+sUj/Qa9NxnAAAAA5BWfzapLine truncated
|
||||
}
|
||||
},
|
||||
"cell_type": "markdown",
|
||||
"id": "c518f863",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<div>\n",
|
||||
"<img src=\"attachment:fig-asp-1d-partition.png\" align=\"left\" width=\"400\"/>\n",
|
||||
"</div>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "102d6fa2",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## What is the work per process at iteration k?\n",
|
||||
"To evaluate the efficiency of both partitioning schemes, consider how much work the processors do in the following example. \n",
|
||||
"In any iteration k, which part of the matrix is updated in the inner loops? \n",
|
||||
"\n",
|
||||
"### Block-wise partition"
|
||||
]
|
||||
},
|
||||
{
|
||||
"attachments": {
|
||||
"fig-asp-data-updated.png": {
|
||||
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAtcAAAJNCAYAAAD6c1l4AAAACXBIWXMAAB7CAAAewgFu0HU+AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAIABJREFUeJzs3XeYJFXVx/Hv6ZnZvLC7LGFZwrLkDIpECRJEEMVXl/waEQyor6IoBhAFEwZEBUFUVEREEQwgIkEyIkGQKJkl7i5h8+ykPu8ft4btrqmeTtVTNTO/z/P0A32n6tbZ6urqU7du3Wvujohkx8w6gXHR2053n5BlPKOFmc0GHi8pusvdd8ggjo2B24GpJcW3APu6+4qhjkdkuDCz04AvlhQd5+5nZxVP3pjZGGBtYDxQBJYBL7p7bw3rfhU4KVb8Pnf/ZeqBjkDtWQdQjZl9B5g8yCLdhANmafT/c4GHgYf1wyQieWZ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EIxY/HWS3e3pGUjzjyNXd/vJYVPQzF98OSImPgjIT9Toi9P83d7685yqGzBmGYun7VunXlhpmtShhZp9/9wBl1VHEu5f2A491jBnMV4U7cOd76Cb/yfh78WOz9d732EXW+QOg+0m8PM9u2jm3v7zWMoexhxJrLY8WVRpMZEmZ2FCER7D9HO6HF+tzsomrIaoQuXqVOob7nTCB0Qb3JzAYdEagG8XPYpk3WN6KMuj7XLine truncated
|
||||
}
|
||||
},
|
||||
"cell_type": "markdown",
|
||||
"id": "a67e0aad",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<div>\n",
|
||||
"<img src=\"attachment:fig-asp-data-updated.png\" align=\"left\" width=\"250\"/>\n",
|
||||
"</div>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "d9d29899",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"It is clear from the code that at any given iteration `k`, the matrix is updated from row `k` to `n` and from column `k` to `m`. If we look at how that reflects the distribution of work over the processes, we can see that CPU 1 does not have any work, whereas CPU 2 does a little work and CPU 3 and 4 do a lot of work. "
|
||||
]
|
||||
},
|
||||
{
|
||||
"attachments": {
|
||||
"fig-asp-data-updated-2.png": {
|
||||
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAtcAAAJNCAYAAAD6c1l4AAAACXBIWXMAAB7CAAAewgFu0HU+AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAIABJREFUeJzs3XecJFW5//HPM2HzwgZYWNIui2RYQBEEJEgSEOUqGa7+RERR1GtCQQRRxABcuagIgooBRBRFDCASJCNJySCZJe4uYfPupH5+f5watrumOldP1cx8369Xv6DPVJ16trq6+qlTp84xd0dEsmNmy4Ex0dvl7j4uy3hGCjObBTxVVHSvu2+bQRwbAncCk4uKbwP2dPcVgx2PyFBhZt8ETioqOs7df5RVPHljZqOAtYCxQAFYCrzi7r01rPsN4ORY8Yfd/RepBzoMdWQdQDVmdhYwscIi3YQD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2m/6Uu8xtERBtFgf8ZHUDriyOnu/lQtK3oYiu8HRUXGwBkJ+30p9v6b7v5QzVEOnmmEYer6VevWlRtmtirh4r/fQ8DZdVTxY8JFT79495hK/k64E3e+t37Cr7yfBz8Ve/89d3+2xnW/Qug+0m8XM9uqjm3v4zWMoexhxJq/xIoz7XdtZkcSEsH+c7QDx7r7j7OLqiFTCV28ip1Kfc+ZQOiCeouZVRwRqAbxc9jGTdY3rIy4PtcA7u5mtpTSLine truncated
|
||||
}
|
||||
},
|
||||
"cell_type": "markdown",
|
||||
"id": "d083cd53",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<div>\n",
|
||||
"<img src=\"attachment:fig-asp-data-updated-2.png\" align=\"left\" width=\"250\"/>\n",
|
||||
"</div>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "6409890d",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Load imbalance\n",
|
||||
"\n",
|
||||
"The block-wise partitioning scheme leads to load imbalance across the processes: CPUs with rows $<k$ are idle during any iteration $k$. The bad load balance leads to bad speedups, as some CPUs are waiting instead of doing useful work. \n",
|
||||
" \n",
|
||||
"### Data dependencies\n",
|
||||
" \n",
|
||||
"<div class=\"alert alert-block alert-success\">\n",
|
||||
"<b>Question:</b> What are the data dependencies in the block-wise partitioning?\n",
|
||||
"</div>\n",
|
||||
"\n",
|
||||
" a) CPUs with rows >k need all rows <=k\n",
|
||||
" b) CPUs with rows >k need part of row k\n",
|
||||
" c) All CPUs need row k \n",
|
||||
" d) CPUs with row k needs all rows >k \n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "e0565e92",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"answer = \"x\" # replace x with a, b, c, or d \n",
|
||||
"ge_dep_check(answer)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "51498a44",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Cyclic partition\n",
|
||||
"\n",
|
||||
"In contrast, if we look at how the work is balanced for the same example and cyclic partitioning, we find that the processes have similar work load. "
|
||||
]
|
||||
},
|
||||
{
|
||||
"attachments": {
|
||||
"fig-asp-data-updated-cyclic.png": {
|
||||
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAqgAAAJJCAYAAABmoMV7AAAACXBIWXMAAB7CAAAewgFu0HU+AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAIABJREFUeJzs3Xe4HGXZx/HvfU46LSSBECB0pGpoggpIUwSVooCogIiK2EVAFFBBBF8QCyiK2BBBOtJbkN47SG8hBAKkh/TklPv945nNmZ2zvc2E/X2ua6/szJlyZ3d29t6nmrsjIukxs5nAyrlld7cUw2kbZrYKMDW26iV33yiFOMYCjwCjY6ufAHZy97mtjkdkWWFm3wV+H1t1srufmFY8WWNmA4HVgSFABzAPmOLuSyrY9wjgHCD+fXSCu/+yGbEWMqBVJ6qVmZ0BrFhikyXAfMILvwSYBLwAvOjuC5sfoYhIbcxsKPAf8pPTx4GPF0tOzWwEMD6x+gR3v6U5UUqzmNlfgS1jq+5w9x+mFY8s28xsAPAp4NPAjsD69M/zlpjZ9e6+X6ljufu5ZjaI/B8AvzCzJ939xkbGXUzmE1TgYGC1GvbrNbOngGuBK9396caG1Vhmtg2wf2zVPe5+Q1rxSHszsx0IN7mc/7r7f9OK5z3sd8A2seVJwCfdfWaJfQYCWyfWjSi2cVSK8ovYqjmtLAV5rzKzLYDPx1Y94O7XVHmY95H/Xr5ed2DSdqJE8gjgx4QS01IGAZtXclx3/4OZrR4dF0Ip7IVm9gF3f7PWeCu1LCSoteog/DLdEjjRzG4CTnL3h9MNq6j3Az+KLQ8ElKBKWrYh/3pcBChBbSAz+wTw9diq+cDe7j6lwacaQP57+RagBLV+m5L/uv4RqDZBFamLmW0G/BsY16RTnEC41veOllcG/mZme3qT24guiwnqXK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fZ9fwup6UOEbJKn7gygKvyYZl9jmUcF+P71e06Vm0T7KK3wkFKn8D1i6yjxX4/ziwbRM/UxVX8QOfK/A6/KSKcy0pcW024vFcBTFcntjnS4QCsgMJPxjmlzj+E4RaiIo+ExXEcnvi+Gs2/P1t1oXTwAuwGQnqmAJv3s4NjvvQxPFvLbN93QlqHbHekTj3wU08V5oJ6gPA+yo8168T+04HBhXZdmMS7UiB/ar4f+V9gTfpdU/eyK8ss31dCSrhl/WE2P7zgE0q3NcIJV5lv+QIpbzx7RZTYZssQket+L7NTlDj7WPnAB11HKvVCepPE8f4RRX7fjmx799KbFsoQZ1J6BhS8PPXwPfnwMR57ymzfUsTVEKtV/yH8xIqLIwgNLGJn+d5wEpsn0xQn63kcxV9dpNtY49p4ntWUYJK+LGSTDBPqPJcWUhQk22/f00oma/mPBNoTB71s8RxD2j0+9uObVBx97cJvwbjklWz9UpW363T4OM3UrJaap00gmiBk7zyoThOIVR554wkv4lA3NHktyO9zN2vrCG+Zmr19bgf+b3Mz3D35yvZ0cPdLzm6QXLmpJwfJpbP8HTaZJUUjS4wNrbqf96CUTMaIaou/k5s1WuEz0el/k3+DEnVVAfeBXzA3c/y5k9PfS3hizZnnSafr1rfJr+K+S/uXumA67+irykThB/VxT5ThRxQyecq+uxelVhdTZv8hjOzTxKaAMV7vh/vJUaAybBkG/ujCbUJ1VgXGB+NTlSP5Ag3G9V5vH7arg1qzDzyGxtX3Xi/FHefZWYL6WuLWmxYnSx4O7E8KpUoMsTDsGQ3k98ecltC25ulLine truncated
|
||||
}
|
||||
},
|
||||
"cell_type": "markdown",
|
||||
"id": "b90252f1",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<div>\n",
|
||||
"<img src=\"attachment:fig-asp-data-updated-cyclic.png\" align=\"left\" width=\"250\"/>\n",
|
||||
"</div>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "866824c6",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Conclusion\n",
|
||||
"Cyclic partitioning tends to work well in problems with predictable load imbalance. It is a form of **static load balancing** which means using a pre-defined load schedule based on prior information about the algorithm (as opposed to **dynamic load balancing** which can schedule loads flexibly during runtime). The data dependencies are the same as for the 1d block partitioning.\n",
|
||||
"\n",
|
||||
"At the same time, cyclic partitioning is not suitable for all communication patterns. For example, it can lead to a large communication overhead in the parallel Jacobi method, since the computation of each value depends on its neighbouring elements."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "20982b04",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Exercise\n",
|
||||
"The actual implementation of the parallel algorithm is left as an exercise. Implement both 1d block and 1d cyclic partitioning and compare their performance. The implementation is closely related to that of Floyd's algorithm. To test your algorithms, generate input matrices with the function below (a random matrix is not enough, we need a non singular matrix that does not require pivoting). "
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "a65cf8e6",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"function tridiagonal_matrix(n)\n",
|
||||
" C = zeros(n,n)\n",
|
||||
" stencil = [(-1,2,-1),(-1,0,1)]\n",
|
||||
" for i in 1:n\n",
|
||||
" for (coeff,o) in zip((-1,2,-1),(-1,0,1))\n",
|
||||
" j = i+o\n",
|
||||
" if j in 1:n\n",
|
||||
" C[i,j] = coeff\n",
|
||||
" end\n",
|
||||
" end\n",
|
||||
" end\n",
|
||||
" C\n",
|
||||
"end"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "31d8586a",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"n = 12\n",
|
||||
"C = tridiagonal_matrix(n)\n",
|
||||
"b = ones(n)\n",
|
||||
"B = [C b]\n",
|
||||
"gaussian_elimination!(B)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "f60d9ea0",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# License\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"This notebook is part of the course [Programming Large Scale Parallel Systems](https://www.francescverdugo.com/XM_40017) at Vrije Universiteit Amsterdam and may be used under a [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) license."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "8ab22f67",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Julia 1.9.1",
|
||||
"language": "julia",
|
||||
"name": "julia-1.9"
|
||||
},
|
||||
"language_info": {
|
||||
"file_extension": ".jl",
|
||||
"mimetype": "application/julia",
|
||||
"name": "julia",
|
||||
"version": "1.9.1"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 5
|
||||
}
|
||||
@@ -0,0 +1,930 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "2133c064",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<img src=\"https://upload.wikimedia.org/wikipedia/commons/thumb/3/39/VU_logo.png/800px-VU_logo.png?20161029201021\" width=\"350\">\n",
|
||||
"\n",
|
||||
"### Programming large-scale parallel systems\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"# All pairs of shortest paths\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "a7b64d5a",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Contents\n",
|
||||
"\n",
|
||||
"In this notebook, we will learn\n",
|
||||
"\n",
|
||||
"- How to parallelize Floyd's algorithm\n",
|
||||
"- How communication can affect the correctness of a distributed algorithm\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "394d4b7a",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<div class=\"alert alert-block alert-info\">\n",
|
||||
"<b>Note:</b> Do not forget to run the next cell before starting studying this notebook. \n",
|
||||
"</div>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "1dc78750",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"using Printf\n",
|
||||
"\n",
|
||||
"function answer_checker(answer,solution)\n",
|
||||
" if answer == solution\n",
|
||||
" \"🥳 Well done! \"\n",
|
||||
" else\n",
|
||||
" \"It's not correct. Keep trying! 💪\"\n",
|
||||
" end |> println\n",
|
||||
"end\n",
|
||||
"floyd_check(answer) = answer_checker(answer,\"c\")\n",
|
||||
"floyd_impl_check(answer) = answer_checker(answer, \"d\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "24b5c21a",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## The All Pairs of Shortest Paths (ASP) problem\n",
|
||||
"\n",
|
||||
"Let us start by presenting the all pairs of shortest paths (ASP) problem and its solution, the [Floyd–Warshall algorithm](https://en.wikipedia.org/wiki/Floyd%E2%80%93Warshall_algorithm).\n",
|
||||
"\n",
|
||||
"### Problem statement\n",
|
||||
"\n",
|
||||
"- Given a graph $G$ with a distance table $C$\n",
|
||||
"- Compute the length of the shortest path between any two nodes in \n",
|
||||
"$G$"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "ade31d26",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"We represent the distance table as a matrix, where $C_{ij}$ is the distance from node $i$ to node $j$. The next figure shows the input and solution (output) of the ASP problem for a simple 4-node directed graph. Note that the minimum distance from node 2 to node 3, $C_{23}=8$, is highlighted in the figure."
|
||||
]
|
||||
},
|
||||
{
|
||||
"attachments": {
|
||||
"g37385.png": {
|
||||
"image/png": "iVBORw0KGgoAAAANSUhEUgAABGgAAAGgCAYAAAD2CVFOAAA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RriJCIiItKyHsAbbgcRpUJMV3gwQ4uWuBiLG2ZgpuQWEWlLLmaokoQ6gEAnjk2YGmWdwVQ6Xq8nLrLcDkBEREQkhXkJ1HJJJ3mkZ9wdke92ACKSNjx0vmtkrPo0vToDZ10a1yhBIyIiItKyHZgna+mgeTpWMAUWf+ZiLG74xO0ARCRt1JE+1/Zkeg6T4AdTEPlWF2NJppaK74tIgnXBVO8eBhyEqQa+J4GZNURERNKVigSLiEhHqEiwy9SDRjLZYGASZhrUkcAoYK9W2m/DTJ/3JfAh8FrTf+MxjZ6IiIiIiIhIi1QkWDLN/sD5wKnA8Djsbwum4ODDwMtAYxz2KSIikgiXYHqIAqwFbnMxFhERST83ADlNP78HPOViLCKSprIxSZmFBLrkJeK1DigHBiTntEREREREREREUl8WpgBiNYlNzDhfO4E/AgMTf4oiIiIiIiLSGWiIk6SrCcBfaHt6PBszq8N7mNoySzBz3NcA24FcoBumcPBQTK2ascBhQNc29r0V+D/gDlSnRkREREREREQ6kS6YxIyflnu41AFPA9OB/u08Tg4wETO13JpWjmUDLine truncated
|
||||
}
|
||||
},
|
||||
"cell_type": "markdown",
|
||||
"id": "7605a53f",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<div>\n",
|
||||
"<img src=\"attachment:g37385.png\" align=\"left\" width=\"450\"/>\n",
|
||||
"</div>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "d9979e39",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Floyd's sequential algoritm\n",
|
||||
"\n",
|
||||
"The ASP problem can be solved with the [Floyd–Warshall algorithm](https://en.wikipedia.org/wiki/Floyd%E2%80%93Warshall_algorithm). A sequential implementation of this algorithm is given in the following function:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "4fe447c5",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"function floyd!(C)\n",
|
||||
" n = size(C,1)\n",
|
||||
" @assert size(C,2) == n\n",
|
||||
" for k in 1:n\n",
|
||||
" for j in 1:n\n",
|
||||
" for i in 1:n\n",
|
||||
" @inbounds C[i,j] = min(C[i,j],C[i,k]+C[k,j])\n",
|
||||
" end\n",
|
||||
" end\n",
|
||||
" end\n",
|
||||
" C\n",
|
||||
"end"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "b27707b9",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"You can check that this function computes the solution of the small ASP problem in the figure above by executing next cell. Note that we used a large number to represent that there is no direct connection between two nodes."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "860e537c",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"inf = 1000\n",
|
||||
"C = [\n",
|
||||
" 0 inf inf 1\n",
|
||||
" 2 0 inf 9\n",
|
||||
" inf 3 0 inf\n",
|
||||
" inf inf 5 0 \n",
|
||||
"]\n",
|
||||
"floyd!(C)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "b9eeb64d",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### The algorithm explained\n",
|
||||
"\n",
|
||||
"The main idea of the algorithm is to perform as many iterations as nodes in the graph. At iteration $k$, we update the distance matrix $C$ by finding the shortest paths between each pair of nodes, allowing indirect paths via nodes from 1 to $k$. At the last iteration, it is allowed to visit all nodes and, thus, the distance table will contain the solution of the ASP problem.\n",
|
||||
"\n",
|
||||
"This process is cleverly done with three nested loops:\n",
|
||||
"\n",
|
||||
"```julia\n",
|
||||
"n = size(C,1)\n",
|
||||
"for k in 1:n\n",
|
||||
" for j in 1:n\n",
|
||||
" for i in 1:n\n",
|
||||
" C[i,j] = min(C[i,j],C[i,k]+C[k,j])\n",
|
||||
" end\n",
|
||||
" end\n",
|
||||
"end\n",
|
||||
"```\n",
|
||||
"\n",
|
||||
"At each outer iteration $k$, we do a loop over the distance matrix $C$. For each pair of nodes $i$ and $j$ we compare the current distance $C_{ij}$ against the distance via node $k$, namely $C_{ik}+C_{kj}$, and update $C_{ij}$ with the minimum."
|
||||
]
|
||||
},
|
||||
{
|
||||
"attachments": {
|
||||
"g42544.png": {
|
||||
"image/png": "iVBORw0KGgoAAAANSUhEUgAABAIAAAD1CAYAAADK+FcHAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAewgAAHsIBbtB1PgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAACAASURBVHic7N11uBzV/cfx99wbJYEkkADBSQnBCxQpUpwCBYprixYtFC3Swg9rcdfiUlwKheIUh9JCgbZIgOAWLCRAlCT3/P44u9nZsZ3ZHVn5vJ5nnnt3duac797dnTvznSMOIu1tKWA1YFRpGQkMLC2DgSnAxNLyCfAm8BbwH+BZYHL+IYuIiIiIiIhIXH2BrYEbgbGAaWCZBjwF/A5YKM8XISIiIiIiIiLRlgAuBsbR2MV/2DITeBzYCejO6TWJiIiIiIiIiMfywG3YC/UsEgBBy9vAXkDvHF6fiIiIiIhIqpyiAxCp05zAacCvgK4a284A3qDS//8LYBIwAegPDCiVtwi2ZcHSwJAYMYwGfg08kTR4EREREREREYlvJ+zFfNRd+0+A84DNgDkSlt+FbWlwKPAk0BNRTw/wZ2BQIy9IRERERERERPxmA64kuh//ncBGpNuPfxHgeKKTD+8AK6dYp4iIiIiIiEhHWwj4H+F35W/GNunP0gDgEODzkDimYccOEBEREREREZEGLAl8SPDF95vABjnHMxg4Hzv2QFBMp+Ucj4iIiIiIiEjbWIHgKQF7gNMpduT+NYGPCE4GnF1gXCIiIiIiIiItaTHgM/wX2V8DPyswLrehwAMEJwOOKTAuERERERERkZYyD3YAPu/F9cfAMgXGFaQXcA3BrRZ+VWBcIiIiIiIiIi2hC3gU/4X1u9gR/JuRA5yLP+apwEoFxiUiIiIiIiLS9I7Hf0H9BTCqyKBicAie3vBtYFCBcYmIiIi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Qxggwfy3tu0HA8y3eIqARahEgIiIiIvlIeudWOtsK2LvVb2FbAfQrrW+kSX+5NUCn3j0ttwx43LO+G7gO+GXuEYU7HVjW9fgZYENwvohfhPMudoaEo7DJDhERERERyVmTdQ0wA7FNjMM8A871wU+ZZYDfuFYcDM7UFGJaFjjQteIQcKakUO522BHkwxwDzleN15OKH2Hfl7WpHgCw0T79BhgPXN1gOa1uMpVuAuu61ndTGSzvhpxj8jDzAHu7VnwL7ALO5ORlOQY4A0wTjAlhhmFnkSibmCyx4StvEDBX6cFMcD6ovywRERERkaZleoFZE8xJYB60I4KbD8GMBfM6mCfAnAlmCzD9apQ1NGRQsfJyecS+m3i2nT1820SvbzNPuYNSKvecGq81rbnr03AhlSbrjXQDCFqOz/F1NLvZgEcJ7iawS4FxAeaPns/nSRnVk2PXALMpmImufd4GM7K+uGeVqcECRURERKSdmT5gfg3mkxoXtO7lazAXgZk/pEwlApozEdANrAkcA/ydyqwAjSQFerB3wudC3Jo0GWBec302Z4BZIKN6ckoEmH3ATHdt/y8SjXUQWq4SASIiIiLSrswoMG8mSAB4l4lg9g0o15sIWNe/TWhMLZYI8NWzehMnArx+gO0qMInGkgHn5R14i5gNm3AJSgbsmn84ZhiYHtdn84UM68o4EWAcMCd4vmsPpXi8UCJARERERJpeHYMFmp8A/wAWd63sAR4EDsZOEzYKmA/4IbA5cA7gnlZsALBlLine truncated
|
||||
}
|
||||
},
|
||||
"cell_type": "markdown",
|
||||
"id": "b132bccb",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<div>\n",
|
||||
"<img src=\"attachment:g42544.png\" align=\"left\" width=\"400\"/>\n",
|
||||
"</div>\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "722e330c",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"The update of the distance matrix at each iteration is illustrated in the next figure for a small ASP presented above. We highlight in green the distances that are updated in each iteration. Note that adding values to the table can be interpreted as adding new connections in the graph, as illustrated in the figure."
|
||||
]
|
||||
},
|
||||
{
|
||||
"attachments": {
|
||||
"g38106.png": {
|
||||
"image/png": "iVBORw0KGgoAAAANSUhEUgAABGgAAAGhCAYAAAA9VYLrAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAewgAAHsIBbtB1PgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAACAASURBVHic7N13nBT1/cfx114vcPQOAkoURFEpKgooaGLvoljQkKixYie/2DUaRU0sMTE2ogY1auyKIHbRaBARaSKKICC9Hndc3fn98d29nZ3bu9u9292Z3X0/H495sDM3u/eZO2525r3fAiIiIiIiIiLSHPcDlm3xuVuOpLIctwsQERERSUG7Ai/Y1r8ALnGpFhERkWRpCwwBhgb+3dX2tRrgQDeKShcKaERERERiV4i5MA3a7FYhaeg84HTb+jFAlUu1iIgI/Ab4FeZ9r18j+1Unp5z0pYBGRERERLykH3C4bT3LrUJERASAS4H93C4iE+gNT0RERERERERitQq1cIwrtaARERERERERkcasAebYltnAWmA50Nu9stKLAhoRERERERERachoYJvbRWQCdXESERER8Y4OQKsEf4+OQEGCv4eIiKQPhTNJohY0IiIiIol3PbBL4PEPwN2Bx22AcwPLnoSCk1LgXeBhYGaU3+NqYPfA49XAbYHH3TEzI40DdgPyAtvXAW8AfwfmRvk9JmOmWAXTvP3xKJ83LFBD0J2YZvFBnYE/Bh4f4HjuQ0BtA6/7eKAOEZFU4gMmYs77Qcsx51i/GwWJiIiIiKSqgYBlW95pYv8vbfvOCmw7EHNBbjWx/JPoPlT7wPaceYFtJ2CmAG/s9WswNwXRtKxeZXvec1HsHzTO8T2HOb7er4kaG1rOiKEGEZFEuJ/w85Kvif1zgEccz5kH9ExgjYm0nNBxaMDgFlILGhEREZHkOwh4H8iPYt9fAzuAy2L8HscArxC6WagB1mNa0HS07ZcNTApsOw9zkS0iIvHXCngeONq27V3gFGC7KxWJp2gMGhEREZHk6gy8hAlnVgCXArsCuYFtg4EpjudcDAyN4Xt0BJ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+AAUBHzOx9W4DvgQVAjXultUhbYDhmFsZBQKfA0hEoxxzjPOAj4AVguztliogkVBtgH6AXUAzsBDYCc4D1LtbVElmY96wDA0svoCvm/F4AbAOWA18CLwNfuFKliCTMfYCV7GXkyJGW06hRo5JeB7AuXj9IEZEU0g04DrgFeBNYBWy2LUe6VlnLtQV+i7lw3UbD5/9S4DHMhXAqeRjwE/373A7g96TXB4KdgB8J/z8729WKRLwjFxgMXAA8ggkr7H8rn7hXWlwMAyYDX9P4ufBr4HeYn0eq6AtsJbZ7mc8wQX06uY7w/7ObgXGuViSSRLeR2QHN9/H6QYqIpIC7gdU0fW48zq0CW+hCzCeosbwPVABXu1FsM71E897vXgfyXag3EZ6n/vEtcbUiEfftAfwPc05r7Fwwz60CWygXWETs5745pM6kIHvSvPN7OXCEC/UmwgAiv4+fm8wi0ukTDUk9pW4X4LJMP34RySzDgO5uF5FAu2GagNuVA3Mxzd2rgF2AIUBe4Ov5wL1AEfDH5JQZF0uBdzHN25dijs+PaeY/CBgLHI/p1gUmdLsduDbplcbX8cBpbhch4kEdMef4dJVN5BaPy4DvMC0mCzDn9562rw8GPgBGACsSXGO87MS0dPoA0x13Line truncated
|
||||
}
|
||||
},
|
||||
"cell_type": "markdown",
|
||||
"id": "50b782df",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<div>\n",
|
||||
"<img src=\"attachment:g38106.png\" align=\"left\" width=\"450\"/>\n",
|
||||
"</div>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"attachments": {
|
||||
"g38354.png": {
|
||||
"image/png": "iVBORw0KGgoAAAANSUhEUgAABGgAAAGhCAYAAAA9VYLrAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAewgAAHsIBbtB1PgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAACAASURBVHic7N13nBT1/cfx1+xVDjh6BxFFBRUsiIoBFTQRS+zYwRBLLBFbxK6oMYAaNcaYGJWIsUSNvaHYRaM/R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UCCd53DTAHeBt4E/gYqEt9iSIiIiIiIiIiuac7cAnwGamd6GoVcBcw1LtDERERSdqOwJDQbWefaxERERGRPLQL8DBQS/pnJf8UOJ7Ee+OIiIiIiIiIiOS07YGnMDOFJxOybASWA98DS4C1JL8k3lfAUek/RBERERERERGRzFQKXIeZ4LexEKUemA3cCpwA7A6UNfCYBZgJhEcDE4GXMRMHNxXUvAD0S/HxiYiIiIiIiIhktJ2BeTQemnwAnAt0auFzFQGHAo/SeBi0BRjfwucSEREREREREckKvwE2Ez8kqQMeAwan6bk7YHrtrG7g+W1gOmb5bhERERERERGRnGMBf6LhYGQGsJNHtbQB/ghUNVDLR0Bnj2oREREREREREfFEAXAf8cOQlcAYn+raCXingbq+Bvr6VJeIiIiIiIiISEpZwP3ED0HeAXr5VxpgwqNJmOFV7vp+APr4VpmIiIiIiIiISIpMJX4481dMOJIpDiP+3DhzgfY+1iUiIiIiIiIi0iK/I344c42fRTViH2AVsfW+QWaFSSIiIiIiIiIiCRlE/GWtr/SzqATsCqwltu5JPtYkIiIiIiIiIpK0NsACYkOOO/wsKgkHAJVE114PjPSzKBERERERERGRZNxG9g8TOoPYY/gOKPWzKBERERERERGRROwC1BAdbKwAurfwcTsDo4GrgaeBxZihSM7bfi18DrfpxIY016f4OUREREREREREUu5NYkON0c14nO6Y+Wr+iwlj4k027L7t37LSY7QFfnQ9RyVaeltEREREREREMtgwYkOTJ5v5WIfEeSyvAxqAE+I8z11peB4RERERERERkZR4mdT1NsmUgAZiewVV0PIhWyIiIiIiIpJjAn4XIALsDBzqavsXZohQKgSBb4BHgEtCN6/c4NpuBZzr4fOLiIiIiIiIiCRkCtG9TGqBfi14vH2IhDEHAOWu74/Aux40AO+5nmshYKXx+UREREREREREkhIAfiA6wHguzc/pdUBzisfPJyIiIiIiIllGQ5zEb8OInWvm334UkkbPAhtdbcf7UYiIiIiIiIhkJgU04rdRru1NwAt+FJJGFZiQxukgPwoRERERERGRzKSARvzmDmjeBar9KCTNXndtDwR6+FGIiIiIiIiIZB4FNOKnAmBfV9tbfhTigTdd2xawnx+FiIiIiIiISOZRQCN+6guUuto+9KMQDywjdtnwAX4UIiIiIiIiIplHAY34aac4bV97XoV3vnFt7+hLFSIiIiIiIpJxFNCIn7Z3ba8J3XKVO6Dp70sVIiIiIiIiknEU0Iif2ru2V/hShXdWurbb+VKFiIiIiIiIZBwFNOKnNq7tzb5U4Z2Nru1yX6oQERERERGRjFPodwGS1/ItoNnk2m7rSxUiIuKFALADMBDojFm9bx3wHTAPqPOvtBZpDwzDrMI4GOgSunUGKjDHOBd4B3iC2IsTIiK5oB2wG9AHaA1UAquB2cDPPtbVEgHMLine truncated
|
||||
}
|
||||
},
|
||||
"cell_type": "markdown",
|
||||
"id": "eb5e46a2",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<div>\n",
|
||||
"<img src=\"attachment:g38354.png\" align=\"left\" width=\"450\"/>\n",
|
||||
"</div>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"attachments": {
|
||||
"g38620.png": {
|
||||
"image/png": "iVBORw0KGgoAAAANSUhEUgAABGgAAAGhCAYAAAA9VYLrAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAewgAAHsIBbtB1PgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAACAASURBVHic7N13mFTV/cfx991lC73YQUQWCzZU1EQSLKhR7C0omlhjN7Ggwi5qJEbZJRpbmj1qNCqJvaEo9vKzERVFUFhQUBBEkLrsMuf3x5lh7tyZ3Z1675TP63nmce/dO3e+s7J3Zz7zPec4iIiIiIiIiEg6bgIudG2XASagWvzSBdg4fOsGrAWWADOApgDrKngdgi5AREREpADVABNd2/8HnB9QLSIiIrlSBfwUGBK+7Qls0sqxzcAHwAPAfcCPfhQoIiIiIqVtB+wnpJHbC8GWU1TOACa7bpXBliMi0qabiP174ARbTtYdSOzzS/Y2Hzg8gHoLmjpoRERERCSfbAUc4NouC6oQERFJW2/gMWzofk+wpRQO/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2B6YRtuhyZvAOUCvDB+rAzAcO3xqVRuPtxI4LcPHEhEREREREREpCKdhw5DWumX+DQzK0WP3AK4EFrXy+Aa4D+ico8cXEREREREREQmUA9TTejDyHHblCj90Bq4G1rRSy7vARj7VIiIiIiIiIiLii3LgThKHIQuBXwZU1zbAK63UNQPYMqC6RERERERERESyyqH1cOYVoHdglVllwBgSrwD1FdA3uNJERERERERERLLjTyQOZ27Bdtbki4OBFcTX+TF27hoRERERERERkYJ0DvGBRwi4PMii2vATEk8g/BL5FSaJiIiIiIiIiCRlJxIva10bZFFJ2BFYQnzd4wKsSUREREREREQkZV2AmcSHHDcEWVQK9gZWE1v7OmC/IIsSEREREREREUnFn0m8jHZZkEWl6HTin8OXQHWQRYmIiIiIiIiIJGNHYC2xwca3wKYZnndDYDh2/ppHgTnYoUju288yfAyve4kPaa7K8mOIiIiIiIiIiGTdy8SHGgelcZ5NgTrgv9gwJtFKUN7b3pmVHqcr8LXnMVYDW2T5cUREREREREREsmYI8aHJxDTPdVCCc/kd0ACMSPA4t+TgcUREREREREREsuI54rtNNk/zXPkS0IBdZtv9OKvIfMiWiIiIiIiIFJlCmnhVitf22Dli3P4JzMvS+UPADOABYFT45pc/eLY7Auf5+PgiIiIiIiIiIklpILbLpBnYMoPz/ZRoGLMP0M3z/b3wr4MG4DXPYzUCTg4fT0REREREREQkJWXAV8QGGE/k+DH9DmhO8PnxREREREREpMBoiJMEbQjQ17PvX0EUkkOPAz969o0IohARERERERHJTwpoJGj7ebaXA08FUUgOrcaGNG7e5y0iIiIiIiIlTAGNBM0bVLwGNAVRSI696NneDtgsiEJEREREREQk/yigkSCVA3t69r0cRCE+mOLZdoCfBVGIiIiIiIiI5B8FNBKkfkC1Z987QRTig/nA1559A4MoRERERERERPKPAhoJ0rYJ9n3uexX+meHZ3iaQKkRERERERCTvKKCRIA3wbH8fvhUrb0CzVSBViIiIiIiISN5RQCNB6uHZXhBIFf5Z6NnuHkgVIiIiIiIikncU0EiQuni2VwRShX9+9Gx3C6QKERERERERyTsdgi5ALine truncated
|
||||
}
|
||||
},
|
||||
"cell_type": "markdown",
|
||||
"id": "d02606e0",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<div>\n",
|
||||
"<img src=\"attachment:g38620.png\" align=\"left\" width=\"450\"/>\n",
|
||||
"</div>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"attachments": {
|
||||
"g38913.png": {
|
||||
"image/png": "iVBORw0KGgoAAAANSUhEUgAABGgAAAGhCAYAAAA9VYLrAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAewgAAHsIBbtB1PgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAACAASURBVHic7N13fBR1/sfx12xICL1KRzooKiLq2UDBCvaGevZer6onB+rp3SlFvVPvflctZ69nOQuiIKjYFREbSgtFlN4TCEl2fn98s9nZ2U2ym+zMbHk/H499kJ3M7nw2JLO77/1+P18QERERERERkYa4B7AdFyvYciSbNQm6ABEREZEs1Bd4xnH9I+CagGoREREJ2qXAla5t04HxAdSStRTQiIiIiKSuGbCv4/qGoArJQZcCZzquHwfsDKgWERGpX2/gbqCla/ti/0vJbgpoRERERCST9AeOdFwPBVWIiIjUywL+RXw4Iw2gJzwRERERERERaYhLgaOrv94aZCG5QAGNiIiIiIiIiKSqG3BH9ddh4NbgSskNCmhEREREREREJFX/ANpWf/034L0Aa8kJCmhEREREMkcHvJ/H3xEo9vgYIiKS2y4ATqz+ejlwY4C15Aw1CRYRERHx3o3ArtVfLyY6JLwN5kXuBcBgosHJVmAG5tPJ6Uke4zpgYPXXK4E/VH/dDdMj4CygH1BUvX018DLwd2BukseYQvTT0k+A+5O83f7VNURMApY6rncC/lj99QGu2/4fUFXL/d5fXYeISDaxgF9gzvsRSzHn2HAQBaWoC/Bnx/WrUf8ZEREREQnIHoDtuLxRz/6fOvZ9t3rbgZgX5HY9l/+Q3Idqsxy3mVe97STMEuB13X8l5k1BMiOrv3fc7skk9o84y3XM/V3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A/KigMho/ZUtERERERERyTCjoAkSAwcAY17b/YKYIpUMY+A54HLi2+uKX37uuNwOu8vH4IiIiIiIiIiJJmUzsKJMKoE8j7u8AomHMYUBr1/dH4N8IGoDZrmMtASwPjyciIiIiIiIikpIQsJzYAON/Hh/T74DmbJ+PJyIiIiIiIllGU5wkaAcR32vm0SAK8dCLwBbXttODKEREREREREQykwIaCdrhrutbgZeDKMRDZZiQxumIIAoRERERERGRzKSARoLmDmjeAcqDKMRjM1zXdwe6BlGIiIiIiIiIZB4FNBKkAuBA17ZZQRTig5mu6xZwcBCFiIiIiIiISOZRQCNB6gUUu7Z9GEQhPlhJ/LLhuwVRiIiIiIiIiGQeBTQSpEEJtn3rexX++c51fWAgVYiIiIiIiEjGUUAjQernur6++pKr3AFN/0CqEBERERERkYyjgEaC1NZ1fVUgVfhntet6m0CqEBERERERkYyjgEaC1NJ1fVsgVfhni+t660CqEBERERERkYzTJOgCJK/lW0Cz1XW9VSBViIiIH0LAAGB3oCNm9b6NwCLgK6AyuNIapS1wEGYVxiHALtWXjkAZ5jHOA94GniH+wwkRkVzQBtgb6Am0ALYD64A5wJoA62qMEOY568DqS0+gC+b8XgxsBpYCnwLPAx8FUqWIeOYewHZc3vbpuCNcx7WBQ3047pWuY7qnPImI5IOuwAnArcArwPfABsdldGCVNV5b4BLMC9fNxD/XRC5bgfswL4SzyT+AMLU/LvdlGzCO3PpAcBeghNjf2U8CrUgkcxQCw4DLgX9hwgrn38rs4EpLLine truncated
|
||||
}
|
||||
},
|
||||
"cell_type": "markdown",
|
||||
"id": "0aca29d3",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<div>\n",
|
||||
"<img src=\"attachment:g38913.png\" align=\"left\" width=\"450\"/>\n",
|
||||
"</div>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "c7027ac3",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Serial performance\n",
|
||||
"\n",
|
||||
"This algorithm is memory bound, meaning that the main cost is in getting and setting data from the input matrix `C`. In this situation, the order in which we traverse the entries of matrix `C` has a significant performance impact.\n",
|
||||
"\n",
|
||||
"The following function computes the same result as for the previous function `floyd!`, but the nesting of loops over i and j is changed.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "75cac17e",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"function floyd2!(C)\n",
|
||||
" n = size(C,1)\n",
|
||||
" @assert size(C,2) == n\n",
|
||||
" for k in 1:n\n",
|
||||
" for i in 1:n\n",
|
||||
" for j in 1:n\n",
|
||||
" @inbounds C[i,j] = min(C[i,j],C[i,k]+C[k,j])\n",
|
||||
" end\n",
|
||||
" end\n",
|
||||
" end\n",
|
||||
" C\n",
|
||||
"end"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "399385e8",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
" Compare the performance of both implementations (run the cell several times)."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "907bc8c9",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"n = 1000\n",
|
||||
"C = rand(n,n)\n",
|
||||
"@time floyd!(C)\n",
|
||||
"C = rand(n,n)\n",
|
||||
"@time floyd2!(C);"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "ad811b10",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"The performance difference is significant. Matrices in Julia are stored in memory in column-major order (like in Fortran, unlike in C and Python). It means that it is more efficient to access the data also in column-major order (like in function `floyd!`). See this section of [Julia's performance tips](https://docs.julialang.org/en/v1/manual/performance-tips/#man-performance-column-major) if you are interested in further details."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "0c95ea88",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Parallelization\n",
|
||||
"\n",
|
||||
"Now, let us move to the parallelization of the method.\n",
|
||||
"\n",
|
||||
"### Where can we exploit parallelism?\n",
|
||||
"\n",
|
||||
"Recall:\n",
|
||||
"\n",
|
||||
"```julia\n",
|
||||
"n = size(C,1)\n",
|
||||
"for k in 1:n\n",
|
||||
" for j in 1:n\n",
|
||||
" for i in 1:n\n",
|
||||
" C[i,j] = min(C[i,j],C[i,k]+C[k,j])\n",
|
||||
" end\n",
|
||||
" end\n",
|
||||
"end\n",
|
||||
"```\n",
|
||||
"\n",
|
||||
"- The outer loop cannot be parallelized since the operations at iteration $k$ require the result of iteration $k-1$.\n",
|
||||
"- The inner loops over $i$ and $j$ can be parallelized at a given iteration $k$."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "5f26f9b5",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Parallelization strategy\n",
|
||||
"\n",
|
||||
"As for the matrix-matrix product and Jacobi, any of the iterations over $i$ and $j$ are independent and could be computed on a different processor. However, we need a larger grain size for performance reason. Here, we adopt the same strategy as for algorithm 3 in the matrix-matrix product:\n",
|
||||
"\n",
|
||||
"- Each process will update a subset of consecutive rows of the distance table $C$ at each iteration $k$."
|
||||
]
|
||||
},
|
||||
{
|
||||
"attachments": {
|
||||
"fig-asp-partition.png": {
|
||||
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAhAAAAJHCAYAAADBi2/GAAAACXBIWXMAAB7CAAAewgFu0HU+AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAIABJREFUeJzs3XmYJWV59/HvPTsw7MMiy4AobgjiggiKu7iiqMGYxKBoYtREoxGiRhER9VUganzj8mrcADUxrogbiAugKEbAEPcFRARk3xmY5X7/eM6E09V1uvvpPt11eub7ua66oJ9Tyz1nq9+peuqpyEw0NyJiF+ApFYvcDlwP3NCbrsrMq4ZYz9OBHfuabsjMTw9r/ZI2XBFxMLB7X9OqzDyp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7tQwsEixn62mqezZvO92InMPDci3gK8qa95r8Zst1FODd45i6VcRxlMar22708NYIDY8LR1mLxiJivMzBsj4pWUow1tX5zLuCtMvAO4MiK+DHwZOGOuOyX1flU/s1fPYymDI81HK1ramufHZ2r7lrZX9aZh2CDuOjgTEXEgZQTXx1ECld+7xVspV6a1DcUN8Oop9m+ZiesZGyAWRcRyO1JOjZ0oNyC9m0Tt3WheRxkbYkYy8yTKTvl3U5h9R8p9BT4HXBMRn+md7phVEbFVRLyVMojQyZSrDeZreID2c9/TObVQu435tP6RFRHPjIjzKIN8vZ7xLine truncated
|
||||
}
|
||||
},
|
||||
"cell_type": "markdown",
|
||||
"id": "9a9e8c44",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<div>\n",
|
||||
"<img src=\"attachment:fig-asp-partition.png\" align=\"left\" width=\"250\"/>\n",
|
||||
"</div>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "9eab6b5d",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Data dependencies\n",
|
||||
"\n",
|
||||
"Recall: we perform this update at iteration $k$:\n",
|
||||
"\n",
|
||||
"`C[i,j] = min(C[i,j],C[i,k]+C[k,j])`\n",
|
||||
"\n",
|
||||
"If each process updates a block of rows of matrix $C$, which data do we need for this operation?\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"attachments": {
|
||||
"g14170.png": {
|
||||
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAycAAAGYCAYAAABYqp0gAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAewgAAHsIBbtB1PgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAACAASURBVHic7d13nCRlnfjxT29OLCwLLEFgSUpakoKIeAqyZhFEFARE9E4FBRQRRThdUDEAnqee+hOEUxEDKmAmLEFQ1ANFQJAgGQQ2sSwLbKzfH0+3Xd1b1d0z09X1zPTn/XrVa3qmq5/6TnWlb9UTQFIMZ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To9bJ3W43HYqNA64WFZykl6n13T4mfQ63Dl3ruC6AUVTt2217M0I5+Hm7vJretnges/U66upD1OQ51nCNcMbqr+/mPo4IFn+2EEMD1GvNjrYJ5BZRhGSkBOqvz9JON9fO4iyTE6GiXSjrrwDUIWQoZ5M+2pINd3cMCHE+QnCI/msXjCytHusXrZO+stfTDhBbkS4WNmQ+t2JjagnCg/SfhyWTpcJYd39J6Ev8E7v2nZrfW+den062Sfc5gufdIP65lGM0/WJO+kH3/FOFIP0cS7vjuUoQqcVH6HzaqzdPjavT6jrfhjtq2DWxHZs/hrwH4T2M9OALine truncated
|
||||
}
|
||||
},
|
||||
"cell_type": "markdown",
|
||||
"id": "5cf07baf",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<div>\n",
|
||||
"<img src=\"attachment:g14170.png\" align=\"left\" width=\"450\"/>\n",
|
||||
"</div>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "db9a3294",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"At each iteration, the processor needs the input values `C[i,j]`, `C[i,k]` and `C[k,j]`. Since we split the data row-wise, the process already has values `C[i,j]` and `C[i,k]`. However, `C[k,j]` may be stored in a different process. "
|
||||
]
|
||||
},
|
||||
{
|
||||
"attachments": {
|
||||
"g12830.png": {
|
||||
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYoAAAGgCAYAAAC0SSBAAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAewgAAHsIBbtB1PgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAABqISURBVHic7d15nF11ff/x1wyTIQnEBBGJbCFIJeyEXcpmlJCQIFo2W6kslqq1NZCCta611BXJT0RFS6nW0ooboAJSIKBIILKEStghbEIIaxIIhCwz9/fHd6ZzZrz3M5PJzP2ee/N6Ph73kXu/c2fOOzNn7nvOOfd8DzSHZUCl63Zd5iyS1FTacgeQpMzGAFsUHi8BXsuUpZRacweQp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0lFcCxwWPD1XgdeLDx+IzCKtLVxCPB24NPAjUMTf9A2Jf3fOoHHSBcbe6lrfHvSFsumwNmkLauLs6RUU7Ao1Og+S9qagLTL5zzSLqa+2oGppK2OTYOvtwDoO1HleOBE0lZAW9cy/5dURLk8DPwjcAfwcpWPHwh8HhgHfBC4Cq9cqUHyYLYa2TH0lMTdpBKoVhIAq4ErgT9n3bcGlgDnA1d0PR4N5J6V9EHgBqqXBMB84Ftd9zcCDqpHKDUni0KNqg04rev+a8Bnuv7tz2ukffuDcXXh/q6D/Br1tLBwLine truncated
|
||||
}
|
||||
},
|
||||
"cell_type": "markdown",
|
||||
"id": "e17c5271",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<div>\n",
|
||||
"<img src=\"attachment:g12830.png\" align=\"left\" width=\"225\"/>\n",
|
||||
"</div>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "a01872ef",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"As we iterate over columns $j$, the process needs input from all values of row $k$. Therefore, at the start of iteration $k$, the whole row $k$ needs to be communicated."
|
||||
]
|
||||
},
|
||||
{
|
||||
"attachments": {
|
||||
"g12957.png": {
|
||||
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYoAAAGgCAYAAAC0SSBAAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAewgAAHsIBbtB1PgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAABprSURBVHic7d15lFx1nffxdyWdkAQCYY/syaiAERBBNkEwQkhMGFS2eZw8sszAHMcZIxF4HB11HMcVwhlkEBnGQZERRAQRAyhEVEiIyPLIEiLKpiwxEEIIELJ1zR+/bvt2U/Xt6qXqdzt5v86p01W3b/f9pHOrP3233wU1U7Xw+H7mLJLUL225A0hSZmOBbQuvlwCvZspSSsNyB5CkzE4AHi08jsobp3wsCklSyF1PzVU8LrEwWwpJGgCLorlOzB1AkgbKXU+SpJBFIUk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fDZjQ8fxs0pbVN7Ok1AbBotBQ9xnS1gTAo6Qtg3trzDcSmELa6tgs+H73Aj0HqhwPnETaCmjrWOb/JxVRLr8D/gm4G3ipxucPAj4HjAP+BpiLd65UP3kwW0PZsXSVxP2kEqhVEgBrgB8D/4e+bw0sAS4AftjxegyQe1TS3wI/o3ZJACwELup4Phw4pBWhtGGyKDRUtQGndTx/Ffg08EoDX/cqad9+f9xYeD6pn9+jlR4oPN8iWwoNLine truncated
|
||||
}
|
||||
},
|
||||
"cell_type": "markdown",
|
||||
"id": "3261af17",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<div>\n",
|
||||
"<img src=\"attachment:g12957.png\" align=\"left\" width=\"225\"/>\n",
|
||||
"</div>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "9d1de618",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"In summary, at iteration $k$ a given process will need row number $k$ which might be stored remotely in another process. The owner of row $k$ needs to *broadcast* this row to the other processes at iteration $k$."
|
||||
]
|
||||
},
|
||||
{
|
||||
"attachments": {
|
||||
"g12703.png": {
|
||||
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAycAAAGYCAYAAABYqp0gAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAewgAAHsIBbtB1PgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAACAASURBVHic7d13nCRlnfjxz2wOsLBLXOKSRHJQUAFPQdCfCUFERYKAioIBM6Koq6cYEM/DdGeA00PvMGI8JSMgBvSAJXpKVoFddmFhWTb2749vt/10T1V3z0zP1LPL5/169W5PT3X1d6qrnqpvPQkk5eAQoFZ/fKviWHK1Ls1t9JeKY5GkXkyjWW7dNQrr/1J93QuAGQW/n5N8/u9G4fOf7E6huX3nVhvKmLiY5t/7tBGsZ0NgcX09H2//5YQRrFid3UkUCkUeAx6tP/4M/BH4PXAR8MRYBFdgIrBl/fky4K8VxaGxM7P+AHgIe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TIht90FiLPBe79r2a3tvnzz/KMUn3PYLn7RDffssxml74l7GwXe+E+UgLefK7liOIwateA+9N2Ptd9m8EdHW/Wi6N8FsyK1s/hLwBqL/zEzg08CniAvdXxFNTC6lc61rWm7NpfgGLine truncated
|
||||
}
|
||||
},
|
||||
"cell_type": "markdown",
|
||||
"id": "8412a275",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<div>\n",
|
||||
"<img src=\"attachment:g12703.png\" align=\"left\" width=\"450\"/>\n",
|
||||
"</div>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "2cf55de3",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<div class=\"alert alert-block alert-success\">\n",
|
||||
"<b>Question:</b> How much data is communicated in each iteration in this parallel algorithm?\n",
|
||||
"</div>\n",
|
||||
"\n",
|
||||
" a) O(N²/P)\n",
|
||||
" b) O(N)\n",
|
||||
" c) O(NP)\n",
|
||||
" d) O(P)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "1bf4de56",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"answer = \"x\" # replace x with a, b, c or d\n",
|
||||
"floyd_check(answer)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "eba45ea4",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Efficiency"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "a15bc34e",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"**Computation cost:** Each process updates $N^2/P$ entries per iteration. "
|
||||
]
|
||||
},
|
||||
{
|
||||
"attachments": {
|
||||
"fig-asp-efficiency-comp.png": {
|
||||
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAbUAAAGgCAYAAAAtsfn1AAAACXBIWXMAAB7CAAAewgFu0HU+AAAAGXRFWHRTb2Z0d2FyZQB3d3cua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Z7M5GGcmdT4K1k+DvD8udZHgXPh2mrc6dork1M+D+ner7GN63J6yeVt98A+qcr38aLNqzvhmX7ATrtq1vvuVTYT31zHfeznBwO39hkaUWkOYC8zeefEQfLFifJVFL6ybB2qkw7ZHcSVpbOQOmLoeo6YtkVS/09EPPytxJmls7BfonVY9hXa2YAdvU+DW4uhd61sLEmn6wWjUVogem+Bxvtn+aAudPHjShLyV6x/rbIuKXwP7AkSmln25xvJposaR23RnAHR1NMqLjj4Sf/CMsOyZ3ktZ6rofrXwT79+VO0tzMr8ATb4Eb5+VO0twhr4a7Xg6LX5I7SWs9N8Dy5+RO0dr0b8ERV8APvpY7SXNzzoG+g+AvJ+VO0ty1vfCcq2v6HL8eOK2Nv6/IJTW3qUlSd7LUJEnFsNQkScWw1CRJqjNLTZK6k0tqkqRiWGqSpGJYapIk1ZmlJkndySU1SWM2Cd9vqpciS63FMFlS20wAngUcBuwHzAK2BZYD9wG/A34O3NjkvnsBpzaZvgJYDdwN3ErrId0G3/9rwK9HLine truncated
|
||||
}
|
||||
},
|
||||
"cell_type": "markdown",
|
||||
"id": "cc2668c8",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<div>\n",
|
||||
" <img src=\"attachment:fig-asp-efficiency-comp.png\" align=\"left\" width=\"225\"/>\n",
|
||||
" </div>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "d89d2b45",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"**Communication cost:** \n",
|
||||
"- One process broadcasts a message of length $N$ to $P-1$ processes per iteration. Thus, the **send cost** is $O(N P)$ per iteration (if we use send/receive instead of broadcast).\n",
|
||||
"- $P-1$ processes receive one message of length $N$ per iteration. Hence, the **receive cost** is $O(N)$ per iteration at each process. "
|
||||
]
|
||||
},
|
||||
{
|
||||
"attachments": {
|
||||
"fig-asp-efficiency-comm-2.png": {
|
||||
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA1AAAAMbCAYAAABDhHSeAAA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vcjr1tmRIoEREREamXmR0EFBK263WNNebggw/mqquuYsKECeTm5iY1Pmm4yspKli5dyp133smGDXFzpK1AMXCbu8ft2NsWKYESERERkbjMrD1wGXALELNRU6dOnbjsssuYNGkSnTt3TmZ40gzbt29n8eLFLFiwgC1b4uZInwN3Ave4e9yOvW2JEigREREROYCZZQHfJfRyOjLWmA4dOnDppZcyefJkunfvntT4JHE2b95McXEx999/Pzt3xs2R1hIaIj/g7nuSF136UQIlIiIiIvtYqPYwlvDN8sBYY3JycigoKGDq1Kn06hVzUUoy0Pr16ykuLuahhx6isrIy3rC3CeXqH/M2mkgogRIRERERAMzsHMKK08mxPs/KymL06NFMnz6d/v37JzU2SZ61a9eyYMEClixZwt69e+MNexO41d2XJTG0tKAESkRERKSNM7PTgFnAWfHGjBgxghtvvJHjjjsueYFJSr3zzjvcddddlJSULine truncated
|
||||
}
|
||||
},
|
||||
"cell_type": "markdown",
|
||||
"id": "e96eda2d",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<div>\n",
|
||||
"<img src=\"attachment:fig-asp-efficiency-comm-2.png\" align=\"left\" width=\"300\"/>\n",
|
||||
"</div>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "6993b9d0",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"In summary, the send/computation ratio is $O(P^2/N)$ and the receive/computation ratio is $O(P/N)$. The algorithm is potentially scalable if $P<<N$."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "494aa965",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Parallel Implementation\n",
|
||||
"\n",
|
||||
"Now, we will explore the parallel implementation of Floyd's algorithm using MPIClusterManagers."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "0b451628",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Creating MPI workers"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "91a1cbd8",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"] add MPI, MPIClusterManagers"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "6bc0122b",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"using MPIClusterManagers\n",
|
||||
"using Distributed\n",
|
||||
"if procs() == workers()\n",
|
||||
" nranks = 3\n",
|
||||
" manager = MPIWorkerManager(nranks)\n",
|
||||
" addprocs(manager)\n",
|
||||
" @everywhere using MPI; MPI.Init()\n",
|
||||
"end"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "680e56cf",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Code\n",
|
||||
"\n",
|
||||
"We split the code into two functions. The first function is called on the main process (the process running this notebook). It splits the input matrix into blocks of rows. Then, we use a remotecall to compute Floyd's algorithm in each worker with its corresponding block of rows.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "22234b2f",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"function floyd_dist!(C)\n",
|
||||
" m = size(C,1)\n",
|
||||
" @assert mod(m,nworkers()) == 0\n",
|
||||
" nrows_w = div(m,nworkers())\n",
|
||||
" @sync for (i,w) in enumerate(workers())\n",
|
||||
" rows_w = (1:nrows_w) .+ (i-1)*nrows_w\n",
|
||||
" Cw = C[rows_w,:]\n",
|
||||
" @async C[rows_w,:] = remotecall_fetch(floyd_worker!,w,Cw,rows_w)\n",
|
||||
" end\n",
|
||||
" C\n",
|
||||
"end"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "9fc3be11",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"The second function is the one that runs on the workers. Note that we use MPI for communication in this case."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "d5a8d3a8",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"@everywhere function floyd_worker!(Cw,rows_w)\n",
|
||||
" comm = MPI.Comm_dup(MPI.COMM_WORLD)\n",
|
||||
" rank = MPI.Comm_rank(comm)\n",
|
||||
" nranks = MPI.Comm_size(comm)\n",
|
||||
" m,n = size(Cw)\n",
|
||||
" C_k = similar(Cw,n)\n",
|
||||
" for k in 1:n\n",
|
||||
" if k in rows_w\n",
|
||||
" # Send row k to other workers if I have it\n",
|
||||
" myk = (k-first(rows_w))+1\n",
|
||||
" C_k .= view(Cw,myk,:)\n",
|
||||
" for proc in 0:(nranks-1)\n",
|
||||
" if rank == proc\n",
|
||||
" continue\n",
|
||||
" end\n",
|
||||
" MPI.Send(C_k,comm;dest=proc,tag=0)\n",
|
||||
" end\n",
|
||||
" else\n",
|
||||
" # Wait until row k is received\n",
|
||||
" MPI.Recv!(C_k,comm,source=MPI.ANY_SOURCE,tag=0)\n",
|
||||
" end\n",
|
||||
" for j in 1:n\n",
|
||||
" for i in 1:m\n",
|
||||
" @inbounds Cw[i,j] = min(Cw[i,j],Cw[i,k]+C_k[j])\n",
|
||||
" end\n",
|
||||
" end\n",
|
||||
" end\n",
|
||||
" Cw\n",
|
||||
"end"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "bc81a83d",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<div class=\"alert alert-block alert-success\">\n",
|
||||
"<b>Question:</b> Which of the following statements is true?\n",
|
||||
"</div>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "4ec6718c",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
" a) The processes are synchronized in each iteration due to the blocking send and receive of row k.\n",
|
||||
" b) Receiving processes may overwrite the data in row k, which can lead to incorrect behavior.\n",
|
||||
" c) The sending process can only continue the computation after the data are received in every other process.\n",
|
||||
" d) The receiving process does not know the source of the received data."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "4f4a57de",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"answer = \"x\" # replace x with a, b, c or d\n",
|
||||
"floyd_impl_check(answer)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "c624722a",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Testing the implementation"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "09937668",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"function rand_distance_table(n)\n",
|
||||
" threshold = 0.4\n",
|
||||
" mincost = 3\n",
|
||||
" maxcost = 10\n",
|
||||
" infinity = 10000*maxcost\n",
|
||||
" C = fill(infinity,n,n)\n",
|
||||
" for j in 1:n\n",
|
||||
" for i in 1:n\n",
|
||||
" if rand() > threshold\n",
|
||||
" C[i,j] = rand(mincost:maxcost)\n",
|
||||
" end\n",
|
||||
" end\n",
|
||||
" C[j,j] = 0\n",
|
||||
" end\n",
|
||||
" C\n",
|
||||
"end"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "dd77ee3d",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"using Test\n",
|
||||
"load = 10\n",
|
||||
"n = nworkers()*load\n",
|
||||
"C = rand_distance_table(n)\n",
|
||||
"C_seq = floyd!(copy(C))\n",
|
||||
"C_par = floyd_dist!(copy(C))\n",
|
||||
"@test C_seq == C_par"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "91a772df",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Is this implementation correct?\n",
|
||||
"\n",
|
||||
"Point-to-point messages are *non-overtaking* (i.e. FIFO order) between the specified sender and receiver according to section 3.5 of the MPI standard 4.0.\n",
|
||||
"Unfortunately this is not enough in this case. The messages can still arrive in the wrong order if messages from different processes overtake each other."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "1277772d",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"If we are lucky all messages will arrive in order and we will process all rows in the right order in all processors."
|
||||
]
|
||||
},
|
||||
{
|
||||
"attachments": {
|
||||
"g33659.png": {
|
||||
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAUYAAAFECAYAAABbH5f7AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAewgAAHsIBbtB1PgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAACAASURBVHic7d15mBxVvf/xd00mmUz2CdlIAiRhk0UjCZvoRWQJgsBl1x8octm9onABAVkERHABREFUEFEEIiooggthFRcWIayCbCYsySSThAwkITNZ6/fH91Sqpqa6urqnt5n+vJ6nnu6qrqo+PTP9mVOnTp2CuuDvBb7fi6ddqv0TrB5/bg38/IudflLtn171+OfVwM+/6Kmh2j8+EZFao2AUEYlprHYBqmAh8PFqFyKDJ4Fh1S5EjTke+Hu1C5HH2Vg5JTQL+HK1C5HHJKycQH0G41rwXq12IfLz11e7BDVofu3/7vz2apegBq3oBb+3LnM6lBYRiVEwiojEKBhFRGIUjCIiMQpGEZEYBaOISEw9dtcRSeEPADYDJmJ9ON4Eb251yyT5bfi9jQYGAauAV8FrK2ZvCsYu/DnAiIQX1gHvAM8DvwPuAG9Nwvb9gG2AHYHpbtoKq5mvA290WYpd9/xLgC/leHEZMBf4C3AjePMTtt8EOAQ4DPgo0C/2+tvAdcDV4K0uTZkF/M2xCxmSrAIWAU8BM8F7MMc+LgH2xr5rTQmvPw9cBdwCnt/99brWZRCJt1PWW5rxIvPZ7ssU3/6YlG3WFljm9si2GkTCpn1zrPOdjL+3FeAfnbD9vxLWXZmw7DHwh+cp7xUaRAJ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",
|
||||
"<img src=\"attachment:g33659.png\" align=\"left\" width=\"225\"/>\n",
|
||||
"</div>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "df60e4e7",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"However, FIFO ordering is not enough. In the next figure, communication between process 1 and process 3 is particularly slow. Note that process 3 receives messages from process 1 after it receives the messages from 2 even though FIFO ordering is satisfied between any two processors."
|
||||
]
|
||||
},
|
||||
{
|
||||
"attachments": {
|
||||
"g33721.png": {
|
||||
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAUYAAAFECAYAAABbH5f7AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAewgAAHsIBbtB1PgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAACAASURBVHic7Z13mBvV9YZfua+NyxpjjGnGYAi9mGp6semEFtKAJISW5AcJnRAILRDAEEpCEloCpoSEHiBgsGmh2KEabCAUF4K7YXHvnt8f3wyanR1JI2mk0UjnfZ55tCPNjM7dXX06c+93z4WGwNkXHCfF205J/waTw5lUA7//Urfbkv7tJYdzQQ38/kve2iX96zMMw6g1TBgNwzACdEg6gASYAeyZdBAReB3okXQQNcaPgZeTDqIA56I4jSwjgdOTDqIAA1CcQGMK4wrIfJR0EIVxViUdQQ0ytfb/dk5L0hHUIAtS8HdrtWe30oZhGAFMGA3DMAKYMBqGYQQwYTQMwwhgwmgYhhHAhNEwDCNAI9p1DCMPTidgfWAd5OGYAplJycZkFObrv9saQFdgKfARZGaWcjUTxlY4k4CeIS+sBL4A3gUeAR6EzPKQ8zsAmwKD3W17YBDKzFdApm9Fwm54nEuB03K8OA+YBLwA3A6ZqSHnrwscARwF7Aq0D7z+P+Bm4HrILIsnZgOcDdFEhjCWArOAN4D7IDM6xzUuBfZDn7fOIa+/C1wH3A0Zp+3rDU2rIhL/y3NcS8RJ5m+6H6bg+T/Ic06IkOaN2R+LFZHQtn+OY66J+HdbAM73Q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65f8",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<div>\n",
|
||||
"<img src=\"attachment:g33721.png\" align=\"left\" width=\"225\"/>\n",
|
||||
"</div>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "86534783",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Possible solutions\n",
|
||||
"\n",
|
||||
"1. **Synchronous sends**: Use synchronous send MPI_SSEND. This is less efficient because we spend time waiting until each message is received. Note that the blocking send MPI_SEND used above does not guarantee that the message was received. \n",
|
||||
"2. **MPI.Barrier**: Use a barrier at the end of each iteration over $k$. This is easy to implement, but we get a synchronization overhead.\n",
|
||||
"3. **Order incoming messages**: The receiver orders the incoming messages, e.g. according to MPI.Status or the sender rank. This requires buffering and extra user code.\n",
|
||||
"4. **MPI.Bcast!**: Communicate row k using `MPI.Bcast!`. One needs to know which are the rows owned by the other ranks."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "de96ad1b",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Exercise \n",
|
||||
"Rewrite the worker code of the parallel ASP algorithm so it runs correctly. Use the `MPI.Bcast!` to solve the problem of overtaking messages. Note: Only use `MPI.Bcast!`, do not use other MPI directives in addition. You can test your function with the following code cell. "
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "31194529",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"function floyd_par!(C,N)\n",
|
||||
" comm = MPI.Comm_dup(MPI.COMM_WORLD)\n",
|
||||
" nranks = MPI.Comm_size(comm)\n",
|
||||
" rank = MPI.Comm_rank(comm)\n",
|
||||
" T = eltype(C)\n",
|
||||
" if rank == 0\n",
|
||||
" buffer_root = Vector{T}(undef,N*N)\n",
|
||||
" buffer_root[:] = transpose(C)[:]\n",
|
||||
" else\n",
|
||||
" buffer_root = Vector{T}(undef,0)\n",
|
||||
" end \n",
|
||||
" Nw = div(N,nranks)\n",
|
||||
" buffer = Vector{T}(undef,Nw*N)\n",
|
||||
" MPI.Scatter!(buffer_root,buffer,comm;root=0)\n",
|
||||
" Cw = Matrix{T}(undef,Nw,N)\n",
|
||||
" transpose(Cw)[:] = buffer\n",
|
||||
" MPI.Barrier(comm)\n",
|
||||
" floyd_worker_bcast!(Cw,comm)\n",
|
||||
" buffer[:] = transpose(Cw)[:]\n",
|
||||
" MPI.Gather!(buffer,buffer_root,comm;root=0)\n",
|
||||
" if rank == 0\n",
|
||||
" transpose(C)[:] = buffer_root[:]\n",
|
||||
" end\n",
|
||||
" C\n",
|
||||
"end\n",
|
||||
"\n",
|
||||
"@everywhere function floyd_worker_bcast!(Cw,comm)\n",
|
||||
" # Your implementation here\n",
|
||||
"end\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "1b7eb4c2",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"load = 10\n",
|
||||
"n = nworkers()*load\n",
|
||||
"C = rand_distance_table(n)\n",
|
||||
"C_seq = floyd!(copy(C))\n",
|
||||
"C_par = floyd_par!(copy(C),n)\n",
|
||||
"@test C_seq == C_par"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "c789dc7a",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# License\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"This notebook is part of the course [Programming Large Scale Parallel Systems](https://www.francescverdugo.com/XM_40017) at Vrije Universiteit Amsterdam and may be used under a [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) license."
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Julia 1.9.1",
|
||||
"language": "julia",
|
||||
"name": "julia-1.9"
|
||||
},
|
||||
"language_info": {
|
||||
"file_extension": ".jl",
|
||||
"mimetype": "application/julia",
|
||||
"name": "julia",
|
||||
"version": "1.9.1"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 5
|
||||
}
|
||||
|
After Width: | Height: | Size: 6.5 MiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 391 KiB |
|
After Width: | Height: | Size: 92 KiB |
|
After Width: | Height: | Size: 96 KiB |
@@ -0,0 +1,510 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="204.66751mm"
|
||||
height="113.93094mm"
|
||||
viewBox="0 0 204.66752 113.93094"
|
||||
version="1.1"
|
||||
id="svg8"
|
||||
inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)"
|
||||
sodipodi:docname="fig_matmul_1.svg"
|
||||
inkscape:export-filename="/home/francesc/repos/XM_40017/notebooks/figures/fig_matmul_1.png"
|
||||
inkscape:export-xdpi="200"
|
||||
inkscape:export-ydpi="200">
|
||||
<defs
|
||||
id="defs2">
|
||||
<rect
|
||||
x="-43.32487"
|
||||
y="75.601889"
|
||||
width="55.095874"
|
||||
height="26.65206"
|
||||
id="rect937" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1130" />
|
||||
<rect
|
||||
x="18.228422"
|
||||
y="221.26402"
|
||||
width="178.94536"
|
||||
height="38.954247"
|
||||
id="rect1059" />
|
||||
<rect
|
||||
x="81.231514"
|
||||
y="-71.233147"
|
||||
width="71.468948"
|
||||
height="19.676786"
|
||||
id="rect1433-5" />
|
||||
<rect
|
||||
x="81.231514"
|
||||
y="-71.233147"
|
||||
width="71.468948"
|
||||
height="19.676786"
|
||||
id="rect1007" />
|
||||
<rect
|
||||
x="81.231514"
|
||||
y="-71.233147"
|
||||
width="71.468948"
|
||||
height="19.676786"
|
||||
id="rect1668" />
|
||||
<rect
|
||||
x="81.231514"
|
||||
y="-71.233147"
|
||||
width="71.468948"
|
||||
height="19.676786"
|
||||
id="rect1010" />
|
||||
<rect
|
||||
x="81.231514"
|
||||
y="-71.233147"
|
||||
width="71.468948"
|
||||
height="19.676786"
|
||||
id="rect1676" />
|
||||
<rect
|
||||
x="81.231514"
|
||||
y="-71.233147"
|
||||
width="71.468948"
|
||||
height="19.676786"
|
||||
id="rect1013" />
|
||||
<rect
|
||||
x="18.228422"
|
||||
y="221.26402"
|
||||
width="178.94536"
|
||||
height="38.954247"
|
||||
id="rect1059-9" />
|
||||
<rect
|
||||
x="18.228422"
|
||||
y="221.26402"
|
||||
width="178.94536"
|
||||
height="38.954247"
|
||||
id="rect1076" />
|
||||
<rect
|
||||
x="18.228422"
|
||||
y="221.26402"
|
||||
width="178.94536"
|
||||
height="38.954247"
|
||||
id="rect1116" />
|
||||
<rect
|
||||
x="18.228422"
|
||||
y="221.26402"
|
||||
width="178.94536"
|
||||
height="38.954247"
|
||||
id="rect1126" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1130-2" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1143" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1176" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1184" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1190" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1190-0" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1201" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1190-3" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect946" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect980" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect988" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect980-7" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect999" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1033" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1190-36" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect952" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1015" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1025" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1015-5" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1036" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1190-36-6" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1078" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1122" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1124" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1124-1" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1167" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1203" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="0.49497475"
|
||||
inkscape:cx="728.49816"
|
||||
inkscape:cy="266.45551"
|
||||
inkscape:document-units="mm"
|
||||
inkscape:current-layer="layer1"
|
||||
inkscape:document-rotation="0"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1543"
|
||||
inkscape:window-height="870"
|
||||
inkscape:window-x="2658"
|
||||
inkscape:window-y="162"
|
||||
inkscape:window-maximized="0"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0"
|
||||
showguides="false"
|
||||
inkscape:snap-global="false" />
|
||||
<metadata
|
||||
id="metadata5">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(-8.4171906,-107.52556)">
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.529167;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 128.5853,166.79665 36.70974,0"
|
||||
id="path1168"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.529167;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 57.87148,195.69174 48.77915,-29.89763"
|
||||
id="path1168-3"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<g
|
||||
id="g1148"
|
||||
transform="translate(-30.394694,270.52777)">
|
||||
<path
|
||||
style="fill:#e6e6e6;stroke:#000000;stroke-width:0.79375;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 129.89807,-136.23112 12.99038,7.5 17.32051,-10 -12.99038,-7.5 z"
|
||||
id="path1063" />
|
||||
<path
|
||||
style="fill:#e6e6e6;stroke:#000000;stroke-width:0.79375;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 142.88845,-128.73112 v 39.999996 l 17.32051,-10 v -39.999996"
|
||||
id="path1065"
|
||||
sodipodi:nodetypes="cccc" />
|
||||
<path
|
||||
style="fill:#e6e6e6;stroke:#000000;stroke-width:0.79375;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 129.89807,-136.23112 v 39.999996 l 12.99038,7.5"
|
||||
id="path1067"
|
||||
sodipodi:nodetypes="ccc" />
|
||||
<path
|
||||
style="fill:#e6e6e6;stroke:#000000;stroke-width:0.529167;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 147.21857,-126.23112 v 15 l 4.33013,-2.5 v -15 l -4.33013,2.5"
|
||||
id="path1069" />
|
||||
<path
|
||||
style="fill:#e6e6e6;stroke:#000000;stroke-width:0.529167;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 145.48652,-96.231123 v 1.999999 l 12.99038,-7.499996 v -2 z"
|
||||
id="path1071" />
|
||||
<path
|
||||
style="fill:#e6e6e6;stroke:#000000;stroke-width:0.529167;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 145.48652,-100.23111 v 2.000003 l 12.99038,-7.500013 v -2 z"
|
||||
id="path1073" />
|
||||
<path
|
||||
style="fill:#e6e6e6;stroke:#000000;stroke-width:0.529167;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 145.48652,-104.23111 v 2 l 12.99038,-7.50001 v -2 z"
|
||||
id="path1075" />
|
||||
</g>
|
||||
<g
|
||||
id="g1157"
|
||||
transform="translate(-9.7126443,270.52775)">
|
||||
<path
|
||||
style="fill:#e6e6e6;stroke:#000000;stroke-width:0.79375;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 169.05642,-136.23112 12.99038,7.5 17.32051,-10 -12.99038,-7.5 z"
|
||||
id="path1086" />
|
||||
<path
|
||||
style="fill:#e6e6e6;stroke:#000000;stroke-width:0.79375;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 182.0468,-128.73112 v 39.999996 l 17.32051,-10 v -39.999996"
|
||||
id="path1088"
|
||||
sodipodi:nodetypes="cccc" />
|
||||
<path
|
||||
style="fill:#e6e6e6;stroke:#000000;stroke-width:0.79375;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 169.05642,-136.23112 v 39.999996 l 12.99038,7.5"
|
||||
id="path1090"
|
||||
sodipodi:nodetypes="ccc" />
|
||||
<path
|
||||
style="fill:#e6e6e6;stroke:#000000;stroke-width:0.529167;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 186.37692,-126.23112 v 15 l 4.33013,-2.5 v -15 l -4.33013,2.5"
|
||||
id="path1092" />
|
||||
<path
|
||||
style="fill:#e6e6e6;stroke:#000000;stroke-width:0.529167;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 184.64487,-96.231123 v 1.999999 l 12.99038,-7.499996 v -2 z"
|
||||
id="path1094" />
|
||||
<path
|
||||
style="fill:#e6e6e6;stroke:#000000;stroke-width:0.529167;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 184.64487,-100.23111 v 2.000003 l 12.99038,-7.500013 v -2 z"
|
||||
id="path1096" />
|
||||
<path
|
||||
style="fill:#e6e6e6;stroke:#000000;stroke-width:0.529167;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 184.64487,-104.23111 v 2 l 12.99038,-7.50001 v -2 z"
|
||||
id="path1098" />
|
||||
</g>
|
||||
<g
|
||||
id="g1148-3"
|
||||
transform="translate(-100.60542,297.42286)">
|
||||
<path
|
||||
style="fill:#e6e6e6;stroke:#000000;stroke-width:0.79375;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 129.89807,-136.23112 12.99038,7.5 17.32051,-10 -12.99038,-7.5 z"
|
||||
id="path1063-6" />
|
||||
<path
|
||||
style="fill:#e6e6e6;stroke:#000000;stroke-width:0.79375;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 142.88845,-128.73112 v 39.999996 l 17.32051,-10 v -39.999996"
|
||||
id="path1065-7"
|
||||
sodipodi:nodetypes="cccc" />
|
||||
<path
|
||||
style="fill:#e6e6e6;stroke:#000000;stroke-width:0.79375;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 129.89807,-136.23112 v 39.999996 l 12.99038,7.5"
|
||||
id="path1067-5"
|
||||
sodipodi:nodetypes="ccc" />
|
||||
<path
|
||||
style="fill:#e6e6e6;stroke:#000000;stroke-width:0.529167;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 147.21857,-126.23112 v 15 l 4.33013,-2.5 v -15 l -4.33013,2.5"
|
||||
id="path1069-3" />
|
||||
<path
|
||||
style="fill:#e6e6e6;stroke:#000000;stroke-width:0.529167;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 145.48652,-96.231123 v 1.999999 l 12.99038,-7.499996 v -2 z"
|
||||
id="path1071-5" />
|
||||
<path
|
||||
style="fill:#e6e6e6;stroke:#000000;stroke-width:0.529167;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 145.48652,-100.23111 v 2.000003 l 12.99038,-7.500013 v -2 z"
|
||||
id="path1073-6" />
|
||||
<path
|
||||
style="fill:#e6e6e6;stroke:#000000;stroke-width:0.529167;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 145.48652,-104.23111 v 2 l 12.99038,-7.50001 v -2 z"
|
||||
id="path1075-2" />
|
||||
</g>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
id="text1128"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.175px;line-height:1.25;font-family:Hack;-inkscape-font-specification:Hack;letter-spacing:0px;word-spacing:0px;white-space:pre;shape-inside:url(#rect1130);"
|
||||
transform="matrix(1.870078,0,0,1.870078,-12.48415,127.92857)"><tspan
|
||||
x="24.056641"
|
||||
y="46.895068"
|
||||
id="tspan73"><tspan
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Hack;-inkscape-font-specification:Hack"
|
||||
id="tspan71">proc 1</tspan></tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
id="text1128-7"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.175px;line-height:1.25;font-family:Hack;-inkscape-font-specification:Hack;letter-spacing:0px;word-spacing:0px;white-space:pre;shape-inside:url(#rect1130-2);"
|
||||
transform="matrix(1.870078,0,0,1.870078,58.900914,33.172896)"><tspan
|
||||
x="24.056641"
|
||||
y="46.895068"
|
||||
id="tspan78"><tspan
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Hack;-inkscape-font-specification:Hack"
|
||||
id="tspan76">proc 2</tspan></tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
id="text1182"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.175px;line-height:1.25;font-family:Hack;-inkscape-font-specification:Hack;letter-spacing:0px;word-spacing:0px;white-space:pre;shape-inside:url(#rect1184);"
|
||||
transform="matrix(1.870078,0,0,1.870078,120.13204,33.172896)"><tspan
|
||||
x="24.056641"
|
||||
y="46.895068"
|
||||
id="tspan83"><tspan
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Hack;-inkscape-font-specification:Hack"
|
||||
id="tspan81">proc 3</tspan></tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
id="text935"
|
||||
style="font-family:Hack;font-size:3.175px;line-height:1.25;letter-spacing:0px;word-spacing:0px;-inkscape-font-specification:'Hack Italic';font-style:italic;white-space:pre;shape-inside:url(#rect937);" />
|
||||
<rect
|
||||
style="fill:#ff0000;fill-opacity:0.21383099;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"
|
||||
id="rect941"
|
||||
width="24.735849"
|
||||
height="19.344206"
|
||||
x="14.552141"
|
||||
y="118.7655" />
|
||||
<text
|
||||
y="28.370567"
|
||||
x="-19.855066"
|
||||
xml:space="preserve"
|
||||
id="text1188-7-3"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:5.93749762px;line-height:1.25;font-family:Hack;-inkscape-font-specification:'Hack Bold';letter-spacing:0px;word-spacing:0px;white-space:pre;shape-inside:url(#rect1190-36);stroke-width:1.87007797"><tspan
|
||||
style="stroke-width:1.87007797"
|
||||
x="25.13273"
|
||||
y="116.068"
|
||||
id="tspan91-6"><tspan
|
||||
style="stroke-width:1.87007797"
|
||||
id="tspan89-7">A</tspan></tspan></text>
|
||||
<rect
|
||||
style="fill:#0000ff;fill-opacity:0.21383099;stroke:#0000ff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"
|
||||
id="rect991"
|
||||
width="24.464821"
|
||||
height="12.890343"
|
||||
x="-143.27554"
|
||||
y="43.231026"
|
||||
transform="rotate(-90)" />
|
||||
<text
|
||||
y="28.370567"
|
||||
x="1.784595"
|
||||
xml:space="preserve"
|
||||
id="text1013-5"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:5.93749762px;line-height:1.25;font-family:Hack;-inkscape-font-specification:'Hack Bold';letter-spacing:0px;word-spacing:0px;white-space:pre;shape-inside:url(#rect1015);stroke-width:1.87007797"><tspan
|
||||
style="stroke-width:1.87007797"
|
||||
x="46.772388"
|
||||
y="116.068"
|
||||
id="tspan97-3"><tspan
|
||||
style="stroke-width:1.87007797"
|
||||
id="tspan95-5">B</tspan></tspan></text>
|
||||
<rect
|
||||
style="fill:#008000;fill-opacity:0.21383099;stroke:#008000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"
|
||||
id="rect1017"
|
||||
width="12.825157"
|
||||
height="19.552177"
|
||||
x="60.516609"
|
||||
y="118.8185" />
|
||||
<text
|
||||
y="28.370567"
|
||||
x="20.839518"
|
||||
xml:space="preserve"
|
||||
id="text1023-6"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:5.93749762px;line-height:1.25;font-family:Hack;-inkscape-font-specification:'Hack Bold';letter-spacing:0px;word-spacing:0px;white-space:pre;shape-inside:url(#rect1025);stroke-width:1.87007797"><tspan
|
||||
style="stroke-width:1.87007797"
|
||||
x="65.827309"
|
||||
y="116.068"
|
||||
id="tspan103-2"><tspan
|
||||
style="stroke-width:1.87007797"
|
||||
id="tspan101-9">C</tspan></tspan></text>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 128 KiB |
@@ -0,0 +1,611 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="204.66751mm"
|
||||
height="113.93094mm"
|
||||
viewBox="0 0 204.66752 113.93094"
|
||||
version="1.1"
|
||||
id="svg8"
|
||||
inkscape:version="1.0.2 (1.0.2+r75+1)"
|
||||
sodipodi:docname="fig_matmul_dist.svg"
|
||||
inkscape:export-filename="/home/fverdugo/Code/jl/PLSPS/lectures/fig_matmul_2.png"
|
||||
inkscape:export-xdpi="200"
|
||||
inkscape:export-ydpi="200">
|
||||
<defs
|
||||
id="defs2">
|
||||
<rect
|
||||
x="-43.32487"
|
||||
y="75.601889"
|
||||
width="55.095874"
|
||||
height="26.65206"
|
||||
id="rect937" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1130" />
|
||||
<rect
|
||||
x="18.228422"
|
||||
y="221.26402"
|
||||
width="178.94536"
|
||||
height="38.954247"
|
||||
id="rect1059" />
|
||||
<rect
|
||||
x="81.231514"
|
||||
y="-71.233147"
|
||||
width="71.468948"
|
||||
height="19.676786"
|
||||
id="rect1433-5" />
|
||||
<rect
|
||||
x="81.231514"
|
||||
y="-71.233147"
|
||||
width="71.468948"
|
||||
height="19.676786"
|
||||
id="rect1007" />
|
||||
<rect
|
||||
x="81.231514"
|
||||
y="-71.233147"
|
||||
width="71.468948"
|
||||
height="19.676786"
|
||||
id="rect1668" />
|
||||
<rect
|
||||
x="81.231514"
|
||||
y="-71.233147"
|
||||
width="71.468948"
|
||||
height="19.676786"
|
||||
id="rect1010" />
|
||||
<rect
|
||||
x="81.231514"
|
||||
y="-71.233147"
|
||||
width="71.468948"
|
||||
height="19.676786"
|
||||
id="rect1676" />
|
||||
<rect
|
||||
x="81.231514"
|
||||
y="-71.233147"
|
||||
width="71.468948"
|
||||
height="19.676786"
|
||||
id="rect1013" />
|
||||
<rect
|
||||
x="18.228422"
|
||||
y="221.26402"
|
||||
width="178.94536"
|
||||
height="38.954247"
|
||||
id="rect1059-9" />
|
||||
<rect
|
||||
x="18.228422"
|
||||
y="221.26402"
|
||||
width="178.94536"
|
||||
height="38.954247"
|
||||
id="rect1076" />
|
||||
<rect
|
||||
x="18.228422"
|
||||
y="221.26402"
|
||||
width="178.94536"
|
||||
height="38.954247"
|
||||
id="rect1116" />
|
||||
<rect
|
||||
x="18.228422"
|
||||
y="221.26402"
|
||||
width="178.94536"
|
||||
height="38.954247"
|
||||
id="rect1126" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1130-2" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1143" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1176" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1184" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1190" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1190-0" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1201" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1190-3" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect946" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect980" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect988" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect980-7" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect999" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1033" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1190-36" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect952" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1015" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1025" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1015-5" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1036" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1190-36-6" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1078" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1122" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1124" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1124-1" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1167" />
|
||||
<rect
|
||||
x="24.057535"
|
||||
y="44.08559"
|
||||
width="96.728912"
|
||||
height="20.299622"
|
||||
id="rect1203" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="0.7"
|
||||
inkscape:cx="116.13187"
|
||||
inkscape:cy="283.51733"
|
||||
inkscape:document-units="mm"
|
||||
inkscape:current-layer="layer1"
|
||||
inkscape:document-rotation="0"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1025"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="27"
|
||||
inkscape:window-maximized="1"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0"
|
||||
showguides="false"
|
||||
inkscape:snap-global="false" />
|
||||
<metadata
|
||||
id="metadata5">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(-8.4171906,-107.52556)">
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.529167;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 128.5853,166.79665 36.70974,0"
|
||||
id="path1168"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.529167;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 57.87148,195.69174 48.77915,-29.89763"
|
||||
id="path1168-3"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<g
|
||||
id="g1148"
|
||||
transform="translate(-30.394694,270.52777)">
|
||||
<path
|
||||
style="fill:#e6e6e6;stroke:#000000;stroke-width:0.79375;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 129.89807,-136.23112 12.99038,7.5 17.32051,-10 -12.99038,-7.5 z"
|
||||
id="path1063" />
|
||||
<path
|
||||
style="fill:#e6e6e6;stroke:#000000;stroke-width:0.79375;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 142.88845,-128.73112 v 39.999996 l 17.32051,-10 v -39.999996"
|
||||
id="path1065"
|
||||
sodipodi:nodetypes="cccc" />
|
||||
<path
|
||||
style="fill:#e6e6e6;stroke:#000000;stroke-width:0.79375;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 129.89807,-136.23112 v 39.999996 l 12.99038,7.5"
|
||||
id="path1067"
|
||||
sodipodi:nodetypes="ccc" />
|
||||
<path
|
||||
style="fill:#e6e6e6;stroke:#000000;stroke-width:0.529167;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 147.21857,-126.23112 v 15 l 4.33013,-2.5 v -15 l -4.33013,2.5"
|
||||
id="path1069" />
|
||||
<path
|
||||
style="fill:#e6e6e6;stroke:#000000;stroke-width:0.529167;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 145.48652,-96.231123 v 1.999999 l 12.99038,-7.499996 v -2 z"
|
||||
id="path1071" />
|
||||
<path
|
||||
style="fill:#e6e6e6;stroke:#000000;stroke-width:0.529167;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 145.48652,-100.23111 v 2.000003 l 12.99038,-7.500013 v -2 z"
|
||||
id="path1073" />
|
||||
<path
|
||||
style="fill:#e6e6e6;stroke:#000000;stroke-width:0.529167;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 145.48652,-104.23111 v 2 l 12.99038,-7.50001 v -2 z"
|
||||
id="path1075" />
|
||||
</g>
|
||||
<g
|
||||
id="g1157"
|
||||
transform="translate(-9.7126443,270.52775)">
|
||||
<path
|
||||
style="fill:#e6e6e6;stroke:#000000;stroke-width:0.79375;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 169.05642,-136.23112 12.99038,7.5 17.32051,-10 -12.99038,-7.5 z"
|
||||
id="path1086" />
|
||||
<path
|
||||
style="fill:#e6e6e6;stroke:#000000;stroke-width:0.79375;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 182.0468,-128.73112 v 39.999996 l 17.32051,-10 v -39.999996"
|
||||
id="path1088"
|
||||
sodipodi:nodetypes="cccc" />
|
||||
<path
|
||||
style="fill:#e6e6e6;stroke:#000000;stroke-width:0.79375;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 169.05642,-136.23112 v 39.999996 l 12.99038,7.5"
|
||||
id="path1090"
|
||||
sodipodi:nodetypes="ccc" />
|
||||
<path
|
||||
style="fill:#e6e6e6;stroke:#000000;stroke-width:0.529167;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 186.37692,-126.23112 v 15 l 4.33013,-2.5 v -15 l -4.33013,2.5"
|
||||
id="path1092" />
|
||||
<path
|
||||
style="fill:#e6e6e6;stroke:#000000;stroke-width:0.529167;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 184.64487,-96.231123 v 1.999999 l 12.99038,-7.499996 v -2 z"
|
||||
id="path1094" />
|
||||
<path
|
||||
style="fill:#e6e6e6;stroke:#000000;stroke-width:0.529167;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 184.64487,-100.23111 v 2.000003 l 12.99038,-7.500013 v -2 z"
|
||||
id="path1096" />
|
||||
<path
|
||||
style="fill:#e6e6e6;stroke:#000000;stroke-width:0.529167;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 184.64487,-104.23111 v 2 l 12.99038,-7.50001 v -2 z"
|
||||
id="path1098" />
|
||||
</g>
|
||||
<g
|
||||
id="g1148-3"
|
||||
transform="translate(-100.60542,297.42286)">
|
||||
<path
|
||||
style="fill:#e6e6e6;stroke:#000000;stroke-width:0.79375;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 129.89807,-136.23112 12.99038,7.5 17.32051,-10 -12.99038,-7.5 z"
|
||||
id="path1063-6" />
|
||||
<path
|
||||
style="fill:#e6e6e6;stroke:#000000;stroke-width:0.79375;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 142.88845,-128.73112 v 39.999996 l 17.32051,-10 v -39.999996"
|
||||
id="path1065-7"
|
||||
sodipodi:nodetypes="cccc" />
|
||||
<path
|
||||
style="fill:#e6e6e6;stroke:#000000;stroke-width:0.79375;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 129.89807,-136.23112 v 39.999996 l 12.99038,7.5"
|
||||
id="path1067-5"
|
||||
sodipodi:nodetypes="ccc" />
|
||||
<path
|
||||
style="fill:#e6e6e6;stroke:#000000;stroke-width:0.529167;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 147.21857,-126.23112 v 15 l 4.33013,-2.5 v -15 l -4.33013,2.5"
|
||||
id="path1069-3" />
|
||||
<path
|
||||
style="fill:#e6e6e6;stroke:#000000;stroke-width:0.529167;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 145.48652,-96.231123 v 1.999999 l 12.99038,-7.499996 v -2 z"
|
||||
id="path1071-5" />
|
||||
<path
|
||||
style="fill:#e6e6e6;stroke:#000000;stroke-width:0.529167;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 145.48652,-100.23111 v 2.000003 l 12.99038,-7.500013 v -2 z"
|
||||
id="path1073-6" />
|
||||
<path
|
||||
style="fill:#e6e6e6;stroke:#000000;stroke-width:0.529167;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 145.48652,-104.23111 v 2 l 12.99038,-7.50001 v -2 z"
|
||||
id="path1075-2" />
|
||||
</g>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
id="text1128"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.175px;line-height:1.25;font-family:Hack;-inkscape-font-specification:Hack;letter-spacing:0px;word-spacing:0px;white-space:pre;shape-inside:url(#rect1130);"
|
||||
transform="matrix(1.870078,0,0,1.870078,-12.48415,127.92857)"><tspan
|
||||
x="24.056641"
|
||||
y="46.895068"><tspan
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Hack;-inkscape-font-specification:Hack">proc 1</tspan></tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
id="text1128-7"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.175px;line-height:1.25;font-family:Hack;-inkscape-font-specification:Hack;letter-spacing:0px;word-spacing:0px;white-space:pre;shape-inside:url(#rect1130-2);"
|
||||
transform="matrix(1.870078,0,0,1.870078,58.900914,33.172896)"><tspan
|
||||
x="24.056641"
|
||||
y="46.895068"><tspan
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Hack;-inkscape-font-specification:Hack">proc 2</tspan></tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
id="text1182"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.175px;line-height:1.25;font-family:Hack;-inkscape-font-specification:Hack;letter-spacing:0px;word-spacing:0px;white-space:pre;shape-inside:url(#rect1184);"
|
||||
transform="matrix(1.870078,0,0,1.870078,120.13204,33.172896)"><tspan
|
||||
x="24.056641"
|
||||
y="46.895068"><tspan
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Hack;-inkscape-font-specification:Hack">proc 3</tspan></tspan></text>
|
||||
<rect
|
||||
style="fill:none;stroke:#cccccc;stroke-width:1.465;stroke-linecap:round;stroke-linejoin:round"
|
||||
id="rect1266"
|
||||
width="203.20251"
|
||||
height="112.46594"
|
||||
x="9.1496906"
|
||||
y="108.25806" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
id="text935"
|
||||
style="font-family:Hack;font-size:3.175px;line-height:1.25;letter-spacing:0px;word-spacing:0px;-inkscape-font-specification:'Hack Italic';font-style:italic;white-space:pre;shape-inside:url(#rect937);" />
|
||||
<rect
|
||||
style="fill:#ff0000;fill-opacity:0.213831;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"
|
||||
id="rect941"
|
||||
width="24.735849"
|
||||
height="19.344206"
|
||||
x="16.550077"
|
||||
y="119.69792" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
id="text1188-7"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.175px;line-height:1.25;font-family:Hack;-inkscape-font-specification:'Hack Bold';letter-spacing:0px;word-spacing:0px;white-space:pre;shape-inside:url(#rect1190-36);"
|
||||
transform="matrix(1.870078,0,0,1.870078,-17.85713,29.302991)"><tspan
|
||||
x="24.056641"
|
||||
y="46.895068"><tspan>A</tspan></tspan></text>
|
||||
<rect
|
||||
style="fill:#0000ff;fill-opacity:0.213831;stroke:#0000ff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"
|
||||
id="rect991"
|
||||
width="24.464819"
|
||||
height="12.890343"
|
||||
x="-144.20796"
|
||||
y="45.228962"
|
||||
transform="rotate(-90)" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
id="text1013"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.175px;line-height:1.25;font-family:Hack;-inkscape-font-specification:'Hack Bold';letter-spacing:0px;word-spacing:0px;white-space:pre;shape-inside:url(#rect1015);"
|
||||
transform="matrix(1.870078,0,0,1.870078,3.7825311,29.302991)"><tspan
|
||||
x="24.056641"
|
||||
y="46.895068"><tspan>B</tspan></tspan></text>
|
||||
<rect
|
||||
style="fill:#008000;fill-opacity:0.213831;stroke:#008000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"
|
||||
id="rect1017"
|
||||
width="12.825157"
|
||||
height="19.552177"
|
||||
x="62.514542"
|
||||
y="119.75092" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
id="text1023"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.175px;line-height:1.25;font-family:Hack;-inkscape-font-specification:'Hack Bold';letter-spacing:0px;word-spacing:0px;white-space:pre;shape-inside:url(#rect1025);"
|
||||
transform="matrix(1.870078,0,0,1.870078,22.837454,29.302991)"><tspan
|
||||
x="24.056641"
|
||||
y="46.895068"><tspan>C</tspan></tspan></text>
|
||||
<rect
|
||||
style="fill:#0000ff;fill-opacity:0.213831;stroke:#0000ff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"
|
||||
id="rect991-3"
|
||||
width="24.464819"
|
||||
height="12.890343"
|
||||
x="-85.056168"
|
||||
y="191.22739"
|
||||
transform="rotate(-90)" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
id="text1013-5"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.175px;line-height:1.25;font-family:Hack;-inkscape-font-specification:'Hack Bold';letter-spacing:0px;word-spacing:0px;white-space:pre;shape-inside:url(#rect1015-5);"
|
||||
transform="matrix(1.870078,0,0,1.870078,152.52129,-29.84879)"><tspan
|
||||
x="24.056641"
|
||||
y="46.895068"><tspan>B</tspan></tspan></text>
|
||||
<rect
|
||||
style="fill:#ff0000;fill-opacity:0.213831;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"
|
||||
id="rect1067"
|
||||
width="24.735849"
|
||||
height="9.3721132"
|
||||
x="162.76842"
|
||||
y="60.860783" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
id="text1188-7-2"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.175px;line-height:1.25;font-family:Hack;-inkscape-font-specification:'Hack Bold';letter-spacing:0px;word-spacing:0px;white-space:pre;shape-inside:url(#rect1190-36-6);"
|
||||
transform="matrix(1.870078,0,0,1.870078,120.75285,-28.827227)"><tspan
|
||||
x="24.056641"
|
||||
y="46.895068"><tspan>Aw</tspan></tspan></text>
|
||||
<rect
|
||||
style="fill:#0000ff;fill-opacity:0.213831;stroke:#0000ff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"
|
||||
id="rect1106"
|
||||
width="24.464819"
|
||||
height="12.890343"
|
||||
x="-85.056168"
|
||||
y="253.19373"
|
||||
transform="rotate(-90)" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
id="text1112"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.175px;line-height:1.25;font-family:Hack;-inkscape-font-specification:'Hack Bold';letter-spacing:0px;word-spacing:0px;white-space:pre;shape-inside:url(#rect1122);"
|
||||
transform="matrix(1.870078,0,0,1.870078,213.4482,-29.84879)"><tspan
|
||||
x="24.056641"
|
||||
y="46.895068"><tspan>B</tspan></tspan></text>
|
||||
<rect
|
||||
style="fill:#ff0000;fill-opacity:0.213831;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"
|
||||
id="rect1114"
|
||||
width="24.735849"
|
||||
height="9.3721132"
|
||||
x="224.73477"
|
||||
y="75.112381" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
id="text1120"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.175px;line-height:1.25;font-family:Hack;-inkscape-font-specification:'Hack Bold';letter-spacing:0px;word-spacing:0px;white-space:pre;shape-inside:url(#rect1124);"
|
||||
transform="matrix(1.870078,0,0,1.870078,182.7192,-14.575627)"><tspan
|
||||
x="24.056641"
|
||||
y="46.895068"><tspan>Aw</tspan></tspan></text>
|
||||
<path
|
||||
style="fill:#ff0000;stroke:#ff0000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 19.799029,88.923994 H 44.014785"
|
||||
id="path1130" />
|
||||
<g
|
||||
id="g1388"
|
||||
transform="translate(-169.22149,-62.931698)">
|
||||
<rect
|
||||
style="fill:#008000;fill-opacity:0.213831;stroke:#008000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="rect1156"
|
||||
width="12.989205"
|
||||
height="9.5581169"
|
||||
x="276.90524"
|
||||
y="259.22504" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
id="text1120-2"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.175px;line-height:1.25;font-family:Hack;-inkscape-font-specification:'Hack Bold';letter-spacing:0px;word-spacing:0px;white-space:pre;shape-inside:url(#rect1124-1);"
|
||||
transform="matrix(1.870078,0,0,1.870078,234.00099,168.68114)"><tspan
|
||||
x="24.056641"
|
||||
y="46.895068"><tspan>Cw</tspan></tspan></text>
|
||||
<rect
|
||||
style="fill:#008000;fill-opacity:0.213831;stroke:#008000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="rect1195"
|
||||
width="12.989205"
|
||||
height="9.5581169"
|
||||
x="341.09048"
|
||||
y="259.22714" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
id="text1201"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.175px;line-height:1.25;font-family:Hack;-inkscape-font-specification:'Hack Bold';letter-spacing:0px;word-spacing:0px;white-space:pre;shape-inside:url(#rect1203);"
|
||||
transform="matrix(1.870078,0,0,1.870078,298.18621,168.68323)"><tspan
|
||||
x="24.056641"
|
||||
y="46.895068"><tspan>Cw</tspan></tspan></text>
|
||||
<path
|
||||
style="fill:none;stroke:#008000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 231.91804,192.10089 h 12.32514"
|
||||
id="path1205" />
|
||||
<g
|
||||
id="g1230"
|
||||
transform="translate(169.31458,62.926738)">
|
||||
<path
|
||||
style="fill:none;stroke:#999999;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="M 178.3128,201.16751 68.641596,134.34821 m 0.07376,-10.33845 45.578434,77.50543"
|
||||
id="path1132"
|
||||
sodipodi:nodetypes="cccc" />
|
||||
<path
|
||||
style="fill:none;stroke:#999999;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 69.508478,137.0957 -1.464614,-3.49633 3.390536,0.8633"
|
||||
id="path1134" />
|
||||
<path
|
||||
style="fill:none;stroke:#999999;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 68.562733,127.19194 -0.369006,-3.7727 2.985461,1.82431"
|
||||
id="path1134-9" />
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 44 KiB |
|
After Width: | Height: | Size: 52 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 37 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 139 KiB |
|
After Width: | Height: | Size: 248 KiB |
|
After Width: | Height: | Size: 117 KiB |