CMS 3D CMS Logo

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__ (self, parent, queue, weight=1)
 
def build (self)
 
def putInServerQueue (self)
 
def releaseAllLocks (self)
 
def run (self)
 

Public Attributes

 BuildNode
 
 IsComplete
 
 Queue
 
 QueueList
 
 Weight
 

Detailed Description

Classes.

Definition at line 9 of file psClasses.py.

Constructor & Destructor Documentation

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

Definition at line 11 of file psClasses.py.

11  def __init__(self, parent, queue, weight = 1):
12  Thread.__init__(self)
13  self.BuildNode = parent
14  self.QueueList = queue
15  self.Weight = weight
16  self.IsComplete = Condition()
17  self.Queue = None
18 
def __init__(self, parent, queue, weight=1)
Definition: psClasses.py:11

Member Function Documentation

def psClasses.BuildThread.build (   self)

Definition at line 33 of file psClasses.py.

References psClasses.BuildThread.Queue, and psClasses.BuildThread.QueueList.

Referenced by psClasses.BuildThread.run().

33  def build(self):
34  self.QueueList[self.Queue].QueueSem.acquire()
35  #call(['eval',"scram runtime -sh",";",'EdmPluginRefresh',self.BuildNode.LibName],shell="/bin/bash"))
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()
40  if rValue == 0:
41  self.BuildNode.State=STATE_COMPLETED
42  else:
43  print "Build failed for %s" % self.BuildNode.LibName
44  self.BuildNode.State=STATE_ERROR
45  self.QueueList[self.Queue].QueueSem.release()
46 
def psClasses.BuildThread.putInServerQueue (   self)

Definition at line 19 of file psClasses.py.

References mps_setup.append, psClasses.BuildThread.Queue, psClasses.BuildThread.QueueList, and psClasses.BuildThread.Weight.

Referenced by psClasses.BuildThread.run().

19  def putInServerQueue(self):
20  self.QueueList.QueueLock.acquire()
21  sSrv=self.QueueList.smallestQueue()
22  tSrv=self.QueueList.thinerQueue()
23  self.Queue=sSrv
24  if sSrv == tSrv:
25  self.QueueList[sSrv].append(self)
26  elif self.Weight + self.QueueList[sSrv].queueWeight() <= (self.QueueList.Cores/self.QueueList.Jay)*1.5:
27  self.QueueList[sSrv].append(self)
28  else:
29  self.QueueList[tSrv].append(self)
30  self.Queue=tSrv
31  self.QueueList.QueueLock.release()
32 
def putInServerQueue(self)
Definition: psClasses.py:19
def psClasses.BuildThread.releaseAllLocks (   self)

Definition at line 47 of file psClasses.py.

Referenced by psClasses.BuildThread.run().

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

Definition at line 55 of file psClasses.py.

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

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

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

Member Data Documentation

psClasses.BuildThread.BuildNode

Definition at line 13 of file psClasses.py.

psClasses.BuildThread.IsComplete

Definition at line 16 of file psClasses.py.

psClasses.BuildThread.Queue
psClasses.BuildThread.QueueList
psClasses.BuildThread.Weight

Definition at line 15 of file psClasses.py.

Referenced by psClasses.BuildThread.putInServerQueue().