0
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1 % REPO_TEST_OBJ_NUMBER Test repository submission/retrieval of different
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
2 % number of AOs of the same size
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
3 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
4 % M HUeller 05-12-08
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
5 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
6 % $Id: repo_test_obj_number.m,v 1.7 2009/03/02 16:28:19 mauro Exp $
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
7 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
8 function results = repo_test_obj_number()
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
9
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
10 %% Prepares the plist for AOs
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
11 NSECS = 3.6e3;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
12
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
13 % nobjs = [linspace(1,10,10) linspace(20,100,9) linspace(200,1000,9)]';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
14 nobjs = [linspace(1,10,10) linspace(20,60,3)]';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
15
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
16 NOBJS_STEPS = length(nobjs);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
17
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
18 n_freqs = 10;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
19 fs = 10;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
20 f_m = linspace(0.001, 0.01, n_freqs);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
21 A = linspace(0.1, 1, n_freqs);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
22 phi = linspace(0, pi, n_freqs);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
23
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
24 pl_ao = plist('waveform', 'sine wave', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
25 'fs', fs, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
26 'f', f_m, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
27 'A', A, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
28 'phi', phi, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
29 'nsecs', NSECS);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
30
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
31
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
32
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
33 %% Prepares a plist with the needed parameters
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
34 pl_run = plist('RAND_N_OBJ', false, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
35 'N_OBJ', [], ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
36 'OBJ_TYPE', 'ao', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
37 'RAND_AO', false, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
38 'AO_PARAMS', pl_ao, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
39 'HOSTNAME', 'btlab.science.unitn.it', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
40 'DBASE', 'ltpda_test', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
41 'SAVE_OBJS', false, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
42 'SUBMIT', true, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
43 'CONN', [], ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
44 'SAVE_RESULTS', false, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
45 'DIR', [], ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
46 'RESULTS_FILENAME','repo_test' ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
47 );
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
48
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
49 % Empty arrays for the results
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
50 results = cell(NOBJS_STEPS, 1);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
51 ret_time_xml = zeros(NOBJS_STEPS, 1);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
52 ret_time_bin = zeros(NOBJS_STEPS, 1);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
53 sub_time = zeros(NOBJS_STEPS, 1);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
54
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
55 %% Runs the tests with AOs
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
56
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
57 for kk = 1 : NOBJS_STEPS
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
58 results{kk} = repo_test_func(pl_run.pset('N_OBJ', nobjs(kk)));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
59 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
60
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
61 %% Puts together a report
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
62 import utils.const.*
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
63 utils.helper.msg(msg.MNAME, '%s\n%s\n%s\n%s\n%s\n%s\n%s', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
64 ' ','%%%%%%%%%%%%%',' ',...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
65 ['Test started at: ' datestr(find(results{1}, 'start_time')) ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
66 ' and ended at: ' datestr(find(results{end}, 'stop_time'))], ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
67 ' ','%%%%%%%%%%%%%',' ');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
68
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
69 % TODO: add more info here (which repo etc)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
70
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
71 % Collects the results into a matrix
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
72 for kk = 1 : NOBJS_STEPS
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
73 ret_time_xml(kk) = find(results{kk}, 'ret_time_xml');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
74 ret_time_bin(kk) = find(results{kk}, 'ret_time_bin');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
75 sub_time(kk) = find(results{kk}, 'sub_time');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
76 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
77
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
78 % Plot submit times for objects as a function of number of objects
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
79 fig_sub_time = figure;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
80 plot(nobjs, sub_time, 'b.');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
81 hold on;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
82 grid on;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
83
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
84 xlabel('Number of objs []');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
85 ylabel('Submit time [s]');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
86 title(['AO, fs = ' num2str(fs) ' nsecs = ' num2str(NSECS) ' s']);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
87 legend('XML + Binary submission');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
88
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
89
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
90 % Plot retrieval times for objects as a function of object size
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
91 fig_ret_time = figure;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
92 plot(nobjs, ret_time_xml, 'b.');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
93 hold on;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
94 plot(nobjs, ret_time_bin, 'r.');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
95 grid on;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
96
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
97 xlabel('Number of objs []');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
98 ylabel('Retrieval time [s]');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
99 title(['AO, fs = ' num2str(fs) ' nsecs = ' num2str(NSECS) ' s']);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
100 legend('XML retrieval','Binary retrieval');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
101
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
102
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
103 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
104 % END |