Skip to content

Commit 49e4e59

Browse files
authored
Merge pull request #81 from ocaml-multicore/generate-opam
Generate opam files automatically
2 parents ed73c87 + b2301e6 commit 49e4e59

File tree

13 files changed

+121
-46
lines changed

13 files changed

+121
-46
lines changed

.ocamlformat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
profile = default
2-
version = 0.25.1
2+
version = 0.26.0

dune-project

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,31 @@
1-
(lang dune 3.0)
1+
(lang dune 3.2)
22
(name saturn)
3+
(generate_opam_files true)
4+
(source (github ocaml-multicore/saturn))
5+
(license ISC)
6+
(authors "KC Sivaramakrishnan")
7+
(maintainers "Carine Morel" "KC Sivaramakrishnan" "Sudha Parimala")
8+
(documentation "https://ocaml-multicore.github.io/saturn/")
39
(package
410
(name saturn)
5-
(synopsis "Collection of parallelism-safe data structures for Multicore OCaml"))
11+
(synopsis "Collection of parallelism-safe data structures for Multicore OCaml")
12+
(depends
13+
(ocaml (>= 4.12))
14+
(domain_shims (>= 0.1.0))
15+
(saturn_lockfree (= :version))
16+
(qcheck (and (>= 0.18.1) :with-test))
17+
(qcheck-stm (and (>= 0.2) :with-test))
18+
(qcheck-alcotest (and (>= 0.18.1) :with-test))
19+
(yojson (and (>= 2.0.2) :with-test))
20+
(dscheck (and (>= 0.1.0) :with-test))))
621
(package
722
(name saturn_lockfree)
8-
(synopsis "Collection of lock-free data structures for Multicore OCaml"))
23+
(synopsis "Collection of lock-free data structures for Multicore OCaml")
24+
(depends
25+
(ocaml (>= 4.12))
26+
(domain_shims (>= 0.1.0))
27+
(qcheck (and (>= 0.18.1) :with-test))
28+
(qcheck-stm (and (>= 0.2) :with-test))
29+
(qcheck-alcotest (and (>= 0.18.1) :with-test))
30+
(yojson (and (>= 2.0.2) :with-test))
31+
(dscheck (and (>= 0.1.0) :with-test))))

saturn.opam

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,37 @@
1+
# This file is generated by dune, edit dune-project instead
12
opam-version: "2.0"
2-
maintainer:"KC Sivaramakrishnan <[email protected]>"
3-
authors: ["KC Sivaramakrishnan <[email protected]>"]
4-
homepage: "https://github.com/ocaml-multicore/saturn"
5-
doc: "https://ocaml-multicore.github.io/saturn"
6-
synopsis: "Parallelism-safe data structures for multicore OCaml"
3+
synopsis:
4+
"Collection of parallelism-safe data structures for Multicore OCaml"
5+
maintainer: ["Carine Morel" "KC Sivaramakrishnan" "Sudha Parimala"]
6+
authors: ["KC Sivaramakrishnan"]
77
license: "ISC"
8-
dev-repo: "git+https://github.com/ocaml-multicore/saturn.git"
8+
homepage: "https://github.com/ocaml-multicore/saturn"
9+
doc: "https://ocaml-multicore.github.io/saturn/"
910
bug-reports: "https://github.com/ocaml-multicore/saturn/issues"
10-
tags: []
1111
depends: [
12+
"dune" {>= "3.2"}
1213
"ocaml" {>= "4.12"}
13-
"dune" {>= "3.0"}
1414
"domain_shims" {>= "0.1.0"}
15-
"qcheck" {with-test & >= "0.18.1"}
16-
"qcheck-stm" {with-test & >= "0.2"}
17-
"qcheck-alcotest" {with-test & >= "0.18.1"}
18-
"alcotest" {with-test & >= "1.6.0"}
19-
"yojson" {with-test &>= "2.0.2"}
20-
"dscheck" {with-test & >= "0.1.0"}
15+
"saturn_lockfree" {= version}
16+
"qcheck" {>= "0.18.1" & with-test}
17+
"qcheck-stm" {>= "0.2" & with-test}
18+
"qcheck-alcotest" {>= "0.18.1" & with-test}
19+
"yojson" {>= "2.0.2" & with-test}
20+
"dscheck" {>= "0.1.0" & with-test}
21+
"odoc" {with-doc}
2122
]
22-
available: arch != "x86_32" & arch != "arm32" & arch != "ppc64"
23-
depopts: []
24-
build: ["dune" "build" "-p" name "-j" jobs]
23+
build: [
24+
["dune" "subst"] {dev}
25+
[
26+
"dune"
27+
"build"
28+
"-p"
29+
name
30+
"-j"
31+
jobs
32+
"@install"
33+
"@runtest" {with-test}
34+
"@doc" {with-doc}
35+
]
36+
]
37+
dev-repo: "git+https://github.com/ocaml-multicore/saturn.git"

