mirror of
https://gitlab.com/scemama/QCaml.git
synced 2024-12-23 04:43:32 +01:00
24 lines
422 B
OCaml
24 lines
422 B
OCaml
let name = "QCaml"
|
|
|
|
let root =
|
|
let rec chop = function
|
|
| [] -> []
|
|
| x :: _ as l when x = name -> l
|
|
| _ :: rest -> chop rest
|
|
in
|
|
String.split_on_char Filename.dir_sep.[0] (Sys.getcwd ())
|
|
|> List.rev
|
|
|> chop
|
|
|> List.rev
|
|
|> String.concat Filename.dir_sep
|
|
|
|
|
|
let num_domains =
|
|
let result =
|
|
try
|
|
Unix.getenv "OMP_NUM_THREADS"
|
|
|> int_of_string
|
|
with Not_found -> 1
|
|
in
|
|
result - 1
|