def register_gratia(self, name): Gratia.RegisterReporter(name) try: slurm_version = self.get_slurm_version() except Exception as e: DebugPrint(0, "Unable to get SLURM version: %s" % str(e)) raise Gratia.RegisterService("SLURM", slurm_version) Gratia.setProbeBatchManager("slurm")
raise Exception("Unable to invoke %s" % cmd) name, version = output.split() return version def register_gratia(self, name): Gratia.RegisterReporter(name) try: slurm_version = self.get_slurm_version() except Exception, e: DebugPrint(0, "Unable to get SLURM version: %s" % str(e)) raise Gratia.RegisterService("SLURM", slurm_version) Gratia.setProbeBatchManager("slurm") class SlurmCheckpoint(object): """Read and write a checkpoint file If class is instantiated without a filename, class works as expected but data is not stored to disk """ _val = None _fp = None def __init__(self, target=None): """ Create a checkpoint file target - checkpoint filename (optionally null)
lines = fd.readlines() boincjob = False for var2 in lines: if var2.count('QDate') > 0: starttime = var2.split()[2] elif var2.count('RemoteWallClockTime') > 0: walltime = var2.split()[2] elif var2.count('CompletionDate') > 0: endtime = var2.split()[2] elif var2.count('Owner') > 0: if var2.split()[2] == '"boinc"': boincjob = True if boincjob == True: Gratia.setProbeBatchManager('Condor') Gratia.Initialize() r = Gratia.UsageRecord('Condor') r.ResourceType('Backfill') # parsing the filenames for the hostname/localjobid. # the files are in the format: history.<hostname>#<localjobid>#1#<localjobid> host = var.partition('.')[2].partition('#')[0] localjobid = var.partition('.')[2].partition('#')[2].partition( '#')[0] # print 'endtime: ' + endtime # print 'starttime: ' + starttime # print 'walltime: ' + walltime
name, version = output.split() return version def register_gratia(self, name): Gratia.RegisterReporter(name, "%s (tag %s)" % \ (prog_revision, prog_version)) try: slurm_version = self.get_slurm_version() except Exception, e: DebugPrint(0, "Unable to get SLURM version: %s" % str(e)) raise Gratia.RegisterService("SLURM", slurm_version) Gratia.setProbeBatchManager("slurm") class SlurmCheckpoint(object): """Read and write a checkpoint file If class is instantiated without a filename, class works as expected but data is not stored to disk """ _val = None _fp = None def __init__(self, target=None): """ Create a checkpoint file target - checkpoint filename (optionally null) """
lines = fd.readlines() boincjob = False for var2 in lines: if var2.count("QDate") > 0: starttime = var2.split()[2] elif var2.count("RemoteWallClockTime") > 0: walltime = var2.split()[2] elif var2.count("CompletionDate") > 0: endtime = var2.split()[2] elif var2.count("Owner") > 0: if var2.split()[2] == '"boinc"': boincjob = True if boincjob == True: Gratia.setProbeBatchManager("Condor") Gratia.Initialize() r = Gratia.UsageRecord("Condor") r.ResourceType("Backfill") # parsing the filenames for the hostname/localjobid. # the files are in the format: history.<hostname>#<localjobid>#1#<localjobid> host = var.partition(".")[2].partition("#")[0] localjobid = var.partition(".")[2].partition("#")[2].partition("#")[0] # print 'endtime: ' + endtime # print 'starttime: ' + starttime # print 'walltime: ' + walltime # Gratia likes ints, not strings, for times.