LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
plotTaskGraph.m
1function plotTaskGraph(self, method)
2% PLOTTASKGRAPH(SELF, METHOD)
3%
4% METHOD: nodes, names or ids
5
6% Copyright (c) 2012-2026, Imperial College London
7% All rights reserved.
8
9if nargin<2 %~exist('useNodes','var')
10 method = 'nodes';
11end
12
13lqn = self.getStruct;
14T = zeros(lqn.nhosts+lqn.ntasks);
15for h=1:lqn.nhosts
16 hidx = h;
17 for tidx=lqn.tasksof{h}
18 T(tidx,hidx) = 1;
19 end
20end
21for t=1:lqn.ntasks
22 tidx = lqn.tshift + t;
23 [calling_idx, called_entries] = find(lqn.iscaller(:, lqn.entriesof{tidx})); %#ok<ASGLU>
24 callers = intersect(lqn.tshift+(1:lqn.ntasks), unique(calling_idx)');
25 T(callers,tidx) = 1;
26end
27figure;
28switch method
29 case 'nodes'
30 plot(digraph(T),'Layout','layered','NodeLabel',{lqn.hashnames{1:(lqn.nhosts+lqn.ntasks)}});
31 case 'names'
32 plot(digraph(T),'Layout','layered','NodeLabel',{lqn.names{1:(lqn.nhosts+lqn.ntasks)}});
33 case 'ids'
34 plot(digraph(T),'Layout','layered');
35end
36title('Task graph');
37end
Definition mmt.m:92