From 5f5a01559e10851151699d419a92acec297dec75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonin=20D=C3=A9cimo?= Date: Fri, 20 Jan 2023 13:41:46 +0100 Subject: [PATCH 1/9] Set dune lang to 3.0 Dune is already constrained to >= 3.0 in the opam file --- dune-project | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dune-project b/dune-project index 78a65eb..f96de0f 100644 --- a/dune-project +++ b/dune-project @@ -1,2 +1,3 @@ -(lang dune 1.8) +(lang dune 3.0) (name domainslib) +(formatting disabled) From 56296f65c08e746e47a8ee7cc7d2764e8ef8daca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonin=20D=C3=A9cimo?= Date: Fri, 20 Jan 2023 13:45:29 +0100 Subject: [PATCH 2/9] Fix OCaml 5.0 version number constraint --- domainslib.opam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/domainslib.opam b/domainslib.opam index 9e5c86f..68fc5d1 100644 --- a/domainslib.opam +++ b/domainslib.opam @@ -9,7 +9,7 @@ dev-repo: "git+https://github.com/ocaml-multicore/domainslib.git" bug-reports: "https://github.com/ocaml-multicore/domainslib/issues" tags: [] depends: [ - "ocaml" {>= "5.00"} + "ocaml" {>= "5.0"} "dune" {>= "3.0"} "lockfree" { >= "0.2.0"} "mirage-clock-unix" {with-test} From c85c5ce179c9a2d44db3c3c4e9ebedfc0991842f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonin=20D=C3=A9cimo?= Date: Fri, 20 Jan 2023 13:51:44 +0100 Subject: [PATCH 3/9] Generate opam file using Dune --- domainslib.opam | 29 ++++++++++++++++++++--------- dune-project | 18 ++++++++++++++++++ 2 files changed, 38 insertions(+), 9 deletions(-) diff --git a/domainslib.opam b/domainslib.opam index 68fc5d1..02f3e4a 100644 --- a/domainslib.opam +++ b/domainslib.opam @@ -1,23 +1,34 @@ +# This file is generated by dune, edit dune-project instead opam-version: "2.0" -maintainer: "KC Sivaramakrishnan " +synopsis: "Parallel Structures over Domains for Multicore OCaml" +maintainer: ["KC Sivaramakrishnan "] authors: ["KC Sivaramakrishnan "] +license: "ISC" homepage: "https://github.com/ocaml-multicore/domainslib" doc: "https://kayceesrk.github.io/domainslib/doc" -synopsis: "Parallel Structures over Domains for Multicore OCaml" -license: "ISC" -dev-repo: "git+https://github.com/ocaml-multicore/domainslib.git" bug-reports: "https://github.com/ocaml-multicore/domainslib/issues" -tags: [] depends: [ - "ocaml" {>= "5.0"} "dune" {>= "3.0"} - "lockfree" { >= "0.2.0"} + "ocaml" {>= "5.0"} + "lockfree" {>= "0.2.0"} "mirage-clock-unix" {with-test} "qcheck-core" {with-test & >= "0.20"} "qcheck-multicoretests-util" {with-test & >= "0.1"} "qcheck-stm" {with-test & >= "0.1"} + "odoc" {with-doc} ] -depopts: [] build: [ - "dune" "build" "-p" name + ["dune" "subst"] {dev} + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] ] +dev-repo: "git+https://github.com/ocaml-multicore/domainslib.git" diff --git a/dune-project b/dune-project index f96de0f..d596b8b 100644 --- a/dune-project +++ b/dune-project @@ -1,3 +1,21 @@ (lang dune 3.0) (name domainslib) (formatting disabled) +(generate_opam_files true) + +(source (github ocaml-multicore/domainslib)) +(authors "KC Sivaramakrishnan ") +(maintainers "KC Sivaramakrishnan ") +(documentation "https://kayceesrk.github.io/domainslib/doc") +(license "ISC") + +(package + (name domainslib) + (synopsis "Parallel Structures over Domains for Multicore OCaml") + (depends + (ocaml (>= "5.0")) + (lockfree (>= "0.2.0")) + (mirage-clock-unix :with-test) + (qcheck-core (and :with-test (>= "0.20"))) + (qcheck-multicoretests-util (and :with-test (>= "0.1"))) + (qcheck-stm (and :with-test (>= "0.1"))))) From 2ffc832c2e35fef698d7bb3d9e3643d5a2114fd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonin=20D=C3=A9cimo?= Date: Fri, 20 Jan 2023 13:52:37 +0100 Subject: [PATCH 4/9] Sequential matrix creation is never used --- test/LU_decomposition_multicore.ml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/test/LU_decomposition_multicore.ml b/test/LU_decomposition_multicore.ml index ab123ee..f203498 100644 --- a/test/LU_decomposition_multicore.ml +++ b/test/LU_decomposition_multicore.ml @@ -5,13 +5,6 @@ let mat_size = try int_of_string Sys.argv.(2) with _ -> 1200 let k = Domain.DLS.new_key Random.State.make_self_init module SquareMatrix = struct - - let create f : float array = - let fa = Array.create_float (mat_size * mat_size) in - for i = 0 to mat_size * mat_size - 1 do - fa.(i) <- f (i / mat_size) (i mod mat_size) - done; - fa let parallel_create pool f : float array = let fa = Array.create_float (mat_size * mat_size) in T.parallel_for pool ~start:0 ~finish:( mat_size * mat_size - 1) From 96304da96fba869ba0e836ad6dd8eb2a7659e134 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonin=20D=C3=A9cimo?= Date: Mon, 23 Jan 2023 10:11:54 +0100 Subject: [PATCH 5/9] Execute test/fib_par --- test/fib_par.ml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/fib_par.ml b/test/fib_par.ml index 77e944b..7f7d701 100644 --- a/test/fib_par.ml +++ b/test/fib_par.ml @@ -19,3 +19,5 @@ let main = let res = T.run pool (fun _ -> fib_par pool n) in T.teardown_pool pool; Printf.printf "fib(%d) = %d\n" n res + +let () = main From 5a2d6f11ff33c292ad7f40efe44f0fd926dd5976 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonin=20D=C3=A9cimo?= Date: Mon, 23 Jan 2023 10:35:25 +0100 Subject: [PATCH 6/9] Fix backtrace slot name change --- test/backtrace.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/backtrace.ml b/test/backtrace.ml index 7fb7e56..2d7c312 100644 --- a/test/backtrace.ml +++ b/test/backtrace.ml @@ -31,6 +31,7 @@ let _ = let open Printexc in let bt = get_raw_backtrace () in let bt_slot_arr = Option.get (backtrace_slots bt) in - assert (Option.get (Slot.name bt_slot_arr.(1)) = "Backtrace.foo"); + let name = Option.get (Slot.name bt_slot_arr.(1)) in + assert (name = "Backtrace.foo" || name = "Dune__exe__Backtrace.foo"); let s = raw_backtrace_to_string bt in print_string s From e1368af47d42dcc8e00bf990ef3f33d83ed81f36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonin=20D=C3=A9cimo?= Date: Mon, 23 Jan 2023 10:39:06 +0100 Subject: [PATCH 7/9] gha: update to actions/checkout@v3 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 05a7859..21c5069 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,7 +25,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Get latest OCaml commit hash id: multicore_hash From d105cc99249bd1f150135a2bd2b8ad484f8e07cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonin=20D=C3=A9cimo?= Date: Mon, 23 Jan 2023 10:39:36 +0100 Subject: [PATCH 8/9] gha: update from 5.0.0~beta1 to 5.0.x --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 21c5069..c587d29 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,7 +15,7 @@ jobs: - ubuntu-latest - macos-latest ocaml-compiler: - - ocaml-base-compiler.5.0.0~beta1 + - 5.0.x - ocaml-variants.5.1.0+trunk runs-on: ${{ matrix.os }} From 43adf693b656a30c67766b4f449efaa71dd2576b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonin=20D=C3=A9cimo?= Date: Mon, 23 Jan 2023 11:12:17 +0100 Subject: [PATCH 9/9] Add lower-bound constraint to mirage-clock-unix --- domainslib.opam | 2 +- dune-project | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/domainslib.opam b/domainslib.opam index 02f3e4a..46fc31b 100644 --- a/domainslib.opam +++ b/domainslib.opam @@ -11,7 +11,7 @@ depends: [ "dune" {>= "3.0"} "ocaml" {>= "5.0"} "lockfree" {>= "0.2.0"} - "mirage-clock-unix" {with-test} + "mirage-clock-unix" {with-test & >= "4.2.0"} "qcheck-core" {with-test & >= "0.20"} "qcheck-multicoretests-util" {with-test & >= "0.1"} "qcheck-stm" {with-test & >= "0.1"} diff --git a/dune-project b/dune-project index d596b8b..bcd2a8b 100644 --- a/dune-project +++ b/dune-project @@ -15,7 +15,7 @@ (depends (ocaml (>= "5.0")) (lockfree (>= "0.2.0")) - (mirage-clock-unix :with-test) + (mirage-clock-unix (and :with-test (>= "4.2.0"))) (qcheck-core (and :with-test (>= "0.20"))) (qcheck-multicoretests-util (and :with-test (>= "0.1"))) (qcheck-stm (and :with-test (>= "0.1")))))