当前位置: 首页>>代码示例>>Python>>正文


Python Time.time方法代码示例

本文整理汇总了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
开发者ID:DIRACGrid,项目名称:MPIDIRAC,代码行数:13,代码来源:MPIJobDB.py

示例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
开发者ID:DIRACGrid,项目名称:MPIDIRAC,代码行数:13,代码来源:MPIJobDB.py

示例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)
开发者ID:DIRACGrid,项目名称:MPIDIRAC,代码行数:32,代码来源:MPIJobDB.py

示例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)
开发者ID:DIRACGrid,项目名称:MPIDIRAC,代码行数:37,代码来源:MPIJobDB.py


注:本文中的DIRAC.Time.time方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。