Rename TaskScheduler module as FileScheduler

Reviewed By: ngorogiannis

Differential Revision: D19328005

fbshipit-source-id: b8a1e3e67
master
Fernando Gasperi Jabalera 5 years ago committed by Facebook Github Bot
parent 4371a2c2f0
commit 3cb287bc63

@ -6,7 +6,7 @@
*)
open! IStd
let of_sources sources =
let make sources =
let open SchedulerTypes in
let gen =
List.rev_map sources ~f:(fun sf -> File sf)
@ -18,9 +18,3 @@ let of_sources sources =
match res with None -> None | Some (Procname _) -> assert false | Some (File _) as v -> v
in
{gen with next}
let schedule sources =
if Config.call_graph_schedule then
ProcessPool.TaskGenerator.chain (SyntacticCallGraph.bottom_up sources) (of_sources sources)
else of_sources sources

@ -6,4 +6,4 @@
*)
open! IStd
val schedule : SourceFile.t list -> SchedulerTypes.target ProcessPool.TaskGenerator.t
val make : SourceFile.t list -> SchedulerTypes.target ProcessPool.TaskGenerator.t

@ -112,6 +112,14 @@ let get_source_files_to_analyze ~changed_files =
source_files_to_analyze
let schedule sources =
if Config.call_graph_schedule then
ProcessPool.TaskGenerator.chain
(SyntacticCallGraph.bottom_up sources)
(FileScheduler.make sources)
else FileScheduler.make sources
let analyze source_files_to_analyze =
if Int.equal Config.jobs 1 then (
let target_files = List.rev_map source_files_to_analyze ~f:(fun sf -> SchedulerTypes.File sf) in
@ -119,7 +127,7 @@ let analyze source_files_to_analyze =
BackendStats.get () )
else (
L.environment_info "Parallel jobs: %d@." Config.jobs ;
let tasks = TaskScheduler.schedule source_files_to_analyze in
let tasks = schedule source_files_to_analyze in
(* Prepare tasks one cluster at a time while executing in parallel *)
let runner =
Tasks.Runner.create ~jobs:Config.jobs ~f:analyze_target ~child_epilogue:BackendStats.get

Loading…
Cancel
Save