src/Pure/Tools/build.scala
changeset 51230 19192615911e
parent 51229 6e40d0bb89e3
child 51244 d8ca566b22b3
equal deleted inserted replaced
51229:6e40d0bb89e3 51230:19192615911e
   286 
   286 
   287   /* queue */
   287   /* queue */
   288 
   288 
   289   object Queue
   289   object Queue
   290   {
   290   {
   291     def apply(tree: Session_Tree, get_timings: String => (List[Properties.T], Double)): Queue =
   291     def apply(tree: Session_Tree, load_timings: String => (List[Properties.T], Double)): Queue =
   292     {
   292     {
   293       val graph = tree.graph
   293       val graph = tree.graph
   294       val sessions = graph.keys.toList
   294       val sessions = graph.keys.toList
   295 
   295 
   296       val timings = sessions.map(name => (name, get_timings(name)))
   296       val timings = sessions.map((name: String) =>
       
   297         if (tree(name).options.bool("parallel_proofs_reuse_timing")) (name, load_timings(name))
       
   298         else (name, (Nil, 0.0)))
   297       val command_timings =
   299       val command_timings =
   298         Map(timings.map({ case (name, (ts, _)) => (name, ts) }): _*).withDefaultValue(Nil)
   300         Map(timings.map({ case (name, (ts, _)) => (name, ts) }): _*).withDefaultValue(Nil)
   299       val session_timing =
   301       val session_timing =
   300         Map(timings.map({ case (name, (_, t)) => (name, t) }): _*).withDefaultValue(0.0)
   302         Map(timings.map({ case (name, (_, t)) => (name, t) }): _*).withDefaultValue(0.0)
   301 
   303 
   678       input_dirs.find(dir => (dir + log(name)).is_file).map(dir => (dir, dir + log(name)))
   680       input_dirs.find(dir => (dir + log(name)).is_file).map(dir => (dir, dir + log(name)))
   679 
   681 
   680 
   682 
   681     /* queue with scheduling information */
   683     /* queue with scheduling information */
   682 
   684 
   683     def get_timing(name: String): (List[Properties.T], Double) =
   685     def load_timings(name: String): (List[Properties.T], Double) =
   684     {
   686     {
   685       val (path, text) =
   687       val (path, text) =
   686         find_log(name + ".gz") match {
   688         find_log(name + ".gz") match {
   687           case Some((_, path)) => (path, File.read_gzip(path))
   689           case Some((_, path)) => (path, File.read_gzip(path))
   688           case None =>
   690           case None =>
   701           java.lang.System.err.println("### Ignoring bad log file: " + path + "\n" + msg)
   703           java.lang.System.err.println("### Ignoring bad log file: " + path + "\n" + msg)
   702         (Nil, 0.0)
   704         (Nil, 0.0)
   703       }
   705       }
   704     }
   706     }
   705 
   707 
   706     val queue = Queue(selected_tree, get_timing)
   708     val queue = Queue(selected_tree, load_timings)
   707 
   709 
   708 
   710 
   709     /* main build process */
   711     /* main build process */
   710 
   712 
   711     // prepare log dir
   713     // prepare log dir