Skip to content

Add multidomain config option & CI jobs #3947

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ jobs:
config: --enable-middle-end=flambda2 --enable-runtime5
os: ubuntu-latest

- name: flambda2_stack_checks
config: --enable-middle-end=flambda2 --enable-runtime5 --enable-stack-checks
os: ubuntu-latest

- name: flambda2_poll_insertion
config: --enable-middle-end=flambda2 --enable-runtime5 --enable-poll-insertion
os: ubuntu-latest

- name: flambda2_multidomain
config: --enable-middle-end=flambda2 --enable-runtime5 --enable-stack-checks --enable-poll-insertion --enable-multidomain
os: ubuntu-latest

- name: flambda2_dev
config: --enable-middle-end=flambda2 --enable-dev
os: ubuntu-latest
Expand Down
15 changes: 14 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ AS_IF([test x"$enable_runtime5" = xyes],
[runtime_suffix=4])

AC_ARG_ENABLE([stack_checks],
[AS_HELP_STRING([--enable-stack_checks],
[AS_HELP_STRING([--enable-stack-checks],
[Enable stack checks])])

## Output variables
Expand Down Expand Up @@ -361,6 +361,7 @@ AC_SUBST([compute_deps])
AC_SUBST([intel_jcc_bug_cflags])
AC_SUBST([stack_allocation])
AC_SUBST([poll_insertion])
AC_SUBST([enable_multidomain])
AC_SUBST([dune])
AC_SUBST([ocaml_bindir])
AC_SUBST([ocaml_libdir])
Expand Down Expand Up @@ -701,6 +702,10 @@ AC_ARG_ENABLE([poll-insertion],
[AS_HELP_STRING([--enable-poll-insertion],
[enable insertion of poll points])])

AC_ARG_ENABLE([multidomain],
[AS_HELP_STRING([--enable-multidomain],
[allow the creation of multiple domains])])

AC_ARG_WITH([flexdll],
[AS_HELP_STRING([--with-flexdll],
[bootstrap FlexDLL from the given sources])],
Expand Down Expand Up @@ -2835,6 +2840,14 @@ AS_IF([test x"$enable_poll_insertion" = "xyes"],
poll_insertion=true],
[poll_insertion=false])

AS_IF([test x"$enable_multidomain" = "xyes"],
[AS_IF([test x"$enable_runtime5" = "xyes" &&
test x"$enable_stack_checks" = "xyes" &&
test x"$enable_poll_insertion" = "xyes"],
[AC_DEFINE([MULTIDOMAIN]), enable_multidomain=true],
[AC_MSG_ERROR([Creating multiple domains is only supported on runtime5 with \
stack checks and poll insertion enabled.])])], [])

oc_cflags="$common_cflags $internal_cflags"
oc_cppflags="$common_cppflags $internal_cppflags"
ocamlc_cflags="$ocamlc_cflags $common_cflags $sharedlib_cflags $CFLAGS"
Expand Down
9 changes: 9 additions & 0 deletions ocamltest/ocaml_actions.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1360,6 +1360,14 @@ let no_poll_insertion = Actions.make
"Poll insertion disabled"
"Poll insertion enabled")

let multidomain = Actions.make
~name:"multidomain"
~description:"Passes if multiple domains is enabled"
~does_something:false
(Actions_helpers.predicate Config.multidomain
"Multidomain disabled"
"Multidomain enabled")

let runtime4 = Actions.make
~name:"runtime4"
~description:"Passes if the OCaml 4.x runtime is being used"
Expand Down Expand Up @@ -1591,6 +1599,7 @@ let init () =
codegen;
cc;
ocamlobjinfo;
multidomain;
runtime4;
runtime5
]
6 changes: 5 additions & 1 deletion runtime/caml/domain.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,19 @@ extern "C" {
#include "mlvalues.h"
#include "domain_state.h"

#ifdef MULTIDOMAIN
#ifdef ARCH_SIXTYFOUR
#define Max_domains_def 128
#else
#define Max_domains_def 16
#endif

/* Upper limit for the number of domains. Chosen to be arbitrarily large. Used
* for sanity checking [max_domains] value in OCAMLRUNPARAM. */
#define Max_domains_max 4096
#else
#define Max_domains_def 1
#define Max_domains_max 1
#endif

/* is the minor heap full or an external interrupt has been triggered */
Caml_inline int caml_check_gc_interrupt(caml_domain_state * dom_st)
Expand Down
2 changes: 2 additions & 0 deletions runtime/caml/m.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,5 @@
#undef STACK_ALLOCATION

#undef STACK_CHECKS_ENABLED

#undef MULTIDOMAIN
1 change: 1 addition & 0 deletions testsuite/tests/capsule-api/condition.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
include stdlib_alpha;
flags = "-extension-universe alpha -alert -unsafe_multidomain";
runtime5;
multidomain;
{ bytecode; }
{ native; }
*)
Expand Down
1 change: 1 addition & 0 deletions testsuite/tests/compaction/test_compact_manydomains.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(* TEST
flags += "-alert -unsafe_parallelism -alert -unsafe_multidomain";
runtime5;
multidomain;
{ bytecode; }
{ native; }
*)
Expand Down
1 change: 1 addition & 0 deletions testsuite/tests/compaction/test_compact_multi.ml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
skip;
}{
runtime5;
multidomain;
{ bytecode; }
{ native; }
}
Expand Down
1 change: 1 addition & 0 deletions testsuite/tests/effects-api/portable.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(* TEST
include stdlib_alpha;
runtime5;
multidomain;
{ bytecode; }
{ native; }
*)
Expand Down
1 change: 1 addition & 0 deletions testsuite/tests/effects/test_lazy.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
(* TEST
runtime5;
multidomain;
{ bytecode; }
{ native; }
*)
Expand Down
1 change: 1 addition & 0 deletions testsuite/tests/lazy/lazy2.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
flags += "-alert -unsafe_parallelism -alert -unsafe_multidomain";
ocamlopt_flags += " -O3 ";
runtime5;
multidomain;
{ bytecode; }
{ native; }
*)
Expand Down
1 change: 1 addition & 0 deletions testsuite/tests/lazy/lazy3.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
flags += "-alert -unsafe_parallelism -alert -unsafe_multidomain";
ocamlopt_flags += " -O3 ";
runtime5;
multidomain;
{ bytecode; }
{ native; }
*)
Expand Down
1 change: 1 addition & 0 deletions testsuite/tests/lazy/lazy5.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
flags += "-alert -unsafe_parallelism -alert -unsafe_multidomain";
ocamlopt_flags += " -O3 ";
runtime5;
multidomain;
{ bytecode; }
{ native; }
*)
Expand Down
1 change: 1 addition & 0 deletions testsuite/tests/lazy/lazy6.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
flags += "-alert -unsafe_parallelism -alert -unsafe_multidomain";
ocamlopt_flags += " -O3 ";
runtime5;
multidomain;
{ bytecode; }
{ native; }
*)
Expand Down
1 change: 1 addition & 0 deletions testsuite/tests/lazy/lazy7.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
flags += "-alert -unsafe_parallelism -alert -unsafe_multidomain";
ocamlopt_flags += " -O3 ";
runtime5;
multidomain;
{ bytecode; }
{ native; }
*)
Expand Down
1 change: 1 addition & 0 deletions testsuite/tests/lazy/lazy8.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
flags += "-alert -unsafe_parallelism -alert -unsafe_multidomain";
ocamlopt_flags += " -O3 ";
runtime5;
multidomain;
{ bytecode; }
{ native; }
*)
Expand Down
1 change: 1 addition & 0 deletions testsuite/tests/lf_skiplist/test_parallel.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
modules = "stubs.c";
no-tsan;
runtime5;
multidomain;
{ bytecode; }
{ native; }
*)
Expand Down
1 change: 1 addition & 0 deletions testsuite/tests/lib-atomic/test_atomic_domain.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(* TEST
flags = "-alert -unsafe_multidomain";
runtime5;
multidomain;
native;
bytecode;
*)
Expand Down
1 change: 1 addition & 0 deletions testsuite/tests/lib-channels/refcounting.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(* TEST
flags += "-alert -unsafe_parallelism -alert -unsafe_multidomain";
runtime5;
multidomain;
expect;
*)

