-
Notifications
You must be signed in to change notification settings - Fork 2
/
plotNumOp.m
42 lines (34 loc) · 963 Bytes
/
plotNumOp.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
clear all, close all, clc
% load files from 0 -> mpi.size
maxSize = 128;
numOpArray = zeros(maxSize,maxSize);
filename = 'numOp_rank';
filetype = 'txt';
% loop files
for i = 0 : maxSize-1
% read formatted file
fid = fopen(['stout/',filename,num2str(i),'_830268.txt']);
if fid==-1 % file not found
else
data = textscan(fid, '%d %d %u64'); % myrank, mpi.size, myCounter
fclose(fid);
numOpArray(i +1,data{2}(:)) = data{3}(:)';
numSizeArray(i +1,data{2}(:)) = data{2}(:)';
end
end
%% sum
totOpVec = sum(numOpArray,1);
%% plot
figure(1),clf
[I,J] = find(numSizeArray);
plot(numSizeArray(I,J),numOpArray(I,J),'x')
xlabel('mpi.size')
ylabel('"number of loops" per process')
grid on
set(gca,'XScale','log','YScale','log')
figure(2),clf
plot(numSizeArray(1,numSizeArray(1,:)>0),totOpVec(numSizeArray(1,:)>0),'x')
xlabel('mpi.size')
ylabel('total "number of loops"')
grid on
set(gca,'XScale','lin','YScale','log')