source: XIOS3/trunk/xios_test_suite/HTML/generate_compile_table.js @ 2418

Last change on this file since 2418 was 1913, checked in by yushan, 4 years ago

trunk : update html

File size: 6.2 KB
Line 
1var compile_dict={"-1": "❌", "1": "✅"}
2function generateCompileTable()
3{
4  var machine_list=[];
5  var machine_revision_list=[];
6  var machine_full_name_list=[];
7  var machine_info_list=[];
8
9  if(typeof jeanzay_revision_list != 'undefined') 
10  {
11    machine_list.push("jeanzay");
12    machine_revision_list.push("jeanzay_revision_list")
13    machine_full_name_list.push("Jean-Zay")
14    machine_info_list.push("jeanzay_compile_info_list")
15  }
16 
17  if (typeof irene_revision_list != 'undefined') 
18  {
19    machine_list.push("irene");
20    machine_revision_list.push("irene_revision_list")
21    machine_full_name_list.push("Irene")
22    machine_info_list.push("irene_compile_info_list")
23  }
24 
25  if (typeof other_revision_list != 'undefined') 
26  {
27    machine_list.push("other");
28    machine_revision_list.push("other_revision_list")
29    machine_full_name_list.push("Other")
30    machine_info_list.push("other_compile_info_list")
31  }
32
33  var revision_list=[]
34
35  for (var i=0; i<machine_list.length; i++)
36  {
37    tmp_list = eval(machine_revision_list[i])
38
39    for (var j=0; j<tmp_list.length; j++)
40    {
41      if (revision_list.includes(tmp_list[j]) == false)
42      {
43        revision_list.push(tmp_list[j])
44      }
45    }
46  }
47
48  revision_list.sort(function(a, b){return b-a});
49 
50 
51  // Generate select list for compile table
52
53  var sel = document.getElementById("revision");
54
55  var sel_options = sel.children
56 
57  var new_options=[]
58  for(var i=0; i<sel_options.length-1; i++)
59  {
60    new_options[i] = sel_options[i+1].value
61  }
62 
63  for(var i=0; i<revision_list.length; i++)
64  {
65    if (!new_options.includes(revision_list[i]))
66    {
67      new_options.push(revision_list[i])
68    }
69  }
70 
71  new_options.sort(function(a, b){return b-a})
72 
73  while (sel.lastChild && sel.children.length>1) {
74    sel.removeChild(sel.lastChild);
75  }
76
77  for(var i=0; i<new_options.length; i++)
78  {
79    var opt = document.createElement('option');
80    opt.appendChild( document.createTextNode(new_options[i]));
81    opt.value = new_options[i]; 
82    sel.appendChild(opt);
83  }
84 
85  // Generate content of compile table
86 
87 
88  var table = document.getElementById("compile_table")
89  table.style.backgroundColor = "#84c5ff";
90  table.setAttribute("class", "compile_table")
91  table.setAttribute("id", "compile_table")
92
93  var titelRow = document.getElementById("compile_table_row0")
94  var myCell = document.createElement("TD");
95  myCell.style.maxWidth="100px"
96  myCell.innerHTML = ("Revision");
97  titelRow.appendChild(myCell)
98
99  for (var machine_index=0; machine_index<machine_list.length; machine_index++)
100  {
101    var myCell = document.createElement("TD");
102    myCell.style.minWidth="500px"
103    myCell.innerHTML = (machine_full_name_list[machine_index]);
104    titelRow.appendChild(myCell)
105  }
106
107  var emptyRow = document.createElement("tr")
108  emptyRow.setAttribute("id", "empty_compile_row")
109  emptyRow.style.display="none"
110  table.appendChild(emptyRow)
111 
112  var myCell = document.createElement("TD");
113  myCell.setAttribute("id", "empty_compile_row_revision")
114  myCell.style.fontWeight="bold"
115  emptyRow.appendChild(myCell)
116
117  for (var machine_index=0; machine_index<machine_list.length; machine_index++)
118  {
119    var myCell = document.createElement("TD");
120    myCell.innerHTML="No Compile Information"
121    myCell.style.color="white"
122    emptyRow.appendChild(myCell)
123  }
124
125  for (var i=0; i<revision_list.length; i++)
126  {
127    var revision = revision_list[i]
128
129    var myRow = document.createElement("TR");
130    myRow.setAttribute("id", "compile_table_"+revision);
131    myRow.setAttribute("class", "compile_table_row");
132    table.appendChild(myRow)
133   
134    var myCell = document.createElement("TD");
135    myCell.innerHTML = (revision);
136    myCell.style.fontWeight = "bold";
137    myRow.appendChild(myCell)
138   
139    for( var j=0; j<machine_list.length; j++)
140    {
141      var machine = machine_list[j]
142      var myCell = document.createElement("TD");
143      myCell.setAttribute("id", "compile_table_"+revision+"_"+machine);
144      myRow.appendChild(myCell)
145    }       
146
147  }
148
149  for (var i=0; i<revision_list.length; i++)
150  {
151    var revision = revision_list[i]
152    for ( var j=0; j<machine_list.length; j++)
153    {
154      var machine = machine_list[j]
155      fillSubCompileTable(revision, machine, machine_info_list[j], machine_revision_list[j])
156    }
157  }
158
159}
160
161
162
163function fillSubCompileTable(revision, machine, machine_compile_info, machine_revision)
164{
165  var compile_info = eval(machine_compile_info)
166  var revision_list = eval(machine_revision)
167
168  var myTD = document.getElementById("compile_table_"+revision+"_"+machine);
169  if (!revision_list.includes(revision))
170  {
171    myTD.innerHTML="No Compile Information"
172    myTD.style.color="white"
173  }
174  else
175  {
176    var part_compile_info = []
177    var tmp_mode_list = []
178    var tmp_arch_list = []
179    for(var i=0; i<compile_info.length; i++)
180    {
181      if (revision == compile_info[i][0])
182      {
183        part_compile_info.push(compile_info[i])
184        if (!tmp_mode_list.includes(compile_info[i][3]))
185        {
186          tmp_mode_list.push(compile_info[i][3])
187        }
188        if (!tmp_arch_list.includes(compile_info[i][2]))
189        {
190          tmp_arch_list.push(compile_info[i][2])
191        }
192      }
193    }
194
195    mySubTable = document.createElement("table")
196    mySubTable.setAttribute("class", "compile_sub_table")
197    myTD.appendChild(mySubTable)
198
199    myRow = document.createElement("tr")
200    mySubTable.appendChild(myRow)
201    myCell = document.createElement("td")
202    myRow.appendChild(myCell)
203    for (var j=0; j<tmp_mode_list.length; j++)
204    {
205      myCell = document.createElement("td")
206      myCell.innerHTML=(tmp_mode_list[j])
207      myRow.appendChild(myCell)
208    }
209
210    for (var j=0; j<tmp_arch_list.length; j++)
211    {
212      myRow = document.createElement("tr")
213      mySubTable.appendChild(myRow)
214
215      myCell = document.createElement("td")
216      myCell.innerHTML = (tmp_arch_list[j])
217      myRow.appendChild(myCell)
218
219     
220      for(var i=0; i<tmp_mode_list.length; i++)
221      {
222        myCell = document.createElement("td")
223        for (var k=0; k<part_compile_info.length; k++)
224        {
225          if(part_compile_info[k][2] == tmp_arch_list[j] && part_compile_info[k][3] == tmp_mode_list[i])
226          {
227            myCell.innerHTML = compile_dict[part_compile_info[k][4]]
228            break
229          }
230        }       
231        myRow.appendChild(myCell)
232      }
233    }
234  }
235
236 
237}
Note: See TracBrowser for help on using the repository browser.