Expand Down
1 change: 1 addition & 0 deletions testsuite/tests/lib-dynlink-domains/main.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
(* TEST
runtime5;
multidomain;
include dynlink;
libraries = "";
readonly_files = "store.ml main.ml Plugin_0.ml Plugin_0_0.ml Plugin_0_0_0.ml Plugin_0_0_0_0.ml Plugin_0_0_0_1.ml Plugin_0_0_0_2.ml Plugin_1.ml Plugin_1_0.ml Plugin_1_0_0.ml Plugin_1_0_0_0.ml Plugin_1_1.ml Plugin_1_2.ml Plugin_1_2_0.ml Plugin_1_2_0_0.ml Plugin_1_2_1.ml Plugin_1_2_2.ml Plugin_1_2_2_0.ml Plugin_1_2_3.ml Plugin_1_2_3_0.ml";
Expand Down
1 change: 1 addition & 0 deletions testsuite/tests/lib-format/domains.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(* TEST
flags += "-alert -unsafe_parallelism -alert -unsafe_multidomain";
runtime5;
multidomain;
{ bytecode; }
{ native; }
*)
Expand Down
1 change: 1 addition & 0 deletions testsuite/tests/lib-format/mc_pr586_par.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(* TEST
flags += "-alert -unsafe_parallelism -alert -unsafe_multidomain";
runtime5;
multidomain;
{ bytecode; }
{ native; }
*)
Expand Down
1 change: 1 addition & 0 deletions testsuite/tests/lib-format/mc_pr586_par2.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(* TEST
flags += "-alert -unsafe_parallelism -alert -unsafe_multidomain";
runtime5;
multidomain;
{ bytecode; }
{ native; }
*)
Expand Down
1 change: 1 addition & 0 deletions testsuite/tests/lib-marshal/intext_par.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
modules = "intextaux_par.c";
no-tsan;
runtime5;
multidomain;
{ bytecode; }
{ native; }
*)
Expand Down
1 change: 1 addition & 0 deletions testsuite/tests/lib-random/parallel.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
flags += "-alert -unsafe_parallelism -alert -unsafe_multidomain";
include unix;
runtime5;
multidomain;
libunix;
{
bytecode;
Expand Down
1 change: 1 addition & 0 deletions testsuite/tests/lib-runtime-events/test_caml_parallel.ml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
}{
include runtime_events;
runtime5;
multidomain;
flags += "-alert -unsafe_parallelism -alert -unsafe_multidomain";
{ bytecode; }
{ native; }
Expand Down
1 change: 1 addition & 0 deletions testsuite/tests/lib-runtime-events/test_caml_slot_reuse.ml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
}{
include runtime_events;
runtime5;
multidomain;
flags += "-alert -unsafe_parallelism -alert -unsafe_multidomain";
{ bytecode; }
{ native; }
Expand Down
1 change: 1 addition & 0 deletions testsuite/tests/lib-runtime-events/test_dropped_events.ml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
}{
include runtime_events;
runtime5;
multidomain;
flags += "-alert -unsafe_parallelism -alert -unsafe_multidomain";
include unix;
set OCAMLRUNPARAM = "e=6";
Expand Down
1 change: 1 addition & 0 deletions testsuite/tests/lib-str/parallel.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(* TEST
flags += "-alert -unsafe_parallelism -alert -unsafe_multidomain";
runtime5;
multidomain;
include str;
hasstr;
{
Expand Down
1 change: 1 addition & 0 deletions testsuite/tests/lib-sync/prodcons.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(* TEST
flags += "-alert -unsafe_parallelism -alert -unsafe_multidomain";
runtime5;
multidomain;
{ bytecode; }
{ native; }
*)
Expand Down
1 change: 1 addition & 0 deletions testsuite/tests/lib-systhreads/multicore_lifecycle.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
include systhreads;
hassysthreads;
runtime5;
multidomain;
{
bytecode;
}{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(* TEST
flags += "-alert -unsafe_parallelism -alert -unsafe_multidomain";
runtime5;
multidomain;
include unix;
hasunix;
not-windows;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(* TEST
flags += "-alert -unsafe_parallelism -alert -unsafe_multidomain";
runtime5;
multidomain;
include unix;
hasunix;
not-windows;
Expand Down
1 change: 1 addition & 0 deletions testsuite/tests/memory-model/forbidden.ml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
not-bsd;
no-tsan; (* tsan detects the intentional data races and fails *)
runtime5;
multidomain;
{
bytecode;
}{
Expand Down
1 change: 1 addition & 0 deletions testsuite/tests/memory-model/publish.ml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
not-bsd;
no-tsan; (* tsan detects data races and fails *)
runtime5;
multidomain;
{
not-windows;
bytecode;
Expand Down
1 change: 1 addition & 0 deletions testsuite/tests/parallel/atomics.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(* TEST
flags += "-alert -unsafe_parallelism -alert -unsafe_multidomain";
runtime5;
multidomain;
{ bytecode; }
{ native; }
*)
Expand Down
1 change: 1 addition & 0 deletions testsuite/tests/parallel/backup_thread.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(* TEST
flags += "-alert -unsafe_parallelism -alert -unsafe_multidomain";
runtime5;
multidomain;
include unix;
hasunix;
{
Expand Down
1 change: 1 addition & 0 deletions testsuite/tests/parallel/backup_thread_pipe.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(* TEST
flags += "-alert -unsafe_parallelism -alert -unsafe_multidomain";
runtime5;
multidomain;
include unix;
hasunix;
{
Expand Down
1 change: 1 addition & 0 deletions testsuite/tests/parallel/catch_break.ml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ not-windows;
poll-insertion;
no-tsan;
runtime5;
multidomain;
{
bytecode;
}{
Expand Down
1 change: 1 addition & 0 deletions testsuite/tests/parallel/churn.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(* TEST
flags += "-alert -unsafe_parallelism -alert -unsafe_multidomain";
runtime5;
multidomain;
{ bytecode; }
{ native; }
*)
Expand Down
1 change: 1 addition & 0 deletions testsuite/tests/parallel/constpromote.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(* TEST
flags += "-alert -unsafe_parallelism -alert -unsafe_multidomain";
runtime5;
multidomain;
{ bytecode; }
{ native; }
*)
Expand Down
Loading
Loading