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

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 13 of file psClasses.py.

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

Member Function Documentation

◆ build()

def psClasses.BuildThread.build (   self)

Definition at line 35 of file psClasses.py.

35  def build(self):
36  self.QueueList[self.Queue].QueueSem.acquire()
37  #call(['eval',"scram runtime -sh",";",'EdmPluginRefresh',self.BuildNode.LibName],shell="/bin/bash"))
38  rValue=call(['ssh',self.Queue,'cd ~/CMSSW_3_5_7;scram build -j %d' % self.QueueList.Jay,self.BuildNode.LibName])
39  self.QueueList.EdmRefreshLock.acquire()
40  call(['ssh',self.Queue,'cd ~/CMSSW_3_5_7;eval `scram runtime -sh`;EdmPluginRefresh %s' % self.BuildNode.LibName])
41  self.QueueList.EdmRefreshLock.release()
42  if rValue == 0:
43  self.BuildNode.State=STATE_COMPLETED
44  else:
45  print("Build failed for %s" % self.BuildNode.LibName)
46  self.BuildNode.State=STATE_ERROR
47  self.QueueList[self.Queue].QueueSem.release()
48 

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

Referenced by psClasses.BuildThread.run().

◆ putInServerQueue()

def psClasses.BuildThread.putInServerQueue (   self)

Definition at line 21 of file psClasses.py.

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

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

Referenced by psClasses.BuildThread.run().

◆ releaseAllLocks()

def psClasses.BuildThread.releaseAllLocks (   self)

Definition at line 49 of file psClasses.py.

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

References psClasses.BuildThread.BuildNode, psClasses.BuildThread.IsComplete, and fetchall_from_DQM_v2.release.

Referenced by psClasses.BuildThread.run().

◆ run()

def psClasses.BuildThread.run (   self)

Definition at line 57 of file psClasses.py.

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

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.BuildNode, psClasses.BuildThread.IsComplete, psClasses.BuildThread.putInServerQueue(), fetchall_from_DQM_v2.release, and psClasses.BuildThread.releaseAllLocks().

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

Member Data Documentation

◆ BuildNode

psClasses.BuildThread.BuildNode

◆ IsComplete

psClasses.BuildThread.IsComplete

◆ Queue

psClasses.BuildThread.Queue

◆ QueueList

psClasses.BuildThread.QueueList

◆ Weight

psClasses.BuildThread.Weight

Definition at line 17 of file psClasses.py.

Referenced by psClasses.BuildThread.putInServerQueue().

newFWLiteAna.build
build
Definition: newFWLiteAna.py:126
fetchall_from_DQM_v2.release
release
Definition: fetchall_from_DQM_v2.py:92
mps_setup.append
append
Definition: mps_setup.py:85
edm::print
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
writedatasetfile.run
run
Definition: writedatasetfile.py:27