Skip to content

Commit

Permalink
updating docs: index, readme, and translation
Browse files Browse the repository at this point in the history
  • Loading branch information
carstenbauer committed Feb 7, 2024
1 parent 05d7c40 commit 07acefa
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,17 @@ mc_parallel(N) # gives, e.g., 3.14159924

using BenchmarkTools

@show Threads.nthreads() # 5 in this example
@show Threads.nthreads() # 5 in this example

@btime mc_parallel($N; nchunks=1) # effectively running with a single Julia thread
@btime mc_parallel($N) # running with all 5 Julia threads
@btime mc_parallel($N; scheduler=DynamicScheduler(nchunks=1)) # effectively using 1 thread
@btime mc_parallel($N) # using all 5 threads
```

Timings might be something like this:

```
438.394 ms (7 allocations: 624 bytes)
88.050 ms (37 allocations: 3.02 KiB)
447.093 ms (7 allocations: 624 bytes)
89.401 ms (66 allocations: 5.72 KiB)
```

(Check out the full [Parallel Monte Carlo](https://juliafolds2.github.io/OhMyThreads.jl/stable/examples/mc/mc/) example if you like.)
Expand Down
10 changes: 5 additions & 5 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ mc_parallel(N) # gives, e.g., 3.14159924

using BenchmarkTools

@show Threads.nthreads() # 5 in this example
@show Threads.nthreads() # 5 in this example

@btime mc_parallel($N; nchunks=1) # effectively running with a single Julia thread
@btime mc_parallel($N) # running with all 5 Julia threads
@btime mc_parallel($N; scheduler=DynamicScheduler(nchunks=1)) # effectively using 1 thread
@btime mc_parallel($N) # using all 5 threads
```

Timings might be something like this:

```
438.394 ms (7 allocations: 624 bytes)
88.050 ms (37 allocations: 3.02 KiB)
447.093 ms (7 allocations: 624 bytes)
89.401 ms (66 allocations: 5.72 KiB)
```

(Check out the full [Parallel Monte Carlo](@ref) example if you like.)
Expand Down
4 changes: 2 additions & 2 deletions docs/src/translation.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ end

```julia
# OhMyThreads
tforeach(1:10; schedule=:static) do i
tforeach(1:10; scheduler=StaticScheduler()) do i
println(i)
end
```
Expand All @@ -47,7 +47,7 @@ end

```julia
# OhMyThreads
tforeach(1:10; nchunks=10) do i
tforeach(1:10; scheduler=DynamicScheduler(nchunks=10)) do i
println(i)
end
```
Expand Down

0 comments on commit 07acefa

Please sign in to comment.