2 from __future__
import print_function
3 import os,subprocess,sys,re,time,random
4 from threading
import *
5 from subprocess
import call
7 STATE_CREATED,STATE_COMPLETED,STATE_ERROR=range(3)
21 self.QueueList.QueueLock.acquire()
22 sSrv=self.QueueList.smallestQueue()
23 tSrv=self.QueueList.thinerQueue()
27 elif self.
Weight + self.
QueueList[sSrv].queueWeight() <= (self.QueueList.Cores/self.QueueList.Jay)*1.5:
32 self.QueueList.QueueLock.release()
37 rValue=call([
'ssh',self.
Queue,
'cd ~/CMSSW_3_5_7;scram build -j %d' % self.QueueList.Jay,self.BuildNode.LibName])
38 self.QueueList.EdmRefreshLock.acquire()
39 call([
'ssh',self.
Queue,
'cd ~/CMSSW_3_5_7;eval `scram runtime -sh`;EdmPluginRefresh %s' % self.BuildNode.LibName])
40 self.QueueList.EdmRefreshLock.release()
42 self.BuildNode.State=STATE_COMPLETED
44 print(
"Build failed for %s" % self.BuildNode.LibName)
45 self.BuildNode.State=STATE_ERROR
51 self.BuildNode.State=STATE_ERROR
52 self.IsComplete.acquire()
53 self.IsComplete.notifyAll()
54 self.IsComplete.release()
58 while not depsCompleted:
60 for deps
in self.BuildNode.DependsOn:
61 if deps.State
is STATE_ERROR :
64 if deps.State
is not STATE_COMPLETED :
66 deps.BThread.IsComplete.acquire()
67 deps.BThread.IsComplete.wait()
69 deps.BThread.IsComplete.release()
73 self.IsComplete.acquire()
74 self.IsComplete.notifyAll()
75 self.IsComplete.release()
85 list.__init__(self,value)
101 itP=it.AreDependent.findLib(lib,head)
108 if not node.BThread.is_alive():
113 node.AreDependent.startThreads()
116 return self.
findLib(dep.replace(
"/",
""))
119 if not value.__class__ == BuildTreeNode:
120 raise TypeError(
"Expected BuildTreeNode")
121 self.SeenLibs.append(value.LibName)
122 self.SeenModules.append(value.Module)
123 self.SeenSubModules.append(value.SubModule)
124 list.__setitem__(self,index,value)
127 if not value.__class__ == BuildTreeNode:
128 raise TypeError(
"Expected BuildTreeNode")
129 value.LibName
not in self.
SeenLibs and self.SeenLibs.append(value.LibName)
130 value.Module
not in self.
SeenModules and self.SeenModules.append(value.Module)
131 value.SubModule
not in self.
SeenSubModules and self.SeenSubModules.append(value.SubModule)
132 list.append(self,value)
134 def __str__(self,topDown=False,direction=False):
136 return "[\n...%s]" %
str(
"\n...".
join([
str(it).
replace(
"...",
"......")
for it
in self]))
139 return "[\n---%s]" %
"\n---".
join([
"'%s':'%s'\n------State = %d \n------DependsOn : %s " % (it.LibName,it.SubModule
or it.Module,it.State,it.DependsOn.__str__(
True,
True).
replace(
"---",
"------"))
for it
in self ])
141 return "\n".
join([it.__str__(
True)
for it
in self])
145 def __init__(self,libname="",module="",submodule="",depends=None,areDependent=None,weight=1,srvqueue=None):
150 if areDependent==
None:
161 if name
is "DependsOn" or name
is "AreDependent":
162 if not value.__class__ == BuildTreeNodeList:
163 raise TypeError(
"Expected BuildTreeNodeList")
164 elif name
is "State" or name
is "ModulesToDo":
165 if not value.__class__ == int:
166 raise TypeError(
"Expected int")
167 elif name
is "Module" or name
is "SubModule" or name
is "LibName":
168 if not value.__class__ == str:
169 raise TypeError(
"Expected str")
170 object.__setattr__(self,name,value)
177 return "'%s':'%s'\n---State = %d \n---DependsOn : %s " % (self.
LibName,self.
SubModule or self.
Module,self.
State,self.DependsOn.__str__(
True,
True).
replace(
"---",
"------"))
179 return self.AreDependent.__str__(topDown=
True)
190 self.RunningThreads.append(item)
192 self.ThreadLog.append([t,item.BuildNode.LibName,
"INFO: %s thread %s added for Library %s" % (t,item.name,item.BuildNode.LibName)])
198 return sum([x.Weight
for x
in self.
RunningThreads if x.is_alive()])
204 dict.__init__(self,dict.fromkeys(servers))
205 for srv
in self.keys():
214 smallest=self.keys()[0]
215 sizeSmallest=self[smallest].pendingThreads()
216 for srv
in self.keys()[1:]:
217 size=self[srv].pendingThreads()
218 if size < sizeSmallest:
224 thinnest=self.keys()[0]
225 weightThinnest=self[thinnest].queueWeight()
226 for srv
in self.keys()[1:]:
227 weight=self[srv].queueWeight()
228 if weight < weightThinnest:
230 weightThinnest = weight
def __str__(self, topDown=False, direction=False)
def findLib(self, lib, head=None)
def replace(string, replacements)
S & print(S &os, JobReport::InputFile const &f)
def __init__(self, cores=4, jay=2)
def __init__(self, value=None)
def __setattr__(self, name, value)
def releaseAllLocks(self)
def __str__(self, topDown=False)
def __init__(self, servers=[], cores=4, jay=2)
static std::string join(char **cmd)
def __setitem__(self, index, value)
def __init__(self, libname="", module="", submodule="", depends=None, areDependent=None, weight=1, srvqueue=None)
def putInServerQueue(self)
def __init__(self, parent, queue, weight=1)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run