示例#1
0
def main():
    db = _db.Database(fs.path("joblist.db"))
    data = [row for row in
            db.execute("SELECT device,Count(*) AS count\n"
                       "FROM jobs\n"
                       "GROUP BY device\n"
                       "ORDER BY count")]
    io.info("Job list:")
    print(fmt.table(data, columns=("Device", "Jobs")))
    print()

    jobs = [row for row in db.execute("SELECT * FROM jobs")]

    fs.mkdir("jobs")
    logs = {
        "monza": open("jobs/monza.txt", "w"),
        "whz5": open("jobs/whz5.txt", "w"),
        "monza": open("jobs/monza.txt", "w"),
        "cec": open("jobs/cec.txt", "w"),
        "florence": open("jobs/florence.txt", "w"),
    }

    for job in jobs:
        enum_job(logs, db, *job)

    lab.exit()
示例#2
0
 def test_exit(self):
     with self.assertRaises(SystemExit) as ctx:
         lab.exit(0)
     self.assertEqual(ctx.exception.code, 0)
     with self.assertRaises(SystemExit) as ctx:
         lab.exit(1)
     self.assertEqual(ctx.exception.code, 1)
示例#3
0
def main():
    db = _db.Database(fs.path("joblist.db"))
    data = [
        row for row in db.execute("SELECT device,Count(*) AS count\n"
                                  "FROM jobs\n"
                                  "GROUP BY device\n"
                                  "ORDER BY count")
    ]
    io.info("Job list:")
    print(fmt.table(data, columns=("Device", "Jobs")))
    print()

    jobs = [row for row in db.execute("SELECT * FROM jobs")]

    fs.mkdir("jobs")
    logs = {
        "monza": open("jobs/monza.txt", "w"),
        "whz5": open("jobs/whz5.txt", "w"),
        "monza": open("jobs/monza.txt", "w"),
        "cec": open("jobs/cec.txt", "w"),
        "florence": open("jobs/florence.txt", "w"),
    }

    for job in jobs:
        enum_job(logs, db, *job)

    lab.exit()
示例#4
0
def main():
    os.environ["OMNITUNE_OFFLINE_TRAINING"] = "1"
    fs.cd(experiment.EXAMPLES_BUILD)

    # Build sources.
    ret, _, _ = make.make()
    if ret:
        labm8.exit(ret)

    while True:
        sample_space()
示例#5
0
def main():
    jobs = get_jobs()
    io.info("Loaded", len(jobs), "jobs")

    # Build example programs.
    fs.cd(experiment.EXAMPLES_BUILD)
    make.make()

    for i,job in enumerate(jobs):
        run_job(i, len(jobs), *job.split("\t"))

    lab.exit()
示例#6
0
def main():
    dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)

    bus = dbus.SystemBus()
    name = dbus.service.BusName(SESSION_NAME, bus)
    io.info("Launched session %s ..." % SESSION_NAME)

    # Launch server.
    Server(bus, OBJECT_PATH)

    mainloop = gobject.MainLoop()
    try:
        mainloop.run()
    except KeyboardInterrupt:
        lab.exit()
示例#7
0
文件: io.py 项目: ChrisCummins/labm8
def fatal(*args, **kwargs):
    returncode = kwargs.pop("status", 1)
    error("fatal:", *args, **kwargs)
    lab.exit(returncode)