Skip to content

Commit d49ae9a

Browse files
committed
Prepare release
1 parent 3d981ce commit d49ae9a

File tree

7 files changed

+129
-109
lines changed

7 files changed

+129
-109
lines changed

.github/workflows/main.yml

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,44 +8,30 @@ on:
88
- cron: 0 1 * * MON
99

1010
jobs:
11-
build:
12-
strategy:
13-
matrix:
14-
os:
15-
- ubuntu-latest
16-
- macos-latest
17-
ocaml-compiler:
18-
- 5.0.x
19-
- ocaml-variants.5.1.0+trunk
20-
21-
runs-on: ${{ matrix.os }}
11+
windows:
12+
runs-on: windows-latest
2213

2314
env:
2415
QCHECK_MSG_INTERVAL: '60'
2516

2617
steps:
2718
- name: Checkout code
28-
uses: actions/checkout@v3
29-
30-
- name: Get latest OCaml commit hash
31-
id: multicore_hash
32-
shell: bash
33-
run: |
34-
curl -sH "Accept: application/vnd.github.v3+json" \
35-
https://api.github.com/repos/ocaml/ocaml/commits/trunk \
36-
| jq .commit.tree.sha | xargs printf '::set-output name=commit::%s'
19+
uses: actions/checkout@v2
20+
3721
- name: Use OCaml ${{ matrix.ocaml-compiler }}
3822
uses: ocaml/setup-ocaml@v2
3923
with:
40-
ocaml-compiler: ${{ matrix.ocaml-compiler }}
24+
opam-pin: false
25+
opam-depext: false
26+
ocaml-compiler: ocaml.5.0.0,ocaml-option-mingw
4127
opam-repositories: |
42-
default: https://github.com/ocaml/opam-repository.git
43-
alpha: git+https://github.com/kit-ty-kate/opam-alpha-repository
28+
dra27: https://github.com/dra27/opam-repository.git#windows-5.0
29+
default: https://github.com/ocaml-opam/opam-repository-mingw.git#sunset
30+
upstream: https://github.com/ocaml/opam-repository.git
4431
cache-prefix: ${{ steps.multicore_hash.outputs.commit }}
45-
opam-depext: false
4632

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

49-
- run: opam exec -- make all
35+
- run: opam exec -- dune build
5036

51-
- run: opam exec -- make run_test
37+
- run: opam exec -- dune runtest

CHANGES.md

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,20 @@
22

