Skip to content

Commit e134fca

Browse files
authored
Merge pull request #1708 from arkocal/parallelism_backwards_compat_1
Introduce backwards compatible infrastructure for parallelism
2 parents 9cfaf49 + 57b2e21 commit e134fca

26 files changed

+297
-72
lines changed

.github/workflows/locked.yml

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -105,55 +105,3 @@ jobs:
105105

106106
- name: Test extraction
107107
run: opam exec -- dune runtest tests/extraction
108-
109-
110-
gobview:
111-
strategy:
112-
fail-fast: false
113-
matrix:
114-
os:
115-
- ubuntu-22.04 # https://github.com/ocaml/setup-ocaml/issues/872
116-
ocaml-compiler:
117-
- ocaml-variants.4.14.2+options,ocaml-option-flambda # matches opam lock file
118-
# don't add any other because they won't be used
119-
node-version:
120-
- 14
121-
122-
runs-on: ${{ matrix.os }}
123-
124-
steps:
125-
- name: Checkout code
126-
uses: actions/checkout@v4
127-
128-
- name: Set up OCaml ${{ matrix.ocaml-compiler }}
129-
env:
130-
# otherwise setup-ocaml pins non-locked dependencies
131-
# https://github.com/ocaml/setup-ocaml/issues/166
132-
OPAMLOCKED: locked
133-
uses: ocaml/setup-ocaml@v3
134-
with:
135-
ocaml-compiler: ${{ matrix.ocaml-compiler }}
136-
137-
- name: Set up Node.js ${{ matrix.node-version }}
138-
uses: actions/setup-node@v4
139-
with:
140-
node-version: ${{ matrix.node-version }}
141-
142-
- name: Install dependencies
143-
run: opam install . --deps-only --locked
144-
145-
- name: Setup Gobview
146-
run: ./make.sh setup_gobview
147-
148-
- name: Build
149-
run: ./make.sh nat
150-
151-
- name: Build Gobview
152-
run: ./make.sh view
153-
154-
- name: Install selenium
155-
run: pip3 install selenium webdriver-manager
156-
157-
- name: Test Gobview
158-
run: |
159-
python3 scripts/test-gobview.py

.github/workflows/unlocked.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,3 +251,49 @@ jobs:
251251

252252
- name: Test incremental regression with cfg comparison
253253
run: ruby scripts/update_suite.rb -c
254+
255+
gobview:
256+
strategy:
257+
fail-fast: false
258+
matrix:
259+
os:
260+
- ubuntu-22.04 # https://github.com/ocaml/setup-ocaml/issues/872
261+
ocaml-compiler:
262+
- ocaml-variants.5.0.0+options,ocaml-option-flambda
263+
node-version:
264+
- 14
265+
266+
runs-on: ${{ matrix.os }}
267+
268+
steps:
269+
- name: Checkout code
270+
uses: actions/checkout@v4
271+
272+
- name: Set up OCaml ${{ matrix.ocaml-compiler }}
273+
uses: ocaml/setup-ocaml@v3
274+
with:
275+
ocaml-compiler: ${{ matrix.ocaml-compiler }}
276+
277+
- name: Set up Node.js ${{ matrix.node-version }}
278+
uses: actions/setup-node@v4
279+
with:
280+
node-version: ${{ matrix.node-version }}
281+
282+
- name: Install dependencies
283+
run: opam install . --deps-only
284+
285+
- name: Setup Gobview
286+
run: ./make.sh setup_gobview
287+
288+
- name: Build
289+
run: ./make.sh nat
290+
291+
- name: Build Gobview
292+
run: ./make.sh view
293+
294+
- name: Install selenium
295+
run: pip3 install selenium webdriver-manager
296+
297+
- name: Test Gobview
298+
run: |
299+
python3 scripts/test-gobview.py

docs/user-guide/inspecting.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Modern browsers' security settings forbid some file access which is necessary fo
1111

1212
## GobView
1313

14+
**Note:** GobView is not compatible with OCaml 4 any more. Use OCaml 5.0.0 or newer.
15+
1416
For the initial setup:
1517

