Skip to content

Commit 06a6b1f

Browse files
committed
API change for domainslib 0.5.1
1 parent 952f217 commit 06a6b1f

9 files changed

Lines changed: 10 additions & 9 deletions

dune-project

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@
1717

1818
(package
1919
(name ocaml5_tutorial)
20+
(allow_empty)
2021
(synopsis "A tutorial on new concurrency features in OCaml 5")
2122
(description "A tutorial on new concurrency features in OCaml 5")
22-
(depends ocaml dune))
23+
(depends ocaml dune (domainslib (>= 0.5.1))))
2324

2425
; See the complete stanza docs at https://dune.readthedocs.io/en/stable/dune-files.html#dune-project

ocaml5_tutorial.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ bug-reports: "https://github.com/kayceesrk/ocaml5-tutorial/issues"
1111
depends: [
1212
"ocaml"
1313
"dune" {>= "3.1"}
14+
"domainslib" {>= "0.5.1"}
1415
"odoc" {with-doc}
15-
"domainslib"
1616
]
1717
build: [
1818
["dune" "subst"] {dev}

solutions/game_of_life_par.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ let rec repeat pool n =
6262
| _-> next pool; repeat pool (n-1)
6363

6464
let ()=
65-
let pool = T.setup_pool ~num_additional_domains:(num_domains - 1) () in
65+
let pool = T.setup_pool ~num_domains:(num_domains - 1) () in
6666
print !rg;
6767
T.run pool (fun _ -> repeat pool n_times);
6868
print !rg;

solutions/mergesort_par.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ let sort pool a =
4848
T.run pool (fun () -> merge_sort pool false a b 0 (Array.length a))
4949

5050
let () =
51-
let pool = T.setup_pool ~num_additional_domains:(num_domains - 1) () in
51+
let pool = T.setup_pool ~num_domains:(num_domains - 1) () in
5252
sort pool a;
5353
T.teardown_pool pool

solutions/tak_par.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ let rec tak_par p x y z =
2525
else z
2626

2727
let main () =
28-
let p = T.setup_pool ~num_additional_domains:(num_domains - 1) () in
28+
let p = T.setup_pool ~num_domains:(num_domains - 1) () in
2929
let r = T.run p (fun _ -> tak_par p x y z) in
3030
T.teardown_pool p;
3131
Printf.printf "tak %d %d %d = %d\n" x y z r

src/fib_domainslib.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ let rec fib_par pool n =
1313
end else fib n
1414

1515
let main () =
16-
let pool = T.setup_pool ~num_additional_domains:(num_domains - 1) () in
16+
let pool = T.setup_pool ~num_domains:(num_domains - 1) () in
1717
let res = T.run pool (fun _ -> fib_par pool n) in
1818
T.teardown_pool pool;
1919
Printf.printf "fib(%d) = %d\n" n res

src/mandelbrot_par.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ let mandelbrot pool w =
4242
)
4343

4444
let main () =
45-
let pool = T.setup_pool ~num_additional_domains:(num_domains - 1) () in
45+
let pool = T.setup_pool ~num_domains:(num_domains - 1) () in
4646
let l = T.run pool (fun _ -> mandelbrot pool w) in
4747
T.teardown_pool pool;
4848
List.iter (fun buf -> output_bytes stdout (Buffer.to_bytes buf)) l

src/spectralnorm_par.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ let eval_AtA_times_u pool u v =
2727

2828

2929
let () =
30-
let pool = T.setup_pool ~num_additional_domains:(num_domains - 1) () in
30+
let pool = T.setup_pool ~num_domains:(num_domains - 1) () in
3131
let u = Array.make n 1.0 and v = Array.make n 0.0 in
3232
T.run pool (fun _ ->
3333
for _i = 0 to 9 do

src/tak_par.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ let rec tak x y z =
1717
let rec tak_par p x y z = failwith "not implemented"
1818

1919
let main () =
20-
let p = T.setup_pool ~num_additional_domains:(num_domains - 1) () in
20+
let p = T.setup_pool ~num_domains:(num_domains - 1) () in
2121
let r = T.run p (fun _ -> tak_par p x y z) in
2222
T.teardown_pool p;
2323
Printf.printf "tak %d %d %d = %d\n" x y z r

0 commit comments

Comments
 (0)