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 10 of file psClasses.py.

Constructor & Destructor Documentation

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

Definition at line 12 of file psClasses.py.

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

Member Function Documentation

def psClasses.BuildThread.build (   self)

Definition at line 34 of file psClasses.py.

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

Referenced by psClasses.BuildThread.run().

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

Definition at line 20 of file psClasses.py.

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

Referenced by psClasses.BuildThread.run().

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

Definition at line 48 of file psClasses.py.

Referenced by psClasses.BuildThread.run().

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

Definition at line 56 of file psClasses.py.

References Plane.build(), TrackerAlignmentLevelBuilder.build(), psClasses.BuildThread.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().

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

Member Data Documentation

psClasses.BuildThread.BuildNode

Definition at line 14 of file psClasses.py.

psClasses.BuildThread.IsComplete

Definition at line 17 of file psClasses.py.

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

Definition at line 16 of file psClasses.py.

Referenced by psClasses.BuildThread.putInServerQueue().