Commit a14e175b authored by Ziwen Su's avatar Ziwen Su

Optimized Jobtag function.

parent cc9e8c30
......@@ -132,19 +132,19 @@
<p-overlayPanel #jobtags [showCloseIcon]="true">
<div class="p-grid p-dir-col">
<div class="p-col">
<p-checkbox name="jobtag1" label="memory-bound" [(ngModel)]="jobtag_1" binary="true" (onChange)="checkJobtags()"></p-checkbox>
<p-checkbox name="jobtag1" label="memory-bound" [(ngModel)]="jobtag_bool[0]" binary="true" (onChange)="checkJobtags()"></p-checkbox>
</div>
<div class="p-col">
<p-checkbox name="jobtag2" label="compute-bound" [(ngModel)]="jobtag_2" binary="true" (onChange)="checkJobtags()"></p-checkbox>
<p-checkbox name="jobtag2" label="compute-bound" [(ngModel)]="jobtag_bool[1]" binary="true" (onChange)="checkJobtags()"></p-checkbox>
</div>
<div class="p-col">
<p-checkbox name="jobtag5" label="gpu-bound" [(ngModel)]="jobtag_16" binary="true" (onChange)="checkJobtags()"></p-checkbox>
<p-checkbox name="jobtag5" label="gpu-bound" [(ngModel)]="jobtag_bool[4]" binary="true" (onChange)="checkJobtags()"></p-checkbox>
</div>
<div class="p-col">
<p-checkbox name="jobtag3" label="io-heavy" [(ngModel)]="jobtag_4" binary="true" (onChange)="checkJobtags()"></p-checkbox>
<p-checkbox name="jobtag3" label="io-heavy" [(ngModel)]="jobtag_bool[2]" binary="true" (onChange)="checkJobtags()"></p-checkbox>
</div>
<div class="p-col">
<p-checkbox name="jobtag4" label="network-heavy" [(ngModel)]="jobtag_8" binary="true" (onChange)="checkJobtags()"></p-checkbox>
<p-checkbox name="jobtag4" label="network-heavy" [(ngModel)]="jobtag_bool[3]" binary="true" (onChange)="checkJobtags()"></p-checkbox>
</div>
</div>
</p-overlayPanel>
......
......@@ -28,40 +28,6 @@ const convert_time_in_seconds_dict = {
'd': 86400,
'y': 31536000
}
const convert_jobtag_dict = {
0: null,
1:"memory-bound",
2:"compute-bound",
3:"memory-bound and 1 more",
4:"io-heavy",
5:"memory-bound and 1 more",
6:"compute-bound and 1 more",
7:"memory-bound and 2 more",
8:"network-heavy",
9:"memory-bound and 1 more",
10:"compute-bound and 1 more",
11:"memory-bound and 2 more",
12:"io-heavy and 1 more",
13:"memory-bound and 2 more",
14:"compute-bound and 2 more",
15:"memory-bound and 3 more",
16:"gpu-bound",
17:"memory-bound and 1 more",
18:"compute-bound and 1 more",
19:"memory-bound and 2 more",
20:"gpu-bound and 1 more",
21:"memory-bound and 2 more",
22:"compute-bound and 2 more",
23:"memory-bound and 3 more",
24:"gpu-bound and 1 more",
25:"memory-bound and 2 more",
26:"compute-bound and 2 more",
27:"memory-bound and 3 more",
28:"gpu-bound and 2 more",
29:"memory-bound and 3 more",
30:"compute-bound and 3 more",
31:"memory-bound and 4 more"
}
class ValueInterval {
caption: string;
......@@ -162,17 +128,8 @@ export class SearchComponent implements OnInit {
nodename: string;
jobtag_1: boolean;
jobtag_2: boolean;
jobtag_4: boolean;
jobtag_8: boolean;
jobtag_16: boolean;
jobtag_bool: boolean[];
jobtag_sum: number;
jobtag_str1: number;
jobtag_str2: number;
jobtag_str4: number;
jobtag_str8: number;
jobtag_str16: number;
selected_jobtags: string;
footprints: string[];
......@@ -231,7 +188,7 @@ export class SearchComponent implements OnInit {
{label: 'Exclusive', value: '1'},
{label: 'Shared', value: '0'}
];
this.partitions = this.monitoringservice.getPartitions();
this.partitions = this.monitoringservice.getPartitions("list");
this.footprints = [];
for (let label in convert_footprint_dict) {
......@@ -308,11 +265,11 @@ export class SearchComponent implements OnInit {
this.jobstatus = searchStorage['STATUS'];
if ( searchStorage['TAGS'] ) {
this.jobtag_sum = Number(searchStorage['TAGS']);
this.jobtag_1= (localStorage.getItem('JTAGA'))==='true';
this.jobtag_2= (localStorage.getItem('JTAGB'))==='true';
this.jobtag_4= (localStorage.getItem('JTAGC'))==='true';
this.jobtag_8= (localStorage.getItem('JTAGD'))==='true';
this.jobtag_16= (localStorage.getItem('JTAGE'))==='true';
this.jobtag_bool[0] = (localStorage.getItem('JTAGA'))==='true';
this.jobtag_bool[1] = (localStorage.getItem('JTAGB'))==='true';
this.jobtag_bool[2] = (localStorage.getItem('JTAGC'))==='true';
this.jobtag_bool[3] = (localStorage.getItem('JTAGD'))==='true';
this.jobtag_bool[4] = (localStorage.getItem('JTAGE'))==='true';
this.selected_jobtags = localStorage.getItem('SELECTED_JTG');
}
......@@ -467,17 +424,8 @@ export class SearchComponent implements OnInit {
this.jobname = null;
this.nodename = null;
this.jobtag_1 = false;
this.jobtag_2 = false;
this.jobtag_4 = false;
this.jobtag_8 = false;
this.jobtag_16 = false;
this.jobtag_bool = [false, false, false, false, false];
this.jobtag_sum = null;
this.jobtag_str1 = null;
this.jobtag_str2 = null;
this.jobtag_str4 = null;
this.jobtag_str8 = null;
this.jobtag_str16 = null;
this.selected_jobtags = null;
this.footprint_code = null;
this.footprint_name = null;
......@@ -554,28 +502,28 @@ export class SearchComponent implements OnInit {
}
}
checkJobtags(){
if ( this.jobtag_1 )
this.jobtag_str1=1;
else
this.jobtag_str1=0;
if ( this.jobtag_2 )
this.jobtag_str2=2;
else
this.jobtag_str2=0;
if ( this.jobtag_4 )
this.jobtag_str4=4;
else
this.jobtag_str4=0;
if ( this.jobtag_8 )
this.jobtag_str8=8;
else
this.jobtag_str8=0;
if ( this.jobtag_16 )
this.jobtag_str16=16;
else
this.jobtag_str16=0;
this.jobtag_sum= this.jobtag_str1 + this.jobtag_str2 + this.jobtag_str4 + this.jobtag_str8 + this.jobtag_str16;
this.selected_jobtags = convert_jobtag_dict[this.jobtag_sum];
this.jobtag_sum= Number(this.jobtag_bool[0]) + Number(this.jobtag_bool[1])*2 + Number(this.jobtag_bool[2])*4 + Number(this.jobtag_bool[3])*8 + Number(this.jobtag_bool[4])*16;
var jobtag_display;
if ( this.jobtag_bool[0] ){
jobtag_display = "memory-bound";
} else if ( this.jobtag_bool[1] ){
jobtag_display = "compute-bound";
} else if ( this.jobtag_bool[4] ){
jobtag_display = "gpu-bound";
} else if ( this.jobtag_bool[2] ){
jobtag_display = "io-heavy";
} else if ( this.jobtag_bool[3] ){
jobtag_display = "network-heavy";
}
var jobtag_num;
jobtag_num = Number(this.jobtag_bool[0]) + Number(this.jobtag_bool[1]) + Number(this.jobtag_bool[2]) + Number(this.jobtag_bool[3]) + Number(this.jobtag_bool[4]);
if ( jobtag_num == 0 ){
this.selected_jobtags = null;
} else if ( jobtag_num == 1 ){
this.selected_jobtags = jobtag_display;
} else {
this.selected_jobtags = `${jobtag_display} and ${jobtag_num-1} more`;
}
}
filterFootprint(event: any) {
this.filteredFootprint = [];
......@@ -655,11 +603,11 @@ export class SearchComponent implements OnInit {
}
}
localStorage.setItem('JTAGA', this.jobtag_1.toString());
localStorage.setItem('JTAGB', this.jobtag_2.toString());
localStorage.setItem('JTAGC', this.jobtag_4.toString());
localStorage.setItem('JTAGD', this.jobtag_8.toString());
localStorage.setItem('JTAGE', this.jobtag_16.toString());
localStorage.setItem('JTAGA', this.jobtag_bool[0].toString());
localStorage.setItem('JTAGB', this.jobtag_bool[1].toString());
localStorage.setItem('JTAGC', this.jobtag_bool[2].toString());
localStorage.setItem('JTAGD', this.jobtag_bool[3].toString());
localStorage.setItem('JTAGE', this.jobtag_bool[4].toString());
if ( this.jobtag_sum && this.jobtag_sum != 0 ){
this.monitoringservice.addFilterItem('TAGS', this.jobtag_sum.toString());
}
......
......@@ -16,7 +16,7 @@ export class MonitoringService {
global_end: any;
filterData: any;
backend_url: string;
partition_list: string[];
Partition_struktur: string[];
activeComponent: string;
lastURL: string;
show_detailed_footprints: boolean;
......@@ -339,8 +339,10 @@ export class MonitoringService {
getDetailedFootprints() {
return this.show_detailed_footprints;
}
getPartitions(){
return this.appConfig.getConfig().Partition_list.name;
getPartitions(key: any){
if ( key == "list" ){
return this.appConfig.getConfig().Partition_struktur.list;
}
}
}
......@@ -3,7 +3,7 @@
"backend_url": "http://localhost/php/",
"footprint_url": "https://hpcmon.zih.tu-dresden.de/"
},
"Partition_list":{
"name": ["broadwell", "gpu", "haswell", "hpdlf", "ifm", "interactive", "ml", "nvme", "romeo", "sandy", "sl", "smp", "test", "triton", "vis", "west"]
"Partition_struktur":{
"list": ["broadwell", "gpu", "haswell", "hpdlf", "ifm", "interactive", "ml", "nvme", "romeo", "sandy", "sl", "smp", "test", "triton", "vis", "west"]
}
}
\ 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