You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
open Domainslib
let num_domains = try int_of_string Sys.argv.(1) with _ -> 4
let n = try int_of_string Sys.argv.(2) with _ -> 100
let a = Array.create_float n
let _ =
let pool = Task.setup_pool ~num_additional_domains:(num_domains - 1) () in
try Task.parallel_for pool ~start:0
~finish:(n - 1) ~body:(fun i -> Array.set a i (Random.float 1000.)) with e -> (Printexc.default_uncaught_exception_handler e (Printexc.get_raw_backtrace ()));
Task.teardown_pool pool
I am getting the following error when I try to run the above code with num_domains > 1.
hemen@hemen-VirtualBox:~/Desktop/multicore_ocaml_practice$ dune build ./float_init_par.ml
hemen@hemen-VirtualBox:~/Desktop/multicore_ocaml_practice$ OCAMLRUNPARAM=b ./_build/default/float_init_par.exe
Fatal error: exception Unhandled
Raised by primitive operation at Domainslib__Task.parallel_for.work in file "lib/task.ml", line 198, characters 6-26
Called from Domainslib__Task.parallel_for.work in file "lib/task.ml", line 198, characters 6-26
Called from Domainslib__Task.parallel_for.work in file "lib/task.ml", line 198, characters 6-26
Called from Dune__exe__Float_init_par in file "float_init_par.ml", line 9, characters 6-107
I am unable to resolve what caused the exception to be raised at Domainslib__Task.parallel_for.work
I am getting this issue when I set num_domains to be greater than 1 in every program that uses the parallel_for primitive.
I used ocamldebug to debug this , however the debugger crashes with a segmentation fault as shown below:
hemen@hemen-VirtualBox:~/Desktop/multicore_ocaml_practice$ dune build ./float_init_par.bc
hemen@hemen-VirtualBox:~/Desktop/multicore_ocaml_practice$ ocamldebug ./_build/default/float_init_par.bc
OCaml Debugger version 4.12.0+domains+effects
(ocd) r
Loading program... done.
Lost connection with process 14884 (active process)
at time 0
Trying to recover...
Segmentation fault (core dumped)
Kindly suggest how to resolve this.
The text was updated successfully, but these errors were encountered:
Thanks for reporting! This repo was a bit behind domainslib.0.4.0, I've fixed it in #12. The programs should now work with #12, please let me know otherwise.
Also, I'm afraid ocamldebug is currently not supported with Multicore. We recommend using gdb or rr for debugging Multicore OCaml programs.
I am getting the following error when I try to run the above code with
num_domains
> 1.After tracing the stack I got the following:
I am unable to resolve what caused the exception to be raised at
Domainslib__Task.parallel_for.work
I am getting this issue when I set
num_domains
to be greater than 1 in every program that uses theparallel_for
primitive.I used ocamldebug to debug this , however the debugger crashes with a segmentation fault as shown below:
Kindly suggest how to resolve this.
The text was updated successfully, but these errors were encountered: