diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 9fec0684..04885c33 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-10-07T15:20:15","documenter_version":"1.7.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-10-07T15:43:11","documenter_version":"1.7.0"}} \ No newline at end of file diff --git a/dev/examples/index.html b/dev/examples/index.html index 43499fb5..7b44a2b6 100644 --- a/dev/examples/index.html +++ b/dev/examples/index.html @@ -20,19 +20,19 @@ [ Int[] ] end end
4-element Vector{Vector{Vector{Int64}}}:
- [[26, 2, 13], [26, 23, 10], [20, 7, 17], [4, 27, 20]]
+ [[27, 29, 20], [14, 21, 24], [13, 25, 13], [7, 17, 5]]
[[]]
[[]]
[[]]
Note that only the first entry contains meaningful data in previous output.
a_rcv = scatter(a_snd,source=1)
4-element Vector{Vector{Int64}}:
- [26, 2, 13]
- [26, 23, 10]
- [20, 7, 17]
- [4, 27, 20]
After the scatter, all the parts have received their chunk. Now, we can count in parallel.
b_snd = map(ai->count(isodd,ai),a_rcv)
4-element Vector{Int64}:
- 1
- 1
+ [27, 29, 20]
+ [14, 21, 24]
+ [13, 25, 13]
+ [7, 17, 5]
After the scatter, all the parts have received their chunk. Now, we can count in parallel.
b_snd = map(ai->count(isodd,ai),a_rcv)
4-element Vector{Int64}:
2
- 1
Finally we reduce the partial sums.
b_rcv = reduction(+,b_snd,init=0,destination=1)
4-element Vector{Int64}:
- 5
+ 1
+ 3
+ 3
Finally we reduce the partial sums.
b_rcv = reduction(+,b_snd,init=0,destination=1)
4-element Vector{Int64}:
+ 9
0
0
0
Only the destination rank will receive the correct result.
Each rank generates some message (in this case an integer 10 times the current rank id). Each rank sends this data to the next rank. The last one sends it to the first, closing the circle. After repeating this exchange a number of times equal to the number of ranks, we check that we ended up with the original message.
First, each rank generates the ids of the neighbor to send data to.
using PartitionedArrays
@@ -167,4 +167,4 @@
x .= 0
Pl = setup(amg(),x,A,b)
_, history = IterativeSolvers.cg!(x,A,b;Pl,log=true)
-history
Converged after 10 iterations.
This page was generated using Literate.jl.
Settings
This document was generated with Documenter.jl version 1.7.0 on Monday 7 October 2024. Using Julia version 1.10.5.