-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_timing_study.m
42 lines (33 loc) · 1.09 KB
/
run_timing_study.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
% Start cluster
cluster = parcluster('cheyenne-R2020a')
% Create Communcaiting Jobs
j1 = createCommunicatingJob(cluster);
j2 = createCommunicatingJob(cluster);
j3 = createCommunicatingJob(cluster);
j4 = createCommunicatingJob(cluster);
j5 = createCommunicatingJob(cluster);
% Create tasks
createTask(j1, @main, 1, {});
createTask(j2, @main, 1, {});
createTask(j3, @main, 1, {});
createTask(j4, @main, 1, {});
createTask(j5, @main, 1, {});
% Submit jobs
submit(j1); submit(j2); submit(j3); submit(j4); submit(j5);
% Wait for the jobs to finish
wait(j1); wait(j2); wait(j3); wait(j4); wait(j5);
% Fetch outputs
out1 = fetchOutputs(j1);
out2 = fetchOutputs(j2);
out3 = fetchOutputs(j3);
out4 = fetchOutputs(j4);
out5 = fetchOutputs(j5);
% Calculate mean and standard deviatation
outVector = [out1{:} out2{:} out3{:} out4{:} out5{:}];
outBar = mean(outVector);
outStd = std(outVector);
% Display the mean and standard deviation
disp(['The sample mean is: ', num2str(outBar)]);
disp(['The standard deviation is: ', num2str(outStd)]);
% Delete the jobs
delete(j1); delete(j2); delete(j3); delete(j4); delete(j5);