saturn_lockfree.opam

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,35 @@
1+
# This file is generated by dune, edit dune-project instead
12
opam-version: "2.0"
2-
maintainer:"KC Sivaramakrishnan <[email protected]>"
3-
authors: ["KC Sivaramakrishnan <[email protected]>"]
4-
homepage: "https://github.com/ocaml-multicore/saturn"
5-
doc: "https://ocaml-multicore.github.io/saturn"
6-
synopsis: "Lock-free data structures for multicore OCaml"
3+
synopsis: "Collection of lock-free data structures for Multicore OCaml"
4+
maintainer: ["Carine Morel" "KC Sivaramakrishnan" "Sudha Parimala"]
5+
authors: ["KC Sivaramakrishnan"]
76
license: "ISC"
8-
dev-repo: "git+https://github.com/ocaml-multicore/saturn.git"
7+
homepage: "https://github.com/ocaml-multicore/saturn"
8+
doc: "https://ocaml-multicore.github.io/saturn/"
99
bug-reports: "https://github.com/ocaml-multicore/saturn/issues"
10-
tags: []
1110
depends: [
11+
"dune" {>= "3.2"}
1212
"ocaml" {>= "4.12"}
13-
"dune" {>= "3.0"}
1413
"domain_shims" {>= "0.1.0"}
15-
"qcheck" {with-test & >= "0.18.1"}
16-
"qcheck-stm" {with-test & >= "0.2"}
17-
"qcheck-alcotest" {with-test & >= "0.18.1"}
18-
"alcotest" {with-test & >= "1.6.0"}
19-
"yojson" {with-test &>= "2.0.2"}
20-
"dscheck" {with-test & >= "0.1.0"}
14+
"qcheck" {>= "0.18.1" & with-test}
15+
"qcheck-stm" {>= "0.2" & with-test}
16+
"qcheck-alcotest" {>= "0.18.1" & with-test}
17+
"yojson" {>= "2.0.2" & with-test}
18+
"dscheck" {>= "0.1.0" & with-test}
19+
"odoc" {with-doc}
2120
]
22-
available: arch != "x86_32" & arch != "arm32" & arch != "ppc64"
23-
depopts: []
24-
build: ["dune" "build" "-p" name "-j" jobs]
21+
build: [
22+
["dune" "subst"] {dev}
23+
[
24+
"dune"
25+
"build"
26+
"-p"
27+
name
28+
"-j"
29+
jobs
30+
"@install"
31+
"@runtest" {with-test}
32+
"@doc" {with-doc}
33+
]
34+
]
35+
dev-repo: "git+https://github.com/ocaml-multicore/saturn.git"

src_lockfree/ws_deque.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ module CArray = struct
5454
(* Because [size t] is a power of two, [i mod (size t)] is the same as
5555
[i land (size t - 1)], that is, [i land (mask t)]. *)
5656
Int.logand i (mask t)
57-
[@@inline]
57+
[@@inline]
5858

