Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/01-intro-to-parallelism-part-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ of parallelism. It is also passed to the tasks so that they can spawn sub-tasks.
To run `add4`, we need to get our hands on a *scheduler,* a component that takes
in all the tasks that we want to run, decides how to dole them out into domains,
and tracks who is waiting for what to be computed. Each scheduler is provided by
a library. For this tutorial, we'll use `parallel.scheduler.work_stealing`,
a library. For this tutorial, we'll use `parallel.scheduler`,
which implements the popular [work-stealing] strategy.

[work-stealing]: https://en.wikipedia.org/wiki/Work_stealing
Expand All @@ -281,7 +281,7 @@ for details).
let test_add4 par = add4 par 1 10 100 1000

let run_one_test ~(f : Parallel.t @ local -> 'a) : 'a =
let module Scheduler = Parallel_scheduler_work_stealing in
let module Scheduler = Parallel_scheduler in
let scheduler = Scheduler.create () in
let monitor = Parallel.Monitor.create_root () in
let result = Scheduler.schedule scheduler ~monitor ~f in
Expand All @@ -302,7 +302,7 @@ This uses a work-stealing scheduler, but you can also use the `parallel`
library's own `Parallel.Scheduler.Sequential`, which simply runs everything on
the primary domain. This is handy for testing or debugging when you want to
eliminate nondeterminism. To do so, simply replace
`Parallel_scheduler_work_stealing` with `Parallel.Scheduler.Sequential` in
`Parallel_scheduler` with `Parallel.Scheduler.Sequential` in
`run_one_test`.

## Averaging over binary trees
Expand Down
10 changes: 5 additions & 5 deletions docs/02-intro-to-parallelism-part-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,12 @@ Since each task can only access a separate portion of the array—and the
slices are `local`, so don't escape—this is safe.

To run our parallel quicksort, we need to get an implementation of parallelism
from a scheduler. For example, using `Parallel_scheduler_work_stealing`:
from a scheduler. For example, using `Parallel_scheduler`:

```ocaml
let quicksort ~scheduler ~mutex array =
let monitor = Parallel.Monitor.create_root () in
Parallel_scheduler_work_stealing.schedule scheduler ~monitor ~f:(fun parallel ->
Parallel_scheduler.schedule scheduler ~monitor ~f:(fun parallel ->
let array = Par_array.of_array array in
(* ^^^^^ *)
(* This value is contended but expected to be uncontended. *)
Expand All @@ -275,7 +275,7 @@ assures that our caller is not mutating it in parallel.
```ocaml
let quicksort ~scheduler ~mutex array =
let monitor = Parallel.Monitor.create_root () in
Parallel_scheduler_work_stealing.schedule scheduler ~monitor ~f:(fun parallel ->
Parallel_scheduler.schedule scheduler ~monitor ~f:(fun parallel ->
Capsule.Mutex.with_lock mutex ~f:(fun password ->
Capsule.Data.iter array ~password ~f:(fun array ->
let array = Par_array.of_array array in
Expand Down Expand Up @@ -369,7 +369,7 @@ page](../../parallelism/02-capsules).
```ocaml
let filter ~scheduler ~mutex image =
let monitor = Parallel.Monitor.create_root () in
Parallel_scheduler_work_stealing.schedule scheduler ~monitor ~f:(fun parallel ->
Parallel_scheduler.schedule scheduler ~monitor ~f:(fun parallel ->
(* Note [project] produces a contended image *)
let width = Image.width (Capsule.Data.project image) in
let height = Image.height (Capsule.Data.project image) in
Expand Down Expand Up @@ -429,7 +429,7 @@ input, but that's perfectly fine here.
```ocaml
let filter ~scheduler ~key image =
let monitor = Parallel.Monitor.create_root () in
Parallel_scheduler_work_stealing.schedule scheduler ~monitor ~f:(fun parallel ->
Parallel_scheduler.schedule scheduler ~monitor ~f:(fun parallel ->
let width = Image.width (Capsule.Data.project image) in
let height = Image.height (Capsule.Data.project image) in
let pixels = width * height in
Expand Down
2 changes: 1 addition & 1 deletion handson_activity/act02_gensym_atomics/dune
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
(executables
(names gensym_atomics)
(libraries parallel parallel.scheduler.work_stealing))
(libraries parallel parallel.scheduler))
2 changes: 1 addition & 1 deletion handson_activity/act02_gensym_atomics/gensym_atomics.ml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ let gensym_pair par =

(* Run parallel computation *)
let run_parallel ~f =
let module Scheduler = Parallel_scheduler_work_stealing in
let module Scheduler = Parallel_scheduler in
let scheduler = Scheduler.create () in
let result = Scheduler.parallel scheduler ~f in
Scheduler.stop scheduler;
Expand Down
2 changes: 1 addition & 1 deletion handson_activity/act03_gensym_capsules/dune
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
(executables
(names gensym_capsules)
(libraries portable parallel parallel.scheduler.work_stealing))
(libraries portable parallel parallel.scheduler))
2 changes: 1 addition & 1 deletion handson_activity/act03_gensym_capsules/gensym_capsules.ml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ let gensym_pair par =

(* Run parallel computation *)
let run_parallel ~f =
let module Scheduler = Parallel_scheduler_work_stealing in
let module Scheduler = Parallel_scheduler in
let scheduler = Scheduler.create () in
let result = Scheduler.parallel scheduler ~f in
Scheduler.stop scheduler;
Expand Down
2 changes: 1 addition & 1 deletion handson_activity/act04_quicksort/dune
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
(executables
(names quicksort quicksort_reference)
(libraries base portable parallel parallel.scheduler.work_stealing))
(libraries base portable parallel parallel.scheduler))