Commit 099562cf authored by Stanislav Bohm's avatar Stanislav Bohm
Browse files

RF: New directory layout for Python packages

parent 078f33ac
#!/bin/sh
BASE_DIR=`dirname $0`
BASE_DIR=`dirname $0`/..
LIBLOOM_DIR=${BASE_DIR}/../libloom
WORKER_DIR=${BASE_DIR}/../worker
CLIENT_DIR=${BASE_DIR}/../client
LIBLOOM_DIR=${BASE_DIR}/src/libloom
PYTHON_DIR=${BASE_DIR}/python/loom/pb
# LIBLOOM
protoc loomcomm.proto --cpp_out=${LIBLOOM_DIR}
......@@ -12,7 +11,7 @@ protoc loomplan.proto --cpp_out=${LIBLOOM_DIR}
protoc loomrun.proto --cpp_out=${LIBLOOM_DIR}/tasks
# CLIENT (Python)
protoc loomcomm.proto --python_out=${CLIENT_DIR}
protoc loomplan.proto --python_out=${CLIENT_DIR}
protoc loomrun.proto --python_out=${CLIENT_DIR}
protoc loomreport.proto --python_out=${CLIENT_DIR}
protoc loomcomm.proto --python_out=${PYTHON_DIR}
protoc loomplan.proto --python_out=${PYTHON_DIR}
protoc loomrun.proto --python_out=${PYTHON_DIR}
protoc loomreport.proto --python_out=${PYTHON_DIR}
from loomcomm_pb2 import Register, Data, ClientMessage, ClientSubmit
from loomreport_pb2 import Report
from ..pb.loomcomm_pb2 import Register, Data, ClientMessage, ClientSubmit
from ..pb.loomreport_pb2 import Report
import socket
from connection import Connection
......
import loomplan_pb2
from ..pb import loomplan_pb2 as loomplan
POLICY_STANDARD = loomplan_pb2.Task.POLICY_STANDARD
POLICY_SIMPLE = loomplan_pb2.Task.POLICY_SIMPLE
POLICY_SCHEDULER = loomplan_pb2.Task.POLICY_SCHEDULER
POLICY_STANDARD = loomplan.Task.POLICY_STANDARD
POLICY_SIMPLE = loomplan.Task.POLICY_SIMPLE
POLICY_SCHEDULER = loomplan.Task.POLICY_SCHEDULER
class Task(object):
......
......@@ -3,7 +3,7 @@ from .plan import Plan, Task, ResourceRequest
from .plan import POLICY_SCHEDULER, POLICY_SIMPLE
import struct
import loomrun_pb2
from ..pb import loomrun_pb2 as loomrun
def cpus(value):
......@@ -102,7 +102,7 @@ class PlanBuilder(object):
task.task_type = self.TASK_RUN
task.inputs = tuple(i for i, fname in inputs)
msg = loomrun_pb2.Run()
msg = loomrun.Run()
msg.args.extend(args)
msg.map_inputs.extend(fname if fname else "+in"
......
# HACK! We need to fix this
import sys
import os
sys.path.insert(0,
os.path.join(
os.path.dirname(__file__),
"..",
"client"))
import loomreport_pb2 # noqa
import loomcomm_pb2 # noqa
import gv # noqas
import matplotlib.pyplot as plt # noqa
from ..pb import loomreport_pb2 as loomreport
from ..pb import loomcomm_pb2 as loomcomm
import gv
import matplotlib.pyplot as plt
def generate_colors(count):
......@@ -38,7 +29,7 @@ class Report:
with open(filename) as f:
raw_data = f.read()
self.report_msg = loomreport_pb2.Report()
self.report_msg = loomreport.Report()
self.report_msg.ParseFromString(raw_data)
self.symbols = [s.replace("loom", "L")
......@@ -56,7 +47,7 @@ class Report:
return sorted(labels)
def create_graph(self):
TASK_START = loomcomm_pb2.Event.TASK_START
TASK_START = loomcomm.Event.TASK_START
graph = gv.Graph()
symbols = self.symbols
......@@ -85,8 +76,8 @@ class Report:
return graph
def get_events_hline_data(self):
TASK_START = loomcomm_pb2.Event.TASK_START
TASK_END = loomcomm_pb2.Event.TASK_END
TASK_START = loomcomm.Event.TASK_START
TASK_END = loomcomm.Event.TASK_END
workers = {}
symbols = self.symbols
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment