Skip to content

Commit

Permalink
add DynlibApp Drop type
Browse files Browse the repository at this point in the history
  • Loading branch information
chenwuperth committed Jun 20, 2017
1 parent 9fb488d commit 026aad7
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 2 deletions.
21 changes: 19 additions & 2 deletions dfms/dropmake/pg_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,6 @@ def _create_test_drop_spec(self, oid, kwargs):
fp = self.jd.get('filepath', None)
if (fp):
kwargs['filepath'] = fp

elif (drop_type == 'Component'): # default generic component becomes "sleep and copy"
dropSpec = dropdict({'oid':oid, 'type':'app', 'app':'test.graphsRepository.SleepApp'})
if 'execution_time' in self.jd:
Expand All @@ -531,6 +530,24 @@ def _create_test_drop_spec(self, oid, kwargs):
kwargs['tw'] = sleepTime
kwargs['sleepTime'] = sleepTime
kwargs['num_cpus'] = int(self.jd.get('num_cpus', 1))
dropSpec.update(kwargs)
elif (drop_type == 'DynlibApp'):
if ('libpath' not in self.jd or len(self.jd['libpath']) == 0):
raise GraphException("Missing 'libpath' in Drop {0}".format(self.text))
dropSpec = dropdict({'oid':oid, 'type':'app', 'app':'dfms.apps.dynlib.DynlibApp'})
kwargs['lib'] = self.jd['libpath']
kwargs['tw'] = int(self.jd['execution_time'])
for i in range(10):
k = "Arg%02d" % (i + 1,)
if not k in self.jd:
continue
v = self.jd[k]
if (v is not None and len(str(v)) > 0):
for kv in v.split(","): # comma separated k-v pairs
k_v = kv.replace(' ', '').split("=")
if (len(k_v) > 1):
kwargs[k_v[0]] = k_v[1]

dropSpec.update(kwargs)
elif (drop_type in ['BashShellApp', 'mpi']):
if (drop_type == 'mpi'):
Expand Down Expand Up @@ -1756,7 +1773,7 @@ def _link_drops(self, slgn, tlgn, src_drop, tgt_drop):
s_type = slgn.jd['category']
t_type = tlgn.jd['category']

if (s_type in ['Component', 'BashShellApp', 'mpi']):
if (s_type in ['Component', 'BashShellApp', 'mpi', 'DynlibApp']):
sdrop.addOutput(tdrop)
tdrop.addProducer(sdrop)
if ('BashShellApp' == s_type):
Expand Down
30 changes: 30 additions & 0 deletions dfms/dropmake/web/lg_editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,32 @@
makePort("B", go.Spot.Bottom, true, true)
));

myDiagram.nodeTemplateMap.add("DynlibApp", // the Component category
$(go.Node, "Spot", nodeStyle(),
// the Component (Application DROP) is a Panel that surrounds a TextBlock with a rectangular Shape
$(go.Panel, "Auto",
$(go.Shape, "YinYang",
{ fill: "#00A9C9", stroke: "#00A9C9" },
new go.Binding("figure", "figure")),
$(go.TextBlock,
{
font: "11pt Helvetica, Arial, sans-serif",
stroke: "black",
margin: 8,
maxSize: new go.Size(160, NaN),
textAlign: "center",
wrap: go.TextBlock.WrapFit,
editable: true
},
new go.Binding("text").makeTwoWay())
),
// four named ports, one on each side:
makePort("T", go.Spot.Top, true, true),
makePort("L", go.Spot.Left, true, true),
makePort("R", go.Spot.Right, true, true),
makePort("B", go.Spot.Bottom, true, true)
));

myDiagram.nodeTemplateMap.add("memory", // the Component category
$(go.Node, "Spot", nodeStyle(),
// the Component (Application DROP) is a Panel that surrounds a TextBlock with a rectangular Shape
Expand Down Expand Up @@ -1291,6 +1317,10 @@
num_cpus: 1, group_start: 0,
Arg01: "", Arg02: "", Arg03: "", Arg04: "", Arg05: "",
Arg06: "", Arg07: "", Arg08: "", Arg09: "", Arg10: ""},
{ category: "DynlibApp", text: "DynLib", execution_time: 5,
num_cpus: 1, group_start: 0, libpath: "",
Arg01: "", Arg02: "", Arg03: "", Arg04: "", Arg05: "",
Arg06: "", Arg07: "", Arg08: "", Arg09: "", Arg10: ""},
{ category: "memory", text: "InMemory\nDrop", data_volume: 5, group_end: 0},
{ category: "file", text: "FileDrop", data_volume: 5, group_end: 0,
check_filepath_exists: "1", filepath: "", dirname: ""},
Expand Down

0 comments on commit 026aad7

Please sign in to comment.