diff --git a/daliuge-engine/dlg/graph_loader.py b/daliuge-engine/dlg/graph_loader.py index e0db1d488..f3123f800 100644 --- a/daliuge-engine/dlg/graph_loader.py +++ b/daliuge-engine/dlg/graph_loader.py @@ -437,6 +437,8 @@ def _getKwargs(dropSpec): "uid", "Application", "dropclass", + "appclass", + "dataclass", "data", "Data", ] diff --git a/daliuge-translator/dlg/dropmake/lg_node.py b/daliuge-translator/dlg/dropmake/lg_node.py index 56081b240..890850b1b 100644 --- a/daliuge-translator/dlg/dropmake/lg_node.py +++ b/daliuge-translator/dlg/dropmake/lg_node.py @@ -954,15 +954,27 @@ def _create_listener_drops(self, drop_spec): def _create_app_drop(self, drop_spec): # default generic component becomes "sleep and copy" if "appclass" in self.jd: - self.dropclass = self.jd["appclass"] - app_class = self.dropclass - logger.debug("Creating app drop using class: %s", self.dropclass) - if self.dropclass is None or self.dropclass == "": + app_class = self.jd["appclass"] + elif self.dropclass is None or self.dropclass == "": logger.debug("No dropclass found in: %s", self) app_class = "dlg.apps.simple.SleepApp" else: app_class = self.dropclass - execTime = self.weight + if self.dropclass == "dlg.apps.simple.SleepApp": + if self.category == "BashShellApp": + app_class = "dlg.apps.bash_shell_app.BashShellApp" + elif self.category == "Docker": + app_class = "dlg.apps.dockerapp.DockerApp" + else: + logger.debug("Might be a problem with this node: %s", self.jd) + + self.dropclass = app_class + execTime = self.weight + self.jd["dropclass"] = app_class + self.dropclass = app_class + logger.debug("Creating app drop using class: %s", app_class) + if self.dropclass is None or self.dropclass == "": + logger.warning(f"Something wrong with this node: {self.jd}") if self.weight is not None: execTime = self.weight if execTime < 0: @@ -1001,6 +1013,8 @@ def _create_data_drop(self, drop_spec): self.dropclass = "dlg.data.drops.file.FileDROP" elif self.category == "Memory": self.dropclass = "dlg.data.drops.memory.InMemoryDROP" + elif self.category == "SharedMemory": + self.dropclass = "dlg.data.drops.memory.SharedMemoryDROP" else: raise TypeError("Unknown data class for drop: %s", self.jd) logger.debug("Creating data drop using class: %s", self.dropclass) @@ -1047,6 +1061,8 @@ def make_single_drop(self, iid="0", **kwargs): drop_spec = self._create_gather_drops(drop_spec) elif self.is_service or self.is_branch: kwargs["categoryType"] = "Application" + self.jd["categoryType"] = "Application" + drop_spec = self._create_app_drop(drop_spec) kwargs["iid"] = iid kwargs["lg_key"] = self.id if self.is_branch: diff --git a/daliuge-translator/dlg/dropmake/pgtp.py b/daliuge-translator/dlg/dropmake/pgtp.py index 65e72a257..2d2d08de9 100644 --- a/daliuge-translator/dlg/dropmake/pgtp.py +++ b/daliuge-translator/dlg/dropmake/pgtp.py @@ -212,8 +212,12 @@ def _parse_metis_output(self, metis_out, jsobj): group_weight[gid] = [0, 0] for gnode in G.nodes(data=True): tt = group_weight[gnode[1]["gid"]] - tt[0] += gnode[1]["weight"] - tt[1] += gnode[1]["size"] + try: + tt[0] += int(gnode[1]["weight"]) + tt[1] += int(gnode[1]["size"]) + except ValueError: + tt[0] = 1 + tt[1] = 1 # the following is for visualisation using GOJS if jsobj is not None: node_list = jsobj["nodeDataArray"]