CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Public Attributes
psClasses.BuildThread Class Reference

Classes. More...

Inheritance diagram for psClasses.BuildThread:

Public Member Functions

def __init__
 
def build
 
def putInServerQueue
 
def releaseAllLocks
 
def run
 

Public Attributes

 BuildNode
 
 IsComplete
 
 Queue
 
 QueueList
 
 Weight
 

Detailed Description

Classes.

Definition at line 11 of file psClasses.py.

Constructor & Destructor Documentation

def psClasses.BuildThread.__init__ (   self,
  parent,
  queue,
  weight = 1 
)

Definition at line 13 of file psClasses.py.

13 
14  def __init__(self, parent, queue, weight = 1):
15  Thread.__init__(self)
16  self.BuildNode = parent
17  self.QueueList = queue
18  self.Weight = weight
19  self.IsComplete = Condition()
20  self.Queue = None

Member Function Documentation

def psClasses.BuildThread.build (   self)

Definition at line 35 of file psClasses.py.

References print(), psClasses.BuildThread.Queue, and psClasses.BuildThread.QueueList.

Referenced by psClasses.BuildThread.run().

35 
36  def build(self):
37  self.QueueList[self.Queue].QueueSem.acquire()
38  #call(['eval',"scram runtime -sh",";",'EdmPluginRefresh',self.BuildNode.LibName],shell="/bin/bash"))
39  rValue=call(['ssh',self.Queue,'cd ~/CMSSW_3_5_7;scram build -j %d' % self.QueueList.Jay,self.BuildNode.LibName])
40  self.QueueList.EdmRefreshLock.acquire()
41  call(['ssh',self.Queue,'cd ~/CMSSW_3_5_7;eval `scram runtime -sh`;EdmPluginRefresh %s' % self.BuildNode.LibName])
42  self.QueueList.EdmRefreshLock.release()
43  if rValue == 0:
44  self.BuildNode.State=STATE_COMPLETED
45  else:
46  print("Build failed for %s" % self.BuildNode.LibName)
47  self.BuildNode.State=STATE_ERROR
48  self.QueueList[self.Queue].QueueSem.release()
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def psClasses.BuildThread.putInServerQueue (   self)

Definition at line 21 of file psClasses.py.

References bitset_utilities.append(), psClasses.BuildThread.Queue, psClasses.BuildThread.QueueList, and psClasses.BuildThread.Weight.

Referenced by psClasses.BuildThread.run().

21 
22  def putInServerQueue(self):
23  self.QueueList.QueueLock.acquire()
24  sSrv=self.QueueList.smallestQueue()
25  tSrv=self.QueueList.thinerQueue()
26  self.Queue=sSrv
27  if sSrv == tSrv:
28  self.QueueList[sSrv].append(self)
29  elif self.Weight + self.QueueList[sSrv].queueWeight() <= (self.QueueList.Cores/self.QueueList.Jay)*1.5:
30  self.QueueList[sSrv].append(self)
31  else:
32  self.QueueList[tSrv].append(self)
33  self.Queue=tSrv
34  self.QueueList.QueueLock.release()
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 ...
def psClasses.BuildThread.releaseAllLocks (   self)

Definition at line 49 of file psClasses.py.

Referenced by psClasses.BuildThread.run().

49 
50  def releaseAllLocks(self):
51  #for deps in self.BuildNode.DependsOn:
52  #deps.BThread.IsComplete.release()
53  self.BuildNode.State=STATE_ERROR
54  self.IsComplete.acquire()
55  self.IsComplete.notifyAll()
56  self.IsComplete.release()
def psClasses.BuildThread.run (   self)

Definition at line 57 of file psClasses.py.

References Cone.build(), TrackerAlignmentLevelBuilder.build(), Plane.build(), psClasses.BuildThread.build(), Disk.build(), Cylinder.build(), KDTreeNodes< DATA, DIM >.build(), TrackerMap.build(), KDTreeLinkerAlgo< DATA, DIM >.build(), FKDTree< TYPE, numberOfDimensions >.build(), psClasses.BuildThread.putInServerQueue(), and psClasses.BuildThread.releaseAllLocks().

Referenced by Types.EventID.cppID(), and Types.LuminosityBlockID.cppID().

57 
58  def run(self):
59  depsCompleted=False
60  while not depsCompleted:
61  depsCompleted=True
62  for deps in self.BuildNode.DependsOn:
63  if deps.State is STATE_ERROR :
64  self.releaseAllLocks()
65  return -1
66  if deps.State is not STATE_COMPLETED :
67  depsCompleted=False
68  deps.BThread.IsComplete.acquire()
69  deps.BThread.IsComplete.wait()
70  #deps.BThread.is_alive() and sys.stdout.write("Wait time exeded %s %s\n" % (deps.LibName,deps.Module))
71  deps.BThread.IsComplete.release()
72 
73  self.putInServerQueue()
74  self.build()
75  self.IsComplete.acquire()
76  self.IsComplete.notifyAll()
77  self.IsComplete.release()
78  return 0

Member Data Documentation

psClasses.BuildThread.BuildNode

Definition at line 15 of file psClasses.py.

psClasses.BuildThread.IsComplete

Definition at line 18 of file psClasses.py.

psClasses.BuildThread.Queue

Definition at line 19 of file psClasses.py.

Referenced by psClasses.BuildThread.build(), and psClasses.BuildThread.putInServerQueue().

psClasses.BuildThread.QueueList

Definition at line 16 of file psClasses.py.

Referenced by psClasses.BuildThread.build(), and psClasses.BuildThread.putInServerQueue().

psClasses.BuildThread.Weight

Definition at line 17 of file psClasses.py.

Referenced by psClasses.BuildThread.putInServerQueue().