-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdebug.cpp
112 lines (109 loc) · 3.09 KB
/
debug.cpp
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#include <stdio.h>
/*-----------------------------------------------------------------------------------------------------*/
/* Author: Sahil Malik 14/2/2018 */
void display()
{
cout<<"\tNodes: "<<nodes<<"\tProcessor: "<<n_proc<<endl<<"\n\tProcessing Cost Matrix\n";
for(int i=0;i<nodes;i++)
{
cout<<"\t";
for(int j=0;j<n_proc;j++)
cout<<weight[i][j]<<"\t";
cout<<endl;
}
cout<<"\n\t-------------Adj Matrix-------------\n";
for(int i=0;i<nodes;i++){
cout<<"\t";
for(int j=0;j<nodes;j++)
cout<<adj[i][j]<<" ";
cout<<endl;
}
cout<<"\n\t-------------Processor Matrix-------------\n";
for (int i = 0; i <n_proc; i++){
cout<<"\t";
for(int j=0;j<n_proc;j++)
cout<<identity[i][j]<<"\t";
cout<<endl<<endl;
}
}
/*-----------------------------------------------------------------------------------------------------*/
void show_PCT()
{
cout<<"\n\t-------------PCT-------------\n";
for(int i=0;i<nodes;i++)
{
cout<<"\tPROCESS "<<i+1;
for(int j=0;j<n_proc;j++)
{
printf("\tP[%d]: %d\t",j+1,PCT[i][j]);
}
cout<<endl;
}
}
/*-----------------------------------------------------------------------------------------------------*/
void show_RANK_PCT()
{
cout<<endl<<"\t-------------RANK PCT-------------\n";
for(int i=0;i<nodes;i++)
printf("\tP[%d]: %d\n",i+1,RANK_PCT[i]);
}
/*-----------------------------------------------------------------------------------------------------*/
void show_AEST()
{
cout<<endl<<"\t-------------AEST-------------\n";
for(int i=0;i<nodes;i++)
printf("\tP[%d]: %f\n",i+1,AEST[i]);
}
/*-----------------------------------------------------------------------------------------------------*/
void show_ALST()
{
cout<<endl<<"\t-------------ALST-------------\n";
for(int i=0;i<nodes;i++)
printf("\tP[%d]: %f\n",i+1,ALST[i]);
}
/*-----------------------------------------------------------------------------------------------------*/
void show_CNCT()
{
cout<<"\t-------------CNCT-------------\n";
for(int i=0;i<nodes;i++)
{
cout<<"\tPROCESS "<<i+1;
for(int j=0;j<n_proc;j++)
{
printf("\tP[%d]:%d\t",j+1,CNCT[i][j]);
}
cout<<endl<<endl;
}
}
/*-----------------------------------------------------------------------------------------------------*/
void show_CNP()
{
cout<<"\t-------------CNP-------------\n";
for(int i=0;i<nodes;i++){
printf("\tPROCESS[%d]:\t",i+1);
if(CNP[i]==false) cout<<"FALSE\n";
else cout<<"TRUE\n";
}
}
/*-----------------------------------------------------------------------------------------------------*/
void show_EFT()
{
cout<<"\t-------------EFT-------------\n";
for(int i=0;i<nodes;i++){
cout<<"\tPROCESS:"<<i+1<<"\t";
for(int j=0;j<n_proc;j++)
cout<<EFT[i][j]<<"\t";
cout<<endl;
}
}
/*-----------------------------------------------------------------------------------------------------*/
void show_EFT_CNCT()
{
cout<<"\t-------------EFT CNCT-------------\n";
for(int i=0;i<nodes;i++){
cout<<"\tPROCESS:"<<i+1<<"\t";
for(int j=0;j<n_proc;j++)
cout<<EFT_CNCT[i][j]<<"\t";
cout<<endl;
}
}