1618
1. Install Node.js (preferably ≥ 12.0.0) and npm (≥ 5.2.0)

dune-project

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,12 @@ Goblint includes analyses for assertions, overflows, deadlocks, etc and can be e
6767
(conf-ruby :with-test)
6868
(benchmark :with-test) ; TODO: make this optional somehow, (optional) on bench executable doesn't work
6969
conf-gcc ; ensures opam-repository CI installs real gcc from homebrew on MacOS
70+
domain-local-await
71+
domain-shims
7072
)
7173
(depopts
7274
(apron (>= v0.9.15))
75+
domainslib
7376
z3
7477
)
7578
(conflicts

goblint.opam

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,13 @@ depends: [
6767
"conf-ruby" {with-test}
6868
"benchmark" {with-test}
6969
"conf-gcc"
70+
"domain-local-await"
71+
"domain_shims"
7072
]
7173
depopts: [
7274
"apron" {>= "v0.9.15"}
7375
"z3"
76+
"domainslib"
7477
]
7578
conflicts: [
7679
"result" {< "1.5"}

goblint.opam.locked

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ depends: [
5454
"csexp" {= "1.5.2"}
5555
"cstruct" {= "6.2.0"}
5656
"ctypes" {= "0.22.0"}
57+
"domain-local-await" {= "1.0.1"}
58+
"domain_shims" {= "0.1.0"}
5759
"dune" {= "3.16.0"}
5860
"dune-build-info" {= "3.16.0"}
5961
"dune-configurator" {= "3.16.0"}

scripts/goblint-lib-modules.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@
4242
"Goblint_build_info",
4343
"Dune_build_info",
4444

45+
# mocked parallelism: These files are called differently
46+
# (x.domainslib.ml or x.no-domainslib.ml) and therefore not recognized
47+
# by the script
48+
"GobMutex",
49+
"Threadpool",
50+
"DomainsafeLazy",
51+
4552
# ppx-s
4653
"Ppx_deriving_printable",
4754
"Ppx_deriving_lattice",

src/cdomain/value/cdomains/mutexAttrDomain.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
(** Mutex attribute type domain. *)
2+
open Goblint_parallel
23

34
module MutexKind =
45
struct
@@ -21,7 +22,7 @@ end
2122
include Lattice.FlatConf (struct include Printable.DefaultConf let bot_name = "Uninitialized" let top_name = "Top" end) (MutexKind)
2223

2324
(* Needed because OS X is weird and assigns different constants than normal systems... :( *)
24-
let recursive_int = lazy (
25+
let recursive_int = DomainsafeLazy.from_fun (fun () ->
2526
let res = ref (Z.of_int 2) in (* Use OS X as the default, it doesn't have the enum *)
2627
GoblintCil.iterGlobals !Cilfacade.current_file (function
2728
| GEnumTag (einfo, _) ->
@@ -39,7 +40,7 @@ let of_int z =
3940
if Z.equal z Z.zero then
4041
`Lifted MutexKind.NonRec
4142
else
42-
let recursive_int = Lazy.force recursive_int in
43+
let recursive_int = DomainsafeLazy.force recursive_int in
4344
if Z.equal z recursive_int then
4445
`Lifted MutexKind.Recursive
4546
else

src/cdomain/value/dune

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
goblint_library
1414
goblint_domain
1515
goblint_incremental
16+
goblint_parallel
1617
goblint-cil)
1718
(flags :standard -open Goblint_std -open Goblint_logs)
1819
(preprocess

src/config/options.schema.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2640,6 +2640,12 @@
26402640
"description": "Check TD3 data structure invariants",
26412641
"type": "boolean",
26422642
"default": false
2643+
},
2644+
"parallel_domains" :{
2645+
"title": "solvers.td3.parallel_domains",
2646+
"description": "Maximal number of Domains that the solver can use in parallel. Only applies, when a solver of the 'td_parallel_*' family is used. If left at -1, the value of jobs will be used.",
2647+
"type": "integer",
2648+
"default": -1
26432649
}
26442650
},
26452651
"additionalProperties": false

0 commit comments

Comments
 (0)