Skip to content

Commit 79f80c0

Browse files
committed
fix interop notebook
1 parent 016f766 commit 79f80c0

File tree

1 file changed

+23
-31
lines changed

1 file changed

+23
-31
lines changed

lecture_04_interop.jl

Lines changed: 23 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ macro bind(def, element)
2020
#! format: on
2121
end
2222

23+
# ╔═╡ 28f80981-74cb-4e20-8a84-3be15894532e
24+
begin
25+
using PlutoUI, PlutoTeachingTools
26+
using PlutoUI: Slider
27+
PlutoUI.TableOfContents(; depth=4)
28+
end
29+
2330
# ╔═╡ e5e2a706-2122-4a6b-8a2d-f8bb801c3055
2431
begin
2532
using CairoMakie
@@ -35,9 +42,6 @@ using CondaPkg; CondaPkg.add("seaborn")
3542
# ╔═╡ 1a7f20f9-a69c-49a2-a012-ed59657cc29f
3643
using PythonCall, RDatasets
3744

38-
# ╔═╡ e036e0b1-60f5-4670-9956-15e74d010ee9
39-
using MPI, Serialization, StaticArrays
40-
4145
# ╔═╡ 0e88ed74-261d-4aad-82dc-ed8076684406
4246
using Measurements
4347

@@ -196,22 +200,6 @@ macro mpi(np, expr)
196200
end
197201
end
198202

199-
# ╔═╡ fa98c58b-e61b-4762-a89f-58cf6b5a50d0
200-
@mpi np let
201-
using StaticArrays
202-
203-
MPI.Init()
204-
comm = MPI.COMM_WORLD
205-
206-
x = ones(SVector{3, Float64})
207-
sum = MPI.Allreduce([x], +, comm)
208-
209-
if MPI.Comm_rank(comm) == 0
210-
@show sum
211-
end
212-
nothing
213-
end
214-
215203
# ╔═╡ c739f61d-7104-4ae4-9934-fc98657fc2fc
216204
md"""
217205
Compute $\int_0^1 \frac{4}{1+x^2} dx = [4 * atan(x)]_0^1$ which evaluates to π
@@ -526,18 +514,23 @@ md"""
526514
- [2025 RSE Course](https://vchuravy.dev/rse-course)
527515
"""
528516
529-
# ╔═╡ 28f80981-74cb-4e20-8a84-3be15894532e
530-
begin
531-
using PlutoUI, PlutoTeachingTools
532-
using PlutoUI: Slider
533-
PlutoUI.TableOfContents(; depth=4)
534-
end
517+
# ╔═╡ e036e0b1-60f5-4670-9956-15e74d010ee9
518+
using MPI, Serialization, StaticArrays
535519
536-
# ╔═╡ 83fd4129-f9bf-47af-a9ea-505511909ebe
537-
begin
538-
using PlutoUI, PlutoTeachingTools
539-
using PlutoUI: Slider
540-
PlutoUI.TableOfContents(; depth=4)
520+
# ╔═╡ fa98c58b-e61b-4762-a89f-58cf6b5a50d0
521+
@mpi np let
522+
using StaticArrays
523+
524+
MPI.Init()
525+
comm = MPI.COMM_WORLD
526+
527+
x = ones(SVector{3, Float64})
528+
sum = MPI.Allreduce([x], +, comm)
529+
530+
if MPI.Comm_rank(comm) == 0
531+
@show sum
532+
end
533+
nothing
541534
end
542535
543536
# ╔═╡ 00000000-0000-0000-0000-000000000001
@@ -2909,7 +2902,6 @@ version = "4.1.0+0"
29092902
# ╔═╡ Cell order:
29102903
# ╠═28f80981-74cb-4e20-8a84-3be15894532e
29112904
# ╠═e5e2a706-2122-4a6b-8a2d-f8bb801c3055
2912-
# ╟─83fd4129-f9bf-47af-a9ea-505511909ebe
29132905
# ╟─a9a6a199-e1c5-479f-9bc1-76a073e42e24
29142906
# ╟─b1dcb967-cfd4-4961-9c70-d9e027be5eee
29152907
# ╟─2497e952-8220-46e5-a1c5-4c24631bc026

0 commit comments

Comments
 (0)