src/Pure/Tools/build_process.scala
changeset 78842 eb572f7b6689
parent 78841 7f61688d4e8d
child 78844 c7f436a63108
equal deleted inserted replaced
78841:7f61688d4e8d 78842:eb572f7b6689
   982         .take(limit).map(_.name)
   982         .take(limit).map(_.name)
   983     }
   983     }
   984     else Nil
   984     else Nil
   985   }
   985   }
   986 
   986 
       
   987   protected def next_node_info(state: Build_Process.State, session_name: String): Host.Node_Info = {
       
   988     def used_nodes: Set[Int] =
       
   989       Set.from(for (job <- state.running.valuesIterator; i <- job.node_info.numa_node) yield i)
       
   990     val numa_node =
       
   991       for {
       
   992         db <- _host_database
       
   993         n <- Host.next_numa_node(db, hostname, state.numa_nodes, used_nodes)
       
   994       } yield n
       
   995     Host.Node_Info(hostname, numa_node, Nil)
       
   996   }
       
   997 
   987   protected def start_session(
   998   protected def start_session(
   988     state: Build_Process.State,
   999     state: Build_Process.State,
   989     session_name: String,
  1000     session_name: String,
   990     ancestor_results: List[Build_Process.Result]
  1001     ancestor_results: List[Build_Process.Result]
   991   ): Build_Process.State = {
  1002   ): Build_Process.State = {
  1037           .make_result(result_name, Process_Result.undefined, output_shasum)
  1048           .make_result(result_name, Process_Result.undefined, output_shasum)
  1038       }
  1049       }
  1039       else state
  1050       else state
  1040     }
  1051     }
  1041     else {
  1052     else {
  1042       def used_nodes: Set[Int] =
  1053       val node_info = next_node_info(state, session_name)
  1043         Set.from(for (job <- state.running.valuesIterator; i <- job.node_info.numa_node) yield i)
       
  1044       val numa_node =
       
  1045         for {
       
  1046           db <- _host_database
       
  1047           n <- Host.next_numa_node(db, hostname, state.numa_nodes, used_nodes)
       
  1048         } yield n
       
  1049       val node_info = Host.Node_Info(hostname, numa_node, Nil)
       
  1050 
  1054 
  1051       val print_node_info =
  1055       val print_node_info =
  1052         node_info.numa_node.isDefined || node_info.rel_cpus.nonEmpty  ||
  1056         node_info.numa_node.isDefined || node_info.rel_cpus.nonEmpty  ||
  1053         _build_database.isDefined && _build_database.get.is_postgresql
  1057         _build_database.isDefined && _build_database.get.is_postgresql
  1054 
  1058