Skip to content
Snippets Groups Projects
Commit 624fd757 authored by Allan Blanchard's avatar Allan Blanchard
Browse files

[wp] -wp-par defaults to number of logical cores

parent 67234b4f
No related branches found
No related tags found
No related merge requests found
/**************************************************************************/
/* */
/* This file is part of Frama-C. */
/* */
/* Copyright (C) 2007-2024 */
/* CEA (Commissariat à l'énergie atomique et aux énergies */
/* alternatives) */
/* */
/* you can redistribute it and/or modify it under the terms of the GNU */
/* Lesser General Public License as published by the Free Software */
/* Foundation, version 2.1. */
/* */
/* It is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU Lesser General Public License for more details. */
/* */
/* See the GNU Lesser General Public License version 2.1 */
/* for more details (enclosed in the file licenses/LGPLv2.1). */
/* */
/**************************************************************************/
#include <caml/memory.h>
#include <caml/mlvalues.h>
#ifdef _WIN32
#include <windows.h>
#else
#include <unistd.h>
#endif
int cores(void) {
#ifdef WIN32
SYSTEM_INFO sysinfo;
GetSystemInfo(&sysinfo);
return sysinfo.dwNumberOfProcessors;
#else
return sysconf(_SC_NPROCESSORS_CONF);
#endif
}
CAMLprim value caml_cores(value unit) {
CAMLparam1(unit);
CAMLreturn(Val_int(cores()));
}
......@@ -44,6 +44,7 @@
(select wp_eva.ml from
(frama-c-eva.core -> wp_eva.enabled.ml)
( -> wp_eva.disabled.ml)))
(foreign_stubs (language c) (names cores))
(instrumentation (backend landmarks))
(instrumentation (backend bisect_ppx)))
......
......@@ -885,12 +885,14 @@ module TimeMargin =
(default: %s)." default
end)
external cores : unit -> int = "caml_cores"
let () = Parameter_customize.set_group wp_prover
module Procs =
Int(struct
let option_name = "-wp-par"
let arg_name = "p"
let default = 4
let default = cores ()
let help =
Printf.sprintf
"Number of parallel proof process (default: %d)" default
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment