Skip to content

Commit

Permalink
Merge pull request #53 from bikallem/ocaml-5.00
Browse files Browse the repository at this point in the history
Make domainslib build/run with OCaml 5.00 after PR #704
  • Loading branch information
Sudha247 authored Oct 28, 2021
2 parents 5104ae9 + 28957cd commit 0931282
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
default: https://github.com/ocaml/opam-repository.git
cache-prefix: ${{ steps.multicore_hash.outputs.commit }}

- run: opam install . --deps-only
- run: opam install . --deps-only --with-test

- run: opam exec -- make all

Expand Down
1 change: 1 addition & 0 deletions domainslib.opam
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ depends: [
"base-domains"
"ocamlfind" {build}
"dune" {build}
"mirage-clock-unix" {with-test}
]
depopts: []
build: [
Expand Down
2 changes: 1 addition & 1 deletion lib/multi_channel.ml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ let rec recv_poll_repeated mchan dls repeats =
| Exit ->
if repeats = 1 then raise Exit
else begin
Domain.Sync.cpu_relax ();
Domain.cpu_relax ();
recv_poll_repeated mchan dls (repeats - 1)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/task.ml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ let rec await pool promise =
| Task (t, p) -> do_task t p
| Quit -> raise TasksActive
with
| Exit -> Domain.Sync.cpu_relax ()
| Exit -> Domain.cpu_relax ()
end;
await pool promise
| Some (Ok v) -> v
Expand Down
2 changes: 1 addition & 1 deletion lib/ws_deque.ml
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ module M : S = struct
if Atomic.compare_and_set q.top t (t + 1) then
release out
else begin
Domain.Sync.cpu_relax ();
Domain.cpu_relax ();
steal q
end

Expand Down
2 changes: 1 addition & 1 deletion test/dune
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

(test
(name task_throughput)
(libraries domainslib)
(libraries domainslib mirage-clock-unix)
(modules task_throughput)
(modes native))

Expand Down
4 changes: 2 additions & 2 deletions test/task_throughput.ml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ let _ =

let hist = TimingHist.make 5 25 in
for _ = 1 to n_iterations do
let t0 = Domain.timer_ticks () in
let t0 = Mclock.elapsed_ns() in
T.parallel_for pool ~start:1 ~finish:n_tasks ~body:(fun _ -> ());
let t = Int64.sub (Domain.timer_ticks ()) t0 in
let t = Int64.sub (Mclock.elapsed_ns ()) t0 in
TimingHist.add_point hist (Int64.to_int t);
done;

Expand Down

0 comments on commit 0931282

Please sign in to comment.