5959
let get t i = Array.unsafe_get t (index i t) [@@inline]
6060
let put t i v = Array.unsafe_set t (index i t) v [@@inline]
@@ -66,7 +66,7 @@ module CArray = struct
6666
dst
6767
(index top dst) (* number of elements: *)
6868
num
69-
[@@inline]
69+
[@@inline]
7070

7171
let grow t top bottom =
7272
let sz = size t in
@@ -138,7 +138,7 @@ module M : S = struct
138138
deque array get garbage collected *)
139139
ptr := Obj.magic ();
140140
res
141-
[@@inline]
141+
[@@inline]
142142

143143
let pop q =
144144
if size q = 0 then raise Exit

test/michael_scott_queue/dune

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
(test
88
(name michael_scott_queue_dscheck)
99
(libraries atomic dscheck alcotest)
10+
(enabled_if
11+
(not
12+
(and
13+
(= %{arch_sixtyfour} false)
14+
(= %{architecture} arm))))
1015
(modules backoff michael_scott_queue michael_scott_queue_dscheck))
1116

1217
(test
@@ -18,5 +23,7 @@
1823
(name stm_michael_scott_queue)
1924
(modules stm_michael_scott_queue)
2025
(libraries saturn qcheck-stm.sequential qcheck-stm.domain)
26+
(enabled_if
27+
(= %{arch_sixtyfour} true))
2128
(action
2229
(run %{test} --verbose)))

test/mpmc_relaxed_queue/test_mpmc_relaxed_queue.ml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,9 @@ let two_threads_spin_test () =
134134
Domain.join dequeuer |> ignore;
135135
()
136136

137+
let doms1 = if Sys.word_size >= 64 then 4 else 1
138+
let doms2 = if Sys.word_size >= 64 then 8 else 1
139+
137140
let () =
138141
let open Alcotest in
139142
run "Mpmc_queue"
@@ -146,9 +149,9 @@ let () =
146149
);
147150
( "validate indices under load",
148151
[
149-
test_case " 4 prod. 4 cons." `Slow (run_test 4 4);
150-
test_case " 8 prod. 1 cons." `Slow (run_test 8 1);
151-
test_case " 1 prod. 8 cons." `Slow (run_test 1 8);
152+
test_case " 4 prod. 4 cons." `Slow (run_test doms1 doms1);
153+
test_case " 8 prod. 1 cons." `Slow (run_test doms2 1);
154+
test_case " 1 prod. 8 cons." `Slow (run_test 1 doms2);
152155
] );
153156
]
154157
@

test/mpsc_queue/dune

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,7 @@
1515
(name stm_mpsc_queue)
1616
(modules stm_mpsc_queue)
1717
(libraries saturn qcheck-stm.sequential qcheck-stm.domain)
18+
(enabled_if
19+
(= %{arch_sixtyfour} true))
1820
(action
1921
(run %{test} --verbose)))

test/mpsc_queue/stm_mpsc_queue.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ module MPSCConf = struct
5050
(is_closed, if not is_closed then i :: List.rev s |> List.rev else s)
5151
| Push_head i -> (is_closed, if not (is_closed && s = []) then i :: s else s)
5252
| Is_empty -> (is_closed, s)
53-
| Pop -> ( (is_closed, match s with [] -> s | _ :: s' -> s'))
53+
| Pop -> (is_closed, match s with [] -> s | _ :: s' -> s')
5454
| Close -> (true, s)
5555

5656
let precond _ _ = true

test/spsc_queue/dune

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,7 @@
2020
(name stm_spsc_queue)
2121
(modules stm_spsc_queue)
2222
(libraries saturn qcheck-stm.sequential qcheck-stm.domain)
23+
(enabled_if
24+
(= %{arch_sixtyfour} true))
2325
(action
2426
(run %{test} --verbose)))

0 commit comments

Comments
 (0)