diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 05a7859..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 }} @@ -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 diff --git a/domainslib.opam b/domainslib.opam index 9e5c86f..46fc31b 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.00"} "dune" {>= "3.0"} - "lockfree" { >= "0.2.0"} - "mirage-clock-unix" {with-test} + "ocaml" {>= "5.0"} + "lockfree" {>= "0.2.0"} + "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"} + "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 78a65eb..bcd2a8b 100644 --- a/dune-project +++ b/dune-project @@ -1,2 +1,21 @@ -(lang dune 1.8) +(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 (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"))))) 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) 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 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