Add support for Concraft-pl RTS options
This commit is contained in:
@@ -14,9 +14,8 @@ from conmorfeusz.server import StandaloneApplication
|
||||
@click.option('--ccpl-port', default=3000, help='Port which internal concraft-pl server will be listening on.')
|
||||
@click.option('--ccpl-model', default=None, help='Model used by concraft-pl. It will fallback to CONCRAFT_PL_MODEL envvar if not specified.')
|
||||
@click.option('--ccpl-bin', default=None, help='Concraft-pl binary file. It will fallback to CONCRAFT_PL_BIN envvar if not specified.')
|
||||
@click.option('--ccpl-core-num', default=1, help='Number of cores used to run Concraft-pl logic.')
|
||||
@click.option('--ccpl-alloc-size', default=64, help='Allocation size for Concraft-pl.')
|
||||
def run(host, port, workers, ccpl_port, ccpl_model, ccpl_bin, ccpl_core_num, ccpl_alloc_size):
|
||||
@click.option("--ccpl-rts", default="-A4M -N4", help='Runtime system configuration for Concraft-pl VM.')
|
||||
def run(host, port, workers, ccpl_port, ccpl_model, ccpl_bin, ccpl_rts):
|
||||
"""
|
||||
Glues all services together and starts the holistic app.
|
||||
"""
|
||||
@@ -30,7 +29,7 @@ def run(host, port, workers, ccpl_port, ccpl_model, ccpl_bin, ccpl_core_num, ccp
|
||||
if ccpl_bin is None:
|
||||
raise Exception("Concraft-pl binary file must be specified either by --ccpl-bin option or by CONCRAFT_PL_BIN environment variable")
|
||||
|
||||
concraft_cfg = (ccpl_model, ccpl_bin, ccpl_port, ccpl_core_num, ccpl_alloc_size)
|
||||
concraft_cfg = (ccpl_model, ccpl_bin, ccpl_port, ccpl_rts.split())
|
||||
|
||||
with ccpl.start_server(*concraft_cfg):
|
||||
options = {
|
||||
|
||||
@@ -86,7 +86,7 @@ class Concraft(object):
|
||||
|
||||
class Server(object):
|
||||
def __init__(self, model_path, concraft_path="concraft-pl", port=3000,
|
||||
core_num=1, allocation_size=64):
|
||||
runtimeArgs=[]):
|
||||
"""
|
||||
Start a Concraft-pl server instance in the background.
|
||||
|
||||
@@ -105,8 +105,7 @@ class Server(object):
|
||||
"""
|
||||
self.port = port
|
||||
self.concraft_server = Popen([concraft_path, 'server',
|
||||
'--port={}'.format(port), '-i', model_path, '+RTS',
|
||||
'-N{}'.format(core_num), '-A{}M'.format(allocation_size),],
|
||||
'--port={}'.format(port), '-i', model_path, '+RTS', *runtimeArgs],
|
||||
stdin=PIPE, stdout=PIPE, stderr=PIPE)
|
||||
# print(u"Concraft model " + model_path + u" loading...")
|
||||
loaded = False
|
||||
|
||||
Reference in New Issue
Block a user