Commit bdcd3256 by ziheng Committed by GitHub

[FIX] Fix bug and typo in rpc_server (#263)

* [FIX] Fix bug and typo in rpc_server

* [FIX] Remove unnecessary condition
parent 4f4cd5c1
...@@ -19,22 +19,21 @@ def main(): ...@@ -19,22 +19,21 @@ def main():
help='The end search port of the PRC') help='The end search port of the PRC')
parser.add_argument('--with-executor', type=bool, default=False, parser.add_argument('--with-executor', type=bool, default=False,
help="Whether to load executor runtime") help="Whether to load executor runtime")
parser.add_argument('--load-libary', type=str, default="", parser.add_argument('--load-library', type=str, default="",
help="Additional libary to load") help="Additional library to load")
args = parser.parse_args() args = parser.parse_args()
logging.basicConfig(level=logging.INFO) logging.basicConfig(level=logging.INFO)
load_libary = args.load_libary.split(":") load_library = [lib for lib in args.load_library.split(":") if len(lib) != 0]
curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__))) curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
apps_path = os.path.join(curr_path, "../../../apps/graph_executor/lib/") apps_path = os.path.join(curr_path, "../../../apps/graph_executor/lib/")
libs = [] libs = []
if args.with_executor: if args.with_executor:
load_libary += ["libtvm_graph_exec.so"] load_library += ["libtvm_graph_exec.so"]
if load_libary: for file_name in load_library:
for file_name in args.load_libary.split(":"):
file_name = find_lib_path(file_name, apps_path)[0] file_name = find_lib_path(file_name, apps_path)[0]
libs.append(ctypes.CDLL(file_name, ctypes.RTLD_GLOBAL)) libs.append(ctypes.CDLL(file_name, ctypes.RTLD_GLOBAL))
logging.info("Load additional libary %s", file_name) logging.info("Load additional library %s", file_name)
server = rpc.Server(args.host, args.port, args.port_end) server = rpc.Server(args.host, args.port, args.port_end)
server.libs += libs server.libs += libs
......
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