33
* `parallel_find` function that stops early (#129, #130)
44

5-
## v0.5.0
5+
## 0.5.1
6+
7+
* Add parallel_find (#90, @gasche)
8+
* Update CI (#93, @Sudha247)
9+
* Optimisation to work-stealing (#96, @art-w)
10+
* Improve docs presentation (#99, @metanivek)
11+
* Property based tests (#100, jmid)
12+
* Task: avoid double handler installation (#101, @gasche & @clef-men)
13+
* Fix a benign data-race in Chan reported by ocaml-tsan (#103, @art-w)
14+
* Dune, opam, and GitHub Actions fixes (#105, @MisterDA)
15+
* domain local await support (#107, @polytypic)
16+
* Windows run on GitHub Actions (#110, @Sudha247)
17+
18+
## 0.5.0
619

720
This release includes:
821

@@ -13,35 +26,35 @@ This release includes:
1326
* Breaking change: Rename `num_additional_domains` to `num_domains` for setup_pool
1427
* Documentation updates (#80, #81, #82)
1528

16-
## v0.4.2
29+
## 0.4.2
1730

1831
Includes Effect.eff -> Effect.t change from OCaml trunk. (#65)
1932

20-
## v0.4.1
33+
## 0.4.1
2134

2235
This release fixes compatibility with OCaml 5.00.0+trunk in #61. Breaks compatibility with older Multicore variants 4.12.0+domains and 4.12.0+domains+effects
2336

24-
## v0.4.0
37+
## 0.4.0
2538

2639
This release includes:
2740

2841
* Usage of effect handlers for task creation. This introduces a breaking change; all computations need to be enclosed in a Task.run function. See #51.
2942
* Multi_channel uses a per-channel domain-local key, removing the global key. #50
3043
* Bug fixes in parallel_scan. #60
3144

32-
## v0.3.2
45+
## 0.3.2
3346

3447
Corresponding updates for breaking changes introduced in ocaml-multicore/ocaml-multicore#704
3548

3649
* Updated with the new interface Domain.cpu_relax
3750
* Domain.timer_ticks replaced with Mirage clock.
3851

39-
## v0.3.1
52+
## 0.3.1
4053

4154
* #45 adds support for named pools. This is a breaking change with setup_pool taking an optional name parameter and an extra unit parameter.
4255
* A minor bug fix in parallel_for_reduce.
4356

44-
## v0.3.0
57+
## 0.3.0
4558

4659
This release includes:
4760

@@ -51,25 +64,25 @@ This release includes:
5164
* A move to using the Mutex & Condition modules for the implementation of Chan #24.
5265
* Various documentation and packaging improvements (#21, #27, #30, #32).
5366

54-
## v0.2.2
67+
## 0.2.2
5568

5669
Updates to:
5770

5871
* parallel_for to use new task distribution algorithm and allow default chunk_size (#16)
5972
* parallel_for_reduce to use new task distribution algorithm and allow default chunk_size parameter (#18)
6073

61-
## v0.2.1
74+
## 0.2.1
6275

6376
* `recv_poll` made non-allocating
6477
* Addition of parallel_scan #5
6578

66-
## v0.2.0
79+
## 0.2.0
6780

6881
* New Tasks library with support for async/await parallelism and parallel for loops.
6982
* Adds support for non-blocking Chan.send_poll and Chan.recv_poll.
7083

7184
Thanks to @gasche for API design discussions.
7285

73-
## v0.1.0
86+
## 0.1.0
7487

7588
Initial release

CODE_OF_CONDUCT.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Code of Conduct
2+
3+
This project has adopted the [OCaml Code of Conduct](https://github.com/ocaml/code-of-conduct/blob/main/CODE_OF_CONDUCT.md).
4+
5+
# Enforcement
6+
7+
This project follows the OCaml Code of Conduct
8+
[enforcement policy](https://github.com/ocaml/code-of-conduct/blob/main/CODE_OF_CONDUCT.md#enforcement).
9+
10+
To report any violations, please contact:
11+
12+
* KC Sivaramakrishnan <kc [at] tarides [dot] com>
13+
* Sudha Parimala <sudha [at] tarides [dot] com>
14+
* Vesa Karvonen <vesa [at] tarides [dot] com>

domainslib.opam

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
opam-version: "2.0"
33
synopsis: "Parallel Structures over Domains for Multicore OCaml"
44
maintainer: ["KC Sivaramakrishnan <kc@kcsrk.info>"]
5-
authors: ["KC Sivaramakrishnan <kc@kcsrk.info>"]
5+
authors: ["KC Sivaramakrishnan <kc@kcsrk.info>" "Sudha Parimala"]
66
license: "ISC"
77
homepage: "https://github.com/ocaml-multicore/domainslib"
88
doc: "https://kayceesrk.github.io/domainslib/doc"
99
bug-reports: "https://github.com/ocaml-multicore/domainslib/issues"
1010
depends: [
1111
"dune" {>= "3.0"}
1212
"ocaml" {>= "5.0"}
13-
"lockfree" {>= "0.2.0"}
13+
"lockfree" {>= "0.3.1"}
1414
"domain-local-await" {>= "0.1.0"}
1515
"kcas" {>= "0.3.0" & with-test}
1616
"mirage-clock-unix" {with-test & >= "4.2.0"}

test/dune

Lines changed: 34 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,140 +1,132 @@
11
(test
22
(name test_chan)
33
(libraries domainslib)
4-
(modules test_chan)
5-
(modes native))
4+
(modules test_chan))
65

76
(test
87
(name fib)
9-
(modules fib)
10-
(modes native))
8+
(modules fib))
119

1210
(test
1311
(name fib_par)
1412
(libraries domainslib)
15-
(modules fib_par)
16-
(modes native))
13+
(modules fib_par))
1714

1815
(test
1916
(name kcas_integration)
2017
(libraries domainslib kcas)
21-
(modules kcas_integration)
22-
(modes native))
18+
(modules kcas_integration))
2319

2420
(test
2521
(name enumerate_par)
2622
(libraries domainslib)
27-
(modules enumerate_par)
28-
(modes native))
23+
(modules enumerate_par))
2924

3025
(test
3126
(name game_of_life)
32-
(modules game_of_life)
33-
(modes native))
27+
(modules game_of_life))
3428

3529
(test
3630
(name game_of_life_multicore)
3731
(libraries domainslib)
38-
(modules game_of_life_multicore)
39-
(modes native))
32+
(modules game_of_life_multicore))
4033

4134
(test
4235
(name LU_decomposition_multicore)
4336
(libraries domainslib)
4437
(flags (:standard -runtime-variant d))
4538
(modules LU_decomposition_multicore)
46-
(modes native))
39+
(enabled_if (or (= %{arch_sixtyfour} true) (<> %{architecture} arm))))
40+
;; disabled temporarily on arm32 due to failure: ocaml/ocaml#12267
4741

4842

4943
(test
5044
(name spectralnorm2)
51-
(modules spectralnorm2)
52-
(modes native))
45+
(modules spectralnorm2))
5346

5447
(test
55-
(name sum_par)
56-
(libraries domainslib)
57-
(modules sum_par)
58-
(modes native))
48+
(name sum_par)
49+
(libraries domainslib)
50+
(modules sum_par))
5951

6052
(test
6153
(name task_throughput)
6254
(libraries domainslib mirage-clock-unix)
63-
(modules task_throughput)
64-
(modes native))
55+
(modules task_throughput))
6556

6657
(test
6758
(name spectralnorm2_multicore)
6859
(libraries domainslib)
69-
(modules spectralnorm2_multicore)
70-
(modes native))
60+
(modules spectralnorm2_multicore))
7161

7262
(test
7363
(name summed_area_table)
7464
(libraries domainslib)
75-
(modules summed_area_table)
76-
(modes native))
65+
(modules summed_area_table))
7766

7867
(test
7968
(name prefix_sum)
8069
(libraries domainslib unix)
81-
(modules prefix_sum)
82-
(modes native))
70+
(modules prefix_sum))
8371

8472
(test
8573
(name test_task)
8674
(libraries domainslib)
87-
(modules test_task)
88-
(modes native))
75+
(modules test_task))
8976

9077
(test
9178
(name test_parallel_find)
9279
(libraries domainslib)
93-
(modules test_parallel_find)
94-
(modes native))
80+
(modules test_parallel_find))
9581

9682
(test
9783
(name test_deadlock)
9884
(libraries domainslib)
99-
(modules test_deadlock)
100-
(modes native))
85+
(modules test_deadlock))
10186

10287
(test
10388
(name test_task_crash)
10489
(libraries domainslib)
105-
(modules test_task_crash)
106-
(modes native))
90+
(modules test_task_crash))
10791

10892
(test
10993
(name test_task_empty)
11094
(libraries domainslib)
111-
(modules test_task_empty)
112-
(modes native))
95+
(modules test_task_empty))
11396

11497
(test
11598
(name backtrace)
11699
(libraries domainslib)
117100
(modules backtrace)
118-
(modes native))
101+
(enabled_if (<> %{system} mingw64)) ;; triggers a known issue on mingw https://github.com/ocaml/ocaml/pull/12231
102+
(modes byte native))
103+
;; byte_complete .exes don't include debug+trace info https://github.com/ocaml/dune/issues/7845
104+
;; so on a bytecode switch/platform we build a plain bytecode version w/trace info
105+
;; and rename it to .exe
106+
(rule
107+
(target backtrace.exe)
108+
(action (copy backtrace.bc backtrace.exe))
109+
(enabled_if (and (= %{bin-available:ocamlopt} false) (<> %{system} mingw64))))
119110

120111
(test
121112
(name off_by_one)
122113
(libraries domainslib)
123-
(modules off_by_one)
124-
(modes native))
114+
(modules off_by_one))
125115

126116
;; Custom property-based tests using QCheck
127117

128118
(test
129119
(name task_one_dep)
130120
(modules task_one_dep)
131121
(libraries qcheck-multicoretests-util qcheck-core qcheck-core.runner domainslib)
122+
(enabled_if %{bin-available:ocamlopt}) ;; takes forever on bytecode
132123
(action (run %{test} --verbose)))
133124

134125
(test
135126
(name task_more_deps)
136127
(modules task_more_deps)
137128
(libraries qcheck-multicoretests-util qcheck-core qcheck-core.runner domainslib)
129+
(enabled_if %{bin-available:ocamlopt}) ;; takes forever on bytecode
138130
(action (run %{test} --verbose)))
139131

140132
(test

test/off_by_one.ml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,18 @@ let print_array a =
1010
let r = Array.init 20 (fun i -> i + 1)
1111

1212
let scan_task num_doms =
13-
let pool = Task.setup_pool ~num_domains:num_doms () in
14-
let a = Task.run pool (fun () -> Task.parallel_scan pool (+) (Array.make 20 1)) in
15-
Task.teardown_pool pool;
16-
Printf.printf "%i: %s\n%!" num_doms (print_array a);
17-
assert (a = r)
13+
try
14+
let pool = Task.setup_pool ~num_domains:num_doms () in
15+
let a = Task.run pool (fun () -> Task.parallel_scan pool (+) (Array.make 20 1)) in
16+
Task.teardown_pool pool;
17+
Printf.printf "%i: %s\n%!" num_doms (print_array a);
18+
assert (a = r)
19+
with Failure msg ->
20+
begin
21+
assert (msg = "failed to allocate domain");
22+
Printf.printf "Failed to allocate %i domains, recommended_domain_count: %i\n%!"
23+
num_doms (Domain.recommended_domain_count ());
24+
end
1825
;;
1926
for num_dom=0 to 21 do
2027
scan_task num_dom;

0 commit comments

Comments
 (0)