[specs] remove sharding infra

Summary: Now that summaries are in the DB, this is dead code.

Reviewed By: jvillard

Differential Revision: D23154520

fbshipit-source-id: 1c1be2730
master
Nikos Gorogiannis 4 years ago committed by Facebook GitHub Bot
parent 7635bb0414
commit 12189f4c4e

@ -335,10 +335,6 @@ OPTIONS
Activates: Enable siof and disable all other checkers (Conversely: Activates: Enable siof and disable all other checkers (Conversely:
--no-siof-only) --no-siof-only)
--specs-shard-depth int
Specify the depth of the directory structure of specs, used for
"sharding" .specs files. Zero turns sharding off.
--sqlite-cache-size int --sqlite-cache-size int
SQLite cache size in pages (if positive) or kB (if negative), SQLite cache size in pages (if positive) or kB (if negative),
follows formal of corresponding SQLite PRAGMA. follows formal of corresponding SQLite PRAGMA.

@ -1104,10 +1104,6 @@ OPTIONS
Deactivates: print code excerpts around trace elements Deactivates: print code excerpts around trace elements
(Conversely: --source-preview) See also infer-explore(1). (Conversely: --source-preview) See also infer-explore(1).
--specs-shard-depth int
Specify the depth of the directory structure of specs, used for
"sharding" .specs files. Zero turns sharding off. See also infer-analyze(1) and infer-run(1).
--sqlite-cache-size int --sqlite-cache-size int
SQLite cache size in pages (if positive) or kB (if negative), SQLite cache size in pages (if positive) or kB (if negative),
follows formal of corresponding SQLite PRAGMA. See also infer-analyze(1), infer-capture(1), and infer-run(1). follows formal of corresponding SQLite PRAGMA. See also infer-analyze(1), infer-capture(1), and infer-run(1).

@ -133,10 +133,6 @@ OPTIONS
Ignore files whose path matches the given prefix (can be specified Ignore files whose path matches the given prefix (can be specified
multiple times) multiple times)
--specs-shard-depth int
Specify the depth of the directory structure of specs, used for
"sharding" .specs files. Zero turns sharding off.
--sqlite-cache-size int --sqlite-cache-size int
SQLite cache size in pages (if positive) or kB (if negative), SQLite cache size in pages (if positive) or kB (if negative),
follows formal of corresponding SQLite PRAGMA. follows formal of corresponding SQLite PRAGMA.

@ -1104,10 +1104,6 @@ OPTIONS
Deactivates: print code excerpts around trace elements Deactivates: print code excerpts around trace elements
(Conversely: --source-preview) See also infer-explore(1). (Conversely: --source-preview) See also infer-explore(1).
--specs-shard-depth int
Specify the depth of the directory structure of specs, used for
"sharding" .specs files. Zero turns sharding off. See also infer-analyze(1) and infer-run(1).
--sqlite-cache-size int --sqlite-cache-size int
SQLite cache size in pages (if positive) or kB (if negative), SQLite cache size in pages (if positive) or kB (if negative),
follows formal of corresponding SQLite PRAGMA. See also infer-analyze(1), infer-capture(1), and infer-run(1). follows formal of corresponding SQLite PRAGMA. See also infer-analyze(1), infer-capture(1), and infer-run(1).

@ -758,7 +758,7 @@ let get_qualifiers pname =
QualifiedCppName.empty QualifiedCppName.empty
let to_filename_and_crc pname = let to_filename pname =
(* filenames for clang procs are REVERSED qualifiers with '#' as separator *) (* filenames for clang procs are REVERSED qualifiers with '#' as separator *)
let pp_rev_qualified fmt pname = let pp_rev_qualified fmt pname =
let rev_qualifiers = get_qualifiers pname |> QualifiedCppName.to_rev_list in let rev_qualifiers = get_qualifiers pname |> QualifiedCppName.to_rev_list in
@ -776,12 +776,9 @@ let to_filename_and_crc pname =
| _ -> | _ ->
F.asprintf "%a" pp_unique_id pname F.asprintf "%a" pp_unique_id pname
in in
DB.append_crc_cutoff proc_id DB.append_crc_cutoff proc_id |> fst
(** Convert a proc name to a filename *)
let to_filename pname = to_filename_and_crc pname |> fst
module SQLite = struct module SQLite = struct
module T = struct module T = struct
type nonrec t = t [@@deriving compare] type nonrec t = t [@@deriving compare]

@ -341,9 +341,6 @@ val pp_unique_id : F.formatter -> t -> unit
val to_unique_id : t -> string val to_unique_id : t -> string
(** Convert a proc name into a unique identifier. *) (** Convert a proc name into a unique identifier. *)
val to_filename_and_crc : t -> string * string
(** Convert a proc name to a filename and crc. *)
val to_filename : t -> string val to_filename : t -> string
(** Convert a proc name to a filename. *) (** Convert a proc name to a filename. *)

