Skip to content

Commit

Permalink
more tutorial corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
boriskaus committed Oct 10, 2024
1 parent da6d06b commit 610b57b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
10 changes: 6 additions & 4 deletions docs/src/man/Tutorial_Chmy_MPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ EditURL = "../../../tutorials/Tutorial_Chmy_MPI.jl"
## Aim
In this tutorial, your will learn how to use [Chmy](https://github.com/PTsolvers/Chmy.jl) to perform a 2D diffusion simulation
on one or multiple CPU's or GPU's.
`Chmy` is a package that allows you to specify grids and fields and create finite difference simulations
`Chmy` is a package that allows you to specify grids and fields and create finite difference simulations, by
applying stencil-based kernels in an efficient manner.

## 1. Load Chmy and required packages

Expand Down Expand Up @@ -46,7 +47,7 @@ You need to specify compute kernel for the gradients:
end
```

You need to specify compute kernel to update the concentration
You need to specify a compute kernel to update the concentration

```julia
@kernel inbounds = true function update_C!(C, q, Δt, g::StructuredGrid, O)
Expand All @@ -56,7 +57,7 @@ You need to specify compute kernel to update the concentration
end
```

And a main function is required:
And the main function is:

```julia
@views function main(backend=CPU(); nxy_l=(126, 126))
Expand Down Expand Up @@ -121,7 +122,8 @@ In the code above, the part that calls `GMG` is:
```julia
add_box!(P,C,grid, xlim=(-1.0,1.0), zlim=(-1.0,1.0), phase=ConstantPhase(4), T=ConstantTemp(400))
```
which works just like any of the other GMG function.
which works just like any of the other GMG function, except that you pass Chmy Scalar Fields and a Chmy grid object.
Note that this also works in MPI-parallel.

## 3. Run the simulation on one CPU machine or GPU card:

Expand Down
10 changes: 6 additions & 4 deletions tutorials/Tutorial_Chmy_MPI.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
# ## Aim
# In this tutorial, your will learn how to use [Chmy](https://github.com/PTsolvers/Chmy.jl) to perform a 2D diffusion simulation
# on one or multiple CPU's or GPU's.
# `Chmy` is a package that allows you to specify grids and fields and create finite difference simulations
# `Chmy` is a package that allows you to specify grids and fields and create finite difference simulations, by
# applying stencil-based kernels in an efficient manner.
#
# ## 1. Load Chmy and required packages
using Chmy, Chmy.Architectures, Chmy.Grids, Chmy.Fields, Chmy.BoundaryConditions, Chmy.GridOperators, Chmy.KernelLaunch
Expand Down Expand Up @@ -35,14 +36,14 @@ MPI.Init()
q.y[I...] = -χ * ∂y(C, g, I...)
end

# You need to specify compute kernel to update the concentration
# You need to specify a compute kernel to update the concentration
@kernel inbounds = true function update_C!(C, q, Δt, g::StructuredGrid, O)
I = @index(Global, NTuple)
I = I + O
C[I...] -= Δt * divg(q, g, I...)
end

# And a main function is required:
# And the main function is:
@views function main(backend=CPU(); nxy_l=(126, 126))
arch = Arch(backend, MPI.COMM_WORLD, (0, 0))
topo = topology(arch)
Expand Down Expand Up @@ -104,7 +105,8 @@ end
# ```julia
# add_box!(P,C,grid, xlim=(-1.0,1.0), zlim=(-1.0,1.0), phase=ConstantPhase(4), T=ConstantTemp(400))
# ```
# which works just like any of the other GMG function.
# which works just like any of the other GMG function, except that you pass Chmy Scalar Fields and a Chmy grid object.
# Note that this also works in MPI-parallel.

# ## 3. Run the simulation on one CPU machine or GPU card:

Expand Down

2 comments on commit 610b57b

@boriskaus
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator: register

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request updated: JuliaRegistries/General/116914

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.7.8 -m "<description of version>" 610b57b35c07727cf7e7bc0334c7591a7179162f
git push origin v0.7.8

Please sign in to comment.