CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 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 
12  def __init__(self, parent, queue, weight = 1):
13  Thread.__init__(self)
14  self.BuildNode = parent
15  self.QueueList = queue
16  self.Weight = weight
18  self.Queue = None
string const Condition

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 
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()
def psClasses.BuildThread.putInServerQueue (   self)

Definition at line 19 of file psClasses.py.

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

Referenced by psClasses.BuildThread.run().

19 
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()
def psClasses.BuildThread.releaseAllLocks (   self)

Definition at line 47 of file psClasses.py.

Referenced by psClasses.BuildThread.run().

47 
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()
def psClasses.BuildThread.run (   self)

Definition at line 55 of file psClasses.py.

References ora::PVectorWriter.build(), ora::RelationalDeleter.build(), ora::IRelationalWriter.build(), ora::DependentClassWriter.build(), ora::QueryableVectorWriter.build(), ora::CArrayWriter.build(), ora::OraPtrWriter.build(), ora::OraPtrReadBuffer.build(), ora::PVectorUpdater.build(), ora::UniqueRefWriter.build(), psClasses.BuildThread.build(), ora::STLContainerWriter.build(), Cone.build(), ora::ObjectWriter.build(), Disk.build(), ora::IRelationalUpdater.build(), ora::PrimitiveWriter.build(), ora::InlineCArrayWriter.build(), ora::OraReferenceWriter.build(), ora::QueryableVectorUpdater.build(), ora::BlobWriter.build(), ora::PVectorReader.build(), Cylinder.build(), ora::OraPtrUpdater.build(), ora::NamedRefWriter.build(), ora::IRelationalReader.build(), ora::UniqueRefUpdater.build(), ora::PrimitiveUpdater.build(), AlignableBuilder.build(), ora::CArrayUpdater.build(), ora::OraReferenceUpdater.build(), ora::ObjectUpdater.build(), ora::BlobUpdater.build(), ora::InlineCArrayUpdater.build(), ora::QVQueryMaker.build(), ora::STLContainerUpdater.build(), ora::QueryableVectorReader.build(), ora::PrimitiveReader.build(), ora::NamedRefUpdater.build(), ora::OraReferenceReader.build(), ora::BlobReader.build(), TrackerMap.build(), ora::UniqueRefReader.build(), ora::OraPtrReader.build(), ora::CArrayReader.build(), ora::InlineCArrayReader.build(), ora::DependentClassReader.build(), ora::ObjectReader.build(), ora::STLContainerReader.build(), ora::NamedRefReader.build(), ora::RelationalRefLoader.build(), psClasses.BuildThread.putInServerQueue(), and psClasses.BuildThread.releaseAllLocks().

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

55 
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

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

Definition at line 17 of file psClasses.py.

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

psClasses.BuildThread.QueueList

Definition at line 14 of file psClasses.py.

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

psClasses.BuildThread.Weight

Definition at line 15 of file psClasses.py.

Referenced by psClasses.BuildThread.putInServerQueue().