@ -188,26 +188,15 @@ module OnDisk = struct
Procname.Hash.replace cache proc_name summary Procname.Hash.replace cache proc_name summary
let specs_filename_and_crc pname = let specs_filename pname =
let pname_file, crc = Procname.to_filename_and_crc pname in let pname_file = Procname.to_filename pname in
(pname_file ^ Config.specs_files_suffix, crc) pname_file ^ Config.specs_files_suffix
let specs_filename pname = specs_filename_and_crc pname |> fst
(** Return the path to the .specs file for the given procedure in the current results directory *) (** Return the path to the .specs file for the given procedure in the current results directory *)
let specs_filename_of_procname pname = let specs_filename_of_procname pname =
let filename, crc = specs_filename_and_crc pname in let filename = specs_filename pname in
let sharded_filename = DB.filename_from_string (ResultsDir.get_path Specs ^/ filename)
if Serialization.is_shard_mode then
let shard_dirs =
String.sub crc ~pos:0 ~len:Config.specs_shard_depth
|> String.concat_map ~sep:"/" ~f:Char.to_string
in
shard_dirs ^/ filename
else filename
in
DB.filename_from_string (ResultsDir.get_path Specs ^/ sharded_filename)
(** paths to the .specs file for the given procedure in the models folder *) (** paths to the .specs file for the given procedure in the models folder *)

@ -2172,13 +2172,6 @@ and starvation_whole_program =
"Run whole-program starvation analysis" "Run whole-program starvation analysis"
and specs_shard_depth =
CLOpt.mk_int ~long:"specs-shard-depth" ~default:0
~in_help:InferCommand.[(Analyze, manual_generic); (Run, manual_generic)]
"Specify the depth of the directory structure of specs, used for \"sharding\" .specs files. \
Zero turns sharding off."
and sqlite_cache_size = and sqlite_cache_size =
CLOpt.mk_int ~long:"sqlite-cache-size" ~default:2000 CLOpt.mk_int ~long:"sqlite-cache-size" ~default:2000
~in_help: ~in_help:
@ -3112,12 +3105,6 @@ and sources = !sources
and sourcepath = !sourcepath and sourcepath = !sourcepath
and specs_shard_depth =
if 0 <= !specs_shard_depth && !specs_shard_depth <= 32 then !specs_shard_depth
else
L.die UserError "Invalid number of shard depths %d: must be between 0 and 32" !specs_shard_depth
and sqlite_cache_size = !sqlite_cache_size and sqlite_cache_size = !sqlite_cache_size
and sqlite_page_size = !sqlite_page_size and sqlite_page_size = !sqlite_page_size

@ -551,8 +551,6 @@ val source_files_type_environment : bool
val source_preview : bool val source_preview : bool
val specs_shard_depth : int
val sqlite_cache_size : int val sqlite_cache_size : int
val sqlite_page_size : int val sqlite_page_size : int

@ -31,8 +31,6 @@ end
(** version of the binary files, to be incremented for each change *) (** version of the binary files, to be incremented for each change *)
let version = 27 let version = 27
let is_shard_mode = (not Config.biabduction_models_mode) && Config.specs_shard_depth > 0
let create_serializer (key : Key.t) : 'a serializer = let create_serializer (key : Key.t) : 'a serializer =
let read_data ((key' : int), (version' : int), (value : 'a)) source_msg = let read_data ((key' : int), (version' : int), (value : 'a)) source_msg =
if key.key <> key' then ( if key.key <> key' then (
@ -66,7 +64,6 @@ let create_serializer (key : Key.t) : 'a serializer =
let filename = DB.filename_to_string fname in let filename = DB.filename_to_string fname in
PerfEvent.( PerfEvent.(
log (fun logger -> log_begin_event logger ~name:("writing " ^ key.name) ~categories:["io"] ())) ; log (fun logger -> log_begin_event logger ~name:("writing " ^ key.name) ~categories:["io"] ())) ;
if is_shard_mode then Utils.create_dir (Filename.dirname filename) ;
Utils.with_intermediate_temp_file_out filename ~f:(fun outc -> Utils.with_intermediate_temp_file_out filename ~f:(fun outc ->
Marshal.to_channel outc (key.key, version, data) [] ) ; Marshal.to_channel outc (key.key, version, data) [] ) ;
PerfEvent.(log (fun logger -> log_end_event logger ())) PerfEvent.(log (fun logger -> log_end_event logger ()))

@ -27,9 +27,6 @@ end
(** Generic serializer *) (** Generic serializer *)
type 'a serializer type 'a serializer
val is_shard_mode : bool
(** If the spec directory is sharded or not *)
val create_serializer : Key.t -> 'a serializer val create_serializer : Key.t -> 'a serializer
(** create a serializer from a file name given an integer key used as double-check of the file type *) (** create a serializer from a file name given an integer key used as double-check of the file type *)

Loading…
Cancel
Save