source: XIOS/dev/dev_trunk_omp/xios_test_suite/HTML/generate_compile_table.js @ 1844

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

dev_trunk_omp : add xios_test_suite folder

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