本文整理汇总了Python中DIRAC.Time.time方法的典型用法代码示例。如果您正苦于以下问题:Python Time.time方法的具体用法?Python Time.time怎么用?Python Time.time使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DIRAC.Time
的用法示例。
在下文中一共展示了Time.time方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _update
# 需要导入模块: from DIRAC import Time [as 别名]
# 或者: from DIRAC.Time import time [as 别名]
def _update( self, cmd, conn=False ):
""" Update MPIJob Database
"""
print "DB4"
start = Time.time()
ret = DB._update( self, cmd, conn )
if DEBUG:
print >> debugFile, Time.time() - start, cmd.replace('\n','')
debugFile.flush()
print ret
return ret
示例2: _query
# 需要导入模块: from DIRAC import Time [as 别名]
# 或者: from DIRAC.Time import time [as 别名]
def _query( self, cmd, conn=False ):
""" Make queries to MPIJob DB
"""
print "DB3"
start = Time.time()
ret = DB._query( self, cmd, conn )
if DEBUG:
print >> debugFile, Time.time() - start, cmd.replace('\n','')
debugFile.flush()
print ret
return ret
示例3: updateRing
# 需要导入模块: from DIRAC import Time [as 别名]
# 或者: from DIRAC.Time import time [as 别名]
def updateRing(self,updDict):
""" Update Ring port and status attributes after master of MPICH2 starts
Inputs: {Port, RingID, JobID}
Output: {RingID, Status, JobID}
"""
print "DB15"
port = updDict['Port']
ringID = updDict['RingID']
jobID = updDict['JobID']
status = 'RingInit'
timeUpd = Time.time()
req = "UPDATE Rings SET Port=%s, LastTimeUpdate=UTC_TIMESTAMP(), Status=\'%s\' WHERE RingID=%s AND JobID=%s" % (port,status,ringID,jobID)
result = self._query(req)
if not result['OK']:
print "DB16"
self.log.info ('UPDATE PORT ERROR')
return S_OK(result)
dict = {'RingID': ringID, 'JobID': jobID}
result = self.selectRings(dict)
values = result['Value']
result ={}
keys = ['RingID', 'Status', 'JobID']
for x,y,t in values:
z = int(str(x).strip('L'))
v = int(str(t).strip('L'))
result.setdefault('RingID',z)
result.setdefault('Status',y)
result.setdefault('JobID',v)
print result
return S_OK(result)
示例4: updateProcessors
# 需要导入模块: from DIRAC import Time [as 别名]
# 或者: from DIRAC.Time import time [as 别名]
def updateProcessors(self, updDict):
""" Update number of ring processors than are part of particular ring.
Input: {RingID, JobID}
Output:{RingID}
"""
print "DB23"
ringID = updDict['RingID']
jobID = updDict['JobID']
req = ('SELECT NumberOfProcessorsRing, NumberOfProcessorsJob FROM Rings WHERE RingID=%s AND JobID=%s') % (ringID,jobID)
result = self._query(req)
if not result['OK']:
print "DB24"
return S_OK(result)
value ={}
temp = result['Value']
for x,y in temp:
v = temp[0]
z = int(str(x).strip('L'))
value.setdefault('numProce',z)
value.setdefault('numProceJ',y)
numProc=int(value['numProce'])+1
timeUpd = Time.time()
cmd = 'UPDATE Rings SET NumberOfProcessorsRing=%s, LastTimeUpdate=UTC_TIMESTAMP() WHERE RingID=%s AND JobID=%s' % (numProc, ringID,jobID)
result = self._update(cmd)
print "RESULT SELF UPDATE", result
if not result['OK']:
print "Result no OK", result
print "DB25"
return S_ERROR(result['Message'])
matchDict = {'RingID':ringID}
result = self.selectRing(matchDict)
#result = ringID
print "VH >>>>>>>>>>>>> ELIMINE", result
return S_OK(result)