Changeset 704


Ignore:
Timestamp:
03/21/13 17:05:42 (11 years ago)
Author:
ramonb
Message:
  • (indentation) fixes
  • cleanup
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/0.4/jobmond/jobmond.py

    r703 r704  
    5858    LONG_L       = [ 'help', 'config=', 'pidfile=', 'version' ]
    5959
    60     global PIDFILE JOBMOND_CONF
     60    global PIDFILE, JOBMOND_CONF
    6161    PIDFILE      = None
    6262
     
    12501250        except:
    12511251            parse_err = 1
    1252                if piping.wait():
    1253             debug_msg(10,
    1254                   "qstat error, skipping until next polling interval: "
    1255                   + piping.childerr.readline())
     1252        if piping.wait():
     1253            debug_msg(10, "qstat error, skipping until next polling interval: " + piping.childerr.readline())
    12561254            return None
    12571255        elif parse_err:
     
    12731271                    # PBS-type PPN isn't something you use
    12741272                    # with SGE.
    1275                     job["ppn"] = float(job["slots"]) / \
    1276                         len(job["nodes"])
     1273                    job["ppn"] = float(job["slots"]) / len(job["nodes"])
    12771274                except:
    12781275                    job["ppn"] = 0
     
    12821279                    # the SGE server's time is later
    12831280                    # than our local time.
    1284                     start_timestamp = \
    1285                         int (job["start_timestamp"])
    1286                     if start_timestamp > \
    1287                             int(self.cur_time) + \
    1288                             int(self.timeoffset):
    1289 
    1290                         self.timeoffset    = \
    1291                             start_timestamp - \
    1292                             int(self.cur_time)
     1281                    start_timestamp = int (job["start_timestamp"])
     1282                    if start_timestamp > int(self.cur_time) + int(self.timeoffset):
     1283
     1284                        self.timeoffset    = start_timestamp - int(self.cur_time)
    12931285            else:
    12941286                # fixme: Note sure what this should be:
     
    13031295                myAttrs[attr] = str(job[attr])
    13041296            myAttrs["nodes"] = job["nodes"]
    1305             myAttrs["reported"] = str(int(self.cur_time) + \
    1306                           int(self.timeoffset))
     1297            myAttrs["reported"] = str(int(self.cur_time) + int(self.timeoffset))
    13071298            myAttrs["domain"] = fqdn_parts(socket.getfqdn())[1]
    13081299            myAttrs["poll_interval"] = str(BATCH_POLL_INTERVAL)
    13091300
    1310             if self.jobDataChanged(self.jobs, job_id, myAttrs) \
    1311                     and myAttrs["status"] in ["R", "Q"]:
     1301            if self.jobDataChanged(self.jobs, job_id, myAttrs) and myAttrs["status"] in ["R", "Q"]:
    13121302                self.jobs[job_id] = myAttrs
    13131303        for id, attrs in self.jobs.items():
Note: See TracChangeset for help on using the changeset viewer.