Commit 4a652ea9 authored by Ziwen Su's avatar Ziwen Su

Modified somethings about the getPartition-function.

parent 72af970f
......@@ -138,24 +138,13 @@ export class JobChartComponent extends JobBaseComponent {
this.timelines = [];
var partition = "broadwell";
var list:string[] = this.monitoringservice.getPartitions("list");
var list:string[] = this.monitoringservice.getPartitions();
for(let i = 0; i < list.length; i++){
if ( rows[0]["PARTITION"].includes(list[i]) ){
partition = list[i];
}
}
var displays:string[] = this.monitoringservice.getPartitions(partition);
if ( displays[0] == "DefaultDisplay" ){
displays = this.monitoringservice.getPartitions("default");
} else if ( displays[0] == "DefaultPrefix" ){
if ( displays.length == 1 ){
displays = this.monitoringservice.getPartitions("prefix");
} else{
displays.shift();
var displaysprefix: string[] = this.monitoringservice.getPartitions("prefix");
displays = displaysprefix.concat(displays);
}
}
var displays:string[] = this.monitoringservice.getDisplays(partition);
/* we replaced cpi with ipc on Wednesday, July 17 2019 at 2pm */
if ( Number(this.job_start) < 1563364800 ){
displays[2] = "cpi";
......
......@@ -188,7 +188,7 @@ export class SearchComponent implements OnInit {
{label: 'Exclusive', value: '1'},
{label: 'Shared', value: '0'}
];
this.partitions = this.monitoringservice.getPartitions("list");
this.partitions = this.monitoringservice.getPartitions();
this.footprints = [];
for (let label in convert_footprint_dict) {
......
......@@ -339,14 +339,22 @@ export class MonitoringService {
getDetailedFootprints() {
return this.show_detailed_footprints;
}
getPartitions(key: string){
if ( key == "list" ){
return Object.keys(this.appConfig.getConfig().PartitionConfig);
} else if ( key == "default" || key == "prefix" ){
return this.appConfig.getConfig().DefaultDisplays[key];
getPartitions(){
return Object.keys(this.appConfig.getConfig().PartitionConfig);
}
getDisplays(partition: string){
var display_config = this.appConfig.getConfig().PartitionConfig[partition]["displays"];
if ( display_config.length > 1 ){
var displaysprefix: string[] = this.appConfig.getConfig().DefaultTimelinesTop;
display_config = displaysprefix.concat(display_config);
display_config.splice(8,1);
} else {
return this.appConfig.getConfig().PartitionConfig[key]["displays"];
display_config = this.appConfig.getConfig().DefaultTimelinesTop;
}
if ( partition == "ml" ) {
display_config[3] = "local_io";
display_config[5] = "local_io_meta";
}
return display_config;
}
}
......@@ -3,58 +3,60 @@
"backend_url": "http://localhost/php/",
"footprint_url": "https://hpcmon.zih.tu-dresden.de/"
},
"DefaultDisplays":{
"default":["cpu_usage", "mem_used", "ipc", "io", "flops", "io_meta", "mem_bw", "infiniband_bw", "cpu_power"],
"prefix":["cpu_usage", "mem_used", "ipc", "io", "flops", "io_meta", "mem_bw", "infiniband_bw"]
},
"DefaultTimelinesTop": [
"cpu_usage", "mem_used",
"ipc", "io",
"flops", "io_meta",
"mem_bw", "infiniband_bw"
],
"PartitionConfig":{
"broadwell":{
"displays":["DefaultDisplay"]
"displays":["DefaultTimelinesTop", "cpu_power"]
},
"gpu":{
"displays":["DefaultPrefix", "gpu_usage", "gpu_power", "gpu_mem", "gpu_temperature", "cpu_power"]
"displays":["DefaultTimelinesTop", "gpu_usage", "gpu_power", "gpu_mem", "gpu_temperature", "cpu_power"]
},
"haswell":{
"displays":["DefaultDisplay"]
"displays":["DefaultTimelinesTop", "cpu_power"]
},
"hpdlf":{
"displays":["DefaultPrefix", "gpu_usage", "gpu_power", "gpu_mem", "gpu_temperature", "cpu_power"]
"displays":["DefaultTimelinesTop", "gpu_usage", "gpu_power", "gpu_mem", "gpu_temperature", "cpu_power"]
},
"ifm":{
"displays":["DefaultDisplay"]
"displays":["DefaultTimelinesTop", "cpu_power"]
},
"interactive":{
"displays":["DefaultDisplay"]
"displays":["DefaultTimelinesTop", "cpu_power"]
},
"ml":{
"displays":["cpu_usage", "mem_used", "ipc", "local_io", "flops", "local_io_meta", "mem_bw", "infiniband_bw", "gpu_usage", "gpu_power", "gpu_mem", "gpu_temperature"]
"displays":["DefaultTimelinesTop", "gpu_usage", "gpu_power", "gpu_mem", "gpu_temperature"]
},
"nvme":{
"displays":["DefaultDisplay"]
"displays":["DefaultTimelinesTop", "cpu_power"]
},
"romeo":{
"displays":["DefaultDisplay"]
"displays":["DefaultTimelinesTop", "cpu_power"]
},
"sandy":{
"displays":["DefaultDisplay"]
"displays":["DefaultTimelinesTop", "cpu_power"]
},
"sl":{
"displays":["DefaultDisplay"]
"displays":["DefaultTimelinesTop", "cpu_power"]
},
"smp":{
"displays":["DefaultDisplay"]
"displays":["DefaultTimelinesTop", "cpu_power"]
},
"test":{
"displays":["DefaultDisplay"]
"displays":["DefaultTimelinesTop", "cpu_power"]
},
"triton":{
"displays":["DefaultDisplay"]
"displays":["DefaultTimelinesTop", "cpu_power"]
},
"vis":{
"displays":["DefaultDisplay"]
"displays":["DefaultTimelinesTop", "cpu_power"]
},
"west":{
"displays":["DefaultPrefix"]
"displays":["DefaultTimelinesTop"]
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment