Skip to content

Commit

Permalink
merge with master
Browse files Browse the repository at this point in the history
  • Loading branch information
M-Wicenec committed Jul 30, 2021
2 parents c722c9f + 88f915b commit e33214a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
2 changes: 2 additions & 0 deletions OpenAPI/translator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ paths:
type: string
algo:
type: string
test:
type: string
num_par:
type: integer
num_islands:
Expand Down
15 changes: 10 additions & 5 deletions daliuge-translator/dlg/dropmake/pg_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ def is_group_start(self):
elif type(gs) in [type(1), type(1.)]:
result = (1 == gs)
elif type(gs) == type("s"):
result = gs.lower() in ("true", "1")
result = gs.lower() in ("true", "1")
return result


Expand All @@ -325,7 +325,7 @@ def is_group_end(self):
elif type(ge) == type("s"):
result = ge.lower() in ("true", "1")
return result

def is_group(self):
return self._isgrp

Expand Down Expand Up @@ -683,6 +683,11 @@ def _create_test_drop_spec(self, oid, rank, kwargs):
v = self.jd[k]
if v is not None and len(str(v)) > 0:
cmds.append(str(v))
# add more arguments - this is the new method of adding arguments in EAGLE
# the method above (Arg**) is retained for compatibility, but eventually should be removed
for k in ["command", "input_redirection", "output_redirection", "command_line_arguments"]:
if k in self.jd:
cmds.append(self.jd[k])
# kwargs['command'] = ' '.join(cmds)
kwargs["command"] = BashCommand(cmds)
kwargs["num_cpus"] = int(self.jd.get("num_cpus", 1))
Expand Down Expand Up @@ -980,7 +985,7 @@ def to_pg_spec(self, node_list, ret_str=True, num_islands=1, tpl_nodes_len=0):
"""
if tpl_nodes_len > 0: # generate pg_spec template
node_list = range(tpl_nodes_len) # create a fake list for now
# TODO proper
# TODO proper
# Looks like we don't need too much anymore

if node_list is None or 0 == len(node_list):
Expand Down Expand Up @@ -2156,8 +2161,8 @@ def _get_chunk_size(self, s, t):

def _is_stream_link(self, s_type, t_type):
return s_type in [
Categories.COMPONENT,
Categories.DYNLIB_APP,
Categories.COMPONENT,
Categories.DYNLIB_APP,
Categories.DYNLIB_PROC_APP,
Categories.PYTHON_APP] and t_type in [
Categories.COMPONENT,
Expand Down
10 changes: 9 additions & 1 deletion daliuge-translator/dlg/dropmake/web/lg_web.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,16 @@ def gen_pgt_post():


def unroll_and_partition_with_params(lg_path, algo_params_source):
# Get the 'test' parameter
# NB: the test parameter is a string, so convert to boolean
test = algo_params_source.get("test", "false")
test = test.lower() == "true"

# Based on 'test' parameter, decide whether to use a replacement app
app = "dlg.apps.simple.SleepApp" if test else None

# Unrolling LG to PGT.
pgt = unroll(lg_path)
pgt = unroll(lg_path, app=app)

# Define partitioning parameters.
algo = algo_params_source.get("algo", "none")
Expand Down

0 comments on commit e33214a

Please sign in to comment.