2 import os,subprocess,sys,re,time,random
3 from threading
import *
4 from subprocess
import call
6 STATE_CREATED,STATE_COMPLETED,STATE_ERROR=range(3)
20 self.QueueList.QueueLock.acquire()
21 sSrv=self.QueueList.smallestQueue()
22 tSrv=self.QueueList.thinerQueue()
26 elif self.
Weight + self.
QueueList[sSrv].queueWeight() <= (self.QueueList.Cores/self.QueueList.Jay)*1.5:
31 self.QueueList.QueueLock.release()
36 rValue=call([
'ssh',self.
Queue,
'cd ~/CMSSW_3_5_7;scram build -j %d' % self.QueueList.Jay,self.BuildNode.LibName])
37 self.QueueList.EdmRefreshLock.acquire()
38 call([
'ssh',self.
Queue,
'cd ~/CMSSW_3_5_7;eval `scram runtime -sh`;EdmPluginRefresh %s' % self.BuildNode.LibName])
39 self.QueueList.EdmRefreshLock.release()
41 self.BuildNode.State=STATE_COMPLETED
43 print "Build failed for %s" % self.BuildNode.LibName
44 self.BuildNode.State=STATE_ERROR
50 self.BuildNode.State=STATE_ERROR
51 self.IsComplete.acquire()
52 self.IsComplete.notifyAll()
53 self.IsComplete.release()
57 while not depsCompleted:
59 for deps
in self.BuildNode.DependsOn:
60 if deps.State
is STATE_ERROR :
63 if deps.State
is not STATE_COMPLETED :
65 deps.BThread.IsComplete.acquire()
66 deps.BThread.IsComplete.wait()
68 deps.BThread.IsComplete.release()
72 self.IsComplete.acquire()
73 self.IsComplete.notifyAll()
74 self.IsComplete.release()
84 list.__init__(self,value)
100 itP=it.AreDependent.findLib(lib,head)
107 if not node.BThread.is_alive():
112 node.AreDependent.startThreads()
115 return self.
findLib(dep.replace(
"/",
""))
118 if not value.__class__ == BuildTreeNode:
119 raise TypeError(
"Expected BuildTreeNode")
120 self.SeenLibs.append(value.LibName)
121 self.SeenModules.append(value.Module)
122 self.SeenSubModules.append(value.SubModule)
123 list.__setitem__(self,index,value)
126 if not value.__class__ == BuildTreeNode:
127 raise TypeError(
"Expected BuildTreeNode")
128 value.LibName
not in self.
SeenLibs and self.SeenLibs.append(value.LibName)
129 value.Module
not in self.
SeenModules and self.SeenModules.append(value.Module)
130 value.SubModule
not in self.
SeenSubModules and self.SeenSubModules.append(value.SubModule)
131 list.append(self,value)
133 def __str__(self,topDown=False,direction=False):
135 return "[\n...%s]" % str(
"\n...".
join([str(it).
replace(
"...",
"......")
for it
in self]))
138 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 ])
140 return "\n".
join([it.__str__(
True)
for it
in self])
144 def __init__(self,libname="",module="",submodule="",depends=None,areDependent=None,weight=1,srvqueue=None):
149 if areDependent==
None:
160 if name
is "DependsOn" or name
is "AreDependent":
161 if not value.__class__ == BuildTreeNodeList:
162 raise TypeError(
"Expected BuildTreeNodeList")
163 elif name
is "State" or name
is "ModulesToDo":
164 if not value.__class__ == int:
165 raise TypeError(
"Expected int")
166 elif name
is "Module" or name
is "SubModule" or name
is "LibName":
167 if not value.__class__ == str:
168 raise TypeError(
"Expected str")
169 object.__setattr__(self,name,value)
176 return "'%s':'%s'\n---State = %d \n---DependsOn : %s " % (self.
LibName,self.
SubModule or self.
Module,self.
State,self.DependsOn.__str__(
True,
True).
replace(
"---",
"------"))
178 return self.AreDependent.__str__(topDown=
True)
189 self.RunningThreads.append(item)
191 self.ThreadLog.append([t,item.BuildNode.LibName,
"INFO: %s thread %s added for Library %s" % (t,item.name,item.BuildNode.LibName)])
197 return sum([x.Weight
for x
in self.
RunningThreads if x.is_alive()])
203 dict.__init__(self,dict.fromkeys(servers))
204 for srv
in self.keys():
213 smallest=self.keys()[0]
214 sizeSmallest=self[smallest].pendingThreads()
215 for srv
in self.keys()[1:]:
216 size=self[srv].pendingThreads()
217 if size < sizeSmallest:
223 thinnest=self.keys()[0]
224 weightThinnest=self[thinnest].queueWeight()
225 for srv
in self.keys()[1:]:
226 weight=self[srv].queueWeight()
227 if weight < weightThinnest:
229 weightThinnest = weight
boost::dynamic_bitset append(const boost::dynamic_bitset<> &bs1, const boost::dynamic_bitset<> &bs2)
this method takes two bitsets bs1 and bs2 and returns result of bs2 appended to the end of bs1 ...
static std::string join(char **cmd)
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