Commit ed5edb68 authored by Frank Winkler's avatar Frank Winkler

Revert "Merge remote-tracking branch 'upstream/master'"

This reverts commit 20dfe643
parent 20dfe643
......@@ -19,12 +19,12 @@
'NODENAME' => ['(NODELIST LIKE :node1 OR CPULIST LIKE :node2)', [':node1', ':node2']],
'TAGS' => ['TAGS = :tags',':tags'],
'NUM_NODES_INT' => ['NUM_NODES BETWEEN :min_nodes AND :max_nodes', [':min_nodes', ':max_nodes']],
'NUM_CORES_INT' => ['NUM_CORES BETWEEN :min_cores AND :max_cores', [':min_cores', ':max_cores']],
'WALLTIME_INT' => ['WALLTIME BETWEEN :min_walltime AND :max_walltime', [':min_walltime', ':max_walltime']],
'PENDING_INT' => ['(START-SUBMIT) BETWEEN :min_pending AND :max_pending', [':min_pending', ':max_pending']],
'DURATION_INT' => ['(END-START) BETWEEN :min_duration AND :max_duration', [':min_duration', ':max_duration']],
'CORE_DURATION_INT' => ['(NUM_CORES*(END-START)) BETWEEN :min_core_duration AND :max_core_duration', [':min_core_duration', ':max_core_duration']],
'NUM_NODES_INT' => ['NUM_NODES BETWEEN :min_nodes AND :max_nodes', 'NUM_NODES >=:min_nodes', 'NUM_NODES <=:max_nodes', [':min_nodes', ':max_nodes']],
'NUM_CORES_INT' => ['NUM_CORES BETWEEN :min_cores AND :max_cores', 'NUM_CORES >=:min_cores', 'NUM_CORES <=:max_cores', [':min_cores', ':max_cores']],
'WALLTIME_INT' => ['WALLTIME BETWEEN :min_walltime AND :max_walltime', 'WALLTIME >=:min_walltime', 'WALLTIME <=:max_walltime', [':min_walltime', ':max_walltime']],
'PENDING_INT' => ['(START-SUBMIT) BETWEEN :min_pending AND :max_pending', '(START-SUBMIT) >=:min_pending', '(START-SUBMIT) <=:max_pending', [':min_pending', ':max_pending']],
'DURATION_INT' => ['(END-START) BETWEEN :min_duration AND :max_duration', '(END-START) >=:min_duration', '(END-START) <=:max_duration', [':min_duration', ':max_duration']],
'CORE_DURATION_INT' => ['(NUM_CORES*(END-START)) BETWEEN :min_core_duration AND :max_core_duration', '(NUM_CORES*(END-START)) >=:min_core_duration', '(NUM_CORES*(END-START)) <=:max_core_duration', [':min_core_duration', ':max_core_duration']],
'IPC_MAX' => ['ipc_mean_per_core <= :ipcmax',':ipcmax'],
'FLOPS_MAX' => ['flops_any_mean_per_core <= :flopsmax',':flopsmax'],
......@@ -68,14 +68,20 @@
} elseif ( $key == "NODENAME" ) {
$sql .= "AND ".$filterArray[$key][0]." ";
$attributes[$filterArray[$key][1][0]] = $value;
$attributes[$filterArray[$key][1][1]] = $value;
$attributes[$filterArray[$key][1][1]] = $value;
} elseif ( strpos($key, '_INT') !== false ) {
$sql .= "AND ".$filterArray[$key][0]." ";
//convert value string to array
$values = explode(" ", $value);
$attributes[$filterArray[$key][1][0]] = $values[0];
$attributes[$filterArray[$key][1][1]] = $values[1];
$items = explode(" ", $value);
if ( !is_numeric($items[1]) ){
$sql .= "AND ".$filterArray[$key][1]." ";
$attributes[$filterArray[$key][3][0]] = $items[0];
} elseif( !is_numeric($items[0]) ){
$sql .= "AND ".$filterArray[$key][2]." ";
$attributes[$filterArray[$key][3][1]] = $items[1];
} else{
$sql .= "AND ".$filterArray[$key][0]." ";
$attributes[$filterArray[$key][3][0]] = $items[0];
$attributes[$filterArray[$key][3][1]] = $items[1];
}
} elseif ( $filterArray[$key] ) {
$sql .= "AND ".$filterArray[$key][0]." ";
$attributes[$filterArray[$key][1]] = $value;
......
......@@ -55,7 +55,7 @@ const appInitializerFn = (appConfig: AppConfigService) => {
HttpClientModule,
FormsModule,
PlotlyModule,
MessageModule
MessageModule,
],
providers: [
AppConfigService,
......
......@@ -7,17 +7,17 @@
<span *ngIf="caption_total_name!=='None'">
<span>
<!-- <input class="jobid" type="text" size="10" maxlength="9" pInputText pKeyFilter="int" [ngModel]="jobid" placeholder="Enter Job ID" (ngModelChange)="getJobIDChange($event)" (keyup)="($event.which === 13) ? search():0">
<span *ngIf="!jobid_digits">
<span *ngIf="!true">
<span class=space-left></span>
<button pButton label=Search icon="fa fa-search" (click)="search()"></button>
</span> -->
<span class="ui-inputgroup" style="display:inline-block;">
<input class="jobid" type="text" size="10" maxlength="9" pInputText pKeyFilter="int" [ngModel]="jobid" placeholder="Enter Job ID" (ngModelChange)="getJobIDChange($event)" (keyup)="($event.which === 13) ? search():0">
<button pButton type="button" icon="fa fa-search" (click)="search()"></button>
<input class="jobid" type="text" size="10" maxlength="9" pInputText pKeyFilter="int" [(ngModel)]="jobid" placeholder="Enter Job ID" (keyup)="($event.which === 13) ? searchJID():0">
<button pButton type="button" icon="fa fa-search" (click)="searchJID()"></button>
</span>
<span class=space-left></span>
<span *ngIf="jobid_digits">
<span *ngIf="true">
<p-dropdown [options]="search_option" [(ngModel)]="selected_search_option" placeholder="Select Search Option" (ngModelChange)="getSearchChange($event)" [showClear]="true" [style]="{'minWidth':'180px','width':'180px'}"></p-dropdown>
<span class=space-left></span>
<p-dropdown *ngIf="selected_search_option=='Live'" [options]="live_option" [(ngModel)]="selected_live_option" placeholder="Select Live Option" [showClear]="true" [style]="{'minWidth':'160px','width':'160px'}"></p-dropdown>
......@@ -51,8 +51,8 @@
</p-table>
</div>
<!-- <div *ngIf="jobid_digits" class="p-grid p-justify-center"> -->
<div *ngIf="jobid_digits">
<!-- <div *ngIf="true" class="p-grid p-justify-center"> -->
<div *ngIf="true">
<table class="search">
<tr>
......@@ -161,9 +161,9 @@
<div *ngIf="footprint_name" class="search-cell">
<h4>{{footprint_name}}</h4>
<p-spinner [inputStyle]="{'minWidth':'110px','width':'110px'}" [(ngModel)]="footprint_min" pKeyFilter="num" [step]="0.1" [formatInput]="true" thousandSeparator="," decimalSeparator="." placeholder="Enter Min"></p-spinner>
<p-spinner [inputStyle]="{'minWidth':'110px','width':'110px'}" [(ngModel)]="footprint_min" [min]="0" pKeyFilter="pnum" [step]="0.1" [formatInput]="true" thousandSeparator="," decimalSeparator="." placeholder="Enter Min"></p-spinner>
<span style="margin-left: 20px"></span>
<p-spinner [inputStyle]="{'minWidth':'110px','width':'110px'}" [(ngModel)]="footprint_max" pKeyFilter="num" [step]="0.1" [formatInput]="true" thousandSeparator="," decimalSeparator="." placeholder="Enter Max" ></p-spinner>
<p-spinner [inputStyle]="{'minWidth':'110px','width':'110px'}" [(ngModel)]="footprint_max" [min]="0" pKeyFilter="pnum" [step]="0.1" [formatInput]="true" thousandSeparator="," decimalSeparator="." placeholder="Enter Max" ></p-spinner>
<span style="margin-left: 10px"></span>
{{footprint_unit}}
</div>
......
......@@ -32,6 +32,7 @@ const convert_time_in_seconds_dict = {
class ValueInterval {
caption: string;
storage_name: string;
filter_min: string;
min: number;
max: number;
min_value: number;
......@@ -39,9 +40,10 @@ class ValueInterval {
units: SelectItem[];
selected_unit: string;
constructor(caption: string, storage_name: string, min: number, max: number, units: string[]) {
constructor(caption: string, storage_name: string, min: number, max: number, units: string[], filter_min:string) {
this.caption = caption;
this.storage_name = storage_name;
this.filter_min = filter_min;
this.min = min;
if ( max == null )
this.max = Number.MAX_VALUE;
......@@ -64,10 +66,12 @@ class ValueInterval {
checkInterval() {
setTimeout(() => {
if ( this.min_value > this.max_value ) {
if ( this.max_value != 0 && this.max_value != null ){
this.max_value = this.min_value;
}
if ( this.min_value == null && this.max_value != null) {
this.min_value = 0;
}
else{
this.max_value = null;
}
}
}, 4000);
}
......@@ -87,7 +91,6 @@ export class SearchComponent implements OnInit {
disable_time_interval: boolean;
jobid: number;
jobid_digits: boolean;
search_option: SelectItem[];
selected_search_option: string;
......@@ -185,24 +188,7 @@ export class SearchComponent implements OnInit {
{label: 'Exclusive', value: '1'},
{label: 'Shared', value: '0'}
];
this.partitions = [
'broadwell',
'gpu',
'haswell',
'hpdlf',
'ifm',
'interactive',
'ml',
'nvme',
'romeo',
'sandy',
'sl',
'smp',
'test',
'triton',
'vis',
'west'
];
this.partitions = this.monitoringservice.getPartitions();
this.footprints = [];
for (let label in convert_footprint_dict) {
......@@ -228,6 +214,8 @@ export class SearchComponent implements OnInit {
}
// check if local storage is available
if ( localStorage.getItem('JID') )
this.jobid = Number(localStorage.getItem('JID'));
if ( localStorage.getItem('search-storage') ) {
// console.log("search-storage: ", localStorage.getItem('search-storage'));
......@@ -245,9 +233,6 @@ export class SearchComponent implements OnInit {
this.selected_live_option = null;
}
if ( localStorage.getItem('JID') )
this.jobid = Number(localStorage.getItem('JID'));
this.jobid_digits= (localStorage.getItem('RJID'))==='true';
if ( searchStorage['JOB'] )
this.jobname = searchStorage['JOB'].replace(/%/g,'');;;
if ( searchStorage['PROJECT'] )
......@@ -314,6 +299,12 @@ export class SearchComponent implements OnInit {
this.interval_array[i].min_value = values[0];
this.interval_array[i].max_value = values[1];
}
if ( isNaN( this.interval_array[i].min_value ) ) {
this.interval_array[i].min_value = null;
}
if ( isNaN( this.interval_array[i].max_value ) ) {
this.interval_array[i].max_value = null;
}
}
}
if ( this.selected_search_option == 'Live' )
......@@ -418,7 +409,6 @@ export class SearchComponent implements OnInit {
defaultValue(){
this.jobid = null;
this.jobid_digits = true;
this.selected_search_option = null;
this.selected_live_option = null;
this.selected_allocation_type = null;
......@@ -445,12 +435,12 @@ export class SearchComponent implements OnInit {
/* set default values for third column */
this.interval_array = [];
this.interval_array.push(new ValueInterval('Number of Nodes', 'NUM_NODES_INT', 0, 2000, []));
this.interval_array.push(new ValueInterval('Number of Cores', 'NUM_CORES_INT', 0, null, []));
this.interval_array.push(new ValueInterval('Time Limit', 'WALLTIME_INT', 0, null, ['m', 'h', 'd']));
this.interval_array.push(new ValueInterval('Pending Time', 'PENDING_INT', 0, null, ['m', 'h', 'd']));
this.interval_array.push(new ValueInterval('Duration', 'DURATION_INT', 0, null, ['m', 'h', 'd']));
this.interval_array.push(new ValueInterval('Core Duration', 'CORE_DURATION_INT', 0, null, ['h', 'd', 'y']));
this.interval_array.push(new ValueInterval('Number of Nodes', 'NUM_NODES_INT', 0, 2000, [], 'NUM_NODES_MIN'));
this.interval_array.push(new ValueInterval('Number of Cores', 'NUM_CORES_INT', 0, null, [], 'NUM_CORES_MIN'));
this.interval_array.push(new ValueInterval('Time Limit', 'WALLTIME_INT', 0, null, ['m', 'h', 'd'], 'WALLTIME_MIN'));
this.interval_array.push(new ValueInterval('Pending Time', 'PENDING_INT', 0, null, ['m', 'h', 'd'], 'PENDING_MIN'));
this.interval_array.push(new ValueInterval('Duration', 'DURATION_INT', 0, null, ['m', 'h', 'd'], 'DURATION_MIN'));
this.interval_array.push(new ValueInterval('Core Duration', 'CORE_DURATION_INT', 0, null, ['h', 'd', 'y'], 'CORE_DURATION_MIN'));
}
getSearchChange(event :any){
......@@ -467,9 +457,9 @@ export class SearchComponent implements OnInit {
}
else{
if ( this.selected_search_option !='Live' ) {
this.interval_array.push(new ValueInterval('Pending Time', 'PENDING_INT', 0, null, ['m', 'h', 'd']));
this.interval_array.push(new ValueInterval('Duration', 'DURATION_INT', 0, null, ['m', 'h', 'd']));
this.interval_array.push(new ValueInterval('Core Duration', 'CORE_DURATION_INT', 0, null, ['h', 'd', 'y']));
this.interval_array.push(new ValueInterval('Pending Time', 'PENDING_INT', 0, null, ['m', 'h', 'd'], 'PENDING_MIN'));
this.interval_array.push(new ValueInterval('Duration', 'DURATION_INT', 0, null, ['m', 'h', 'd'], 'DURATION_MIN'));
this.interval_array.push(new ValueInterval('Core Duration', 'CORE_DURATION_INT', 0, null, ['h', 'd', 'y'], 'CORE_DURATION_MIN'));
}
}
}
......@@ -493,15 +483,6 @@ export class SearchComponent implements OnInit {
}
}
getJobIDChange(event: any) {
this.jobid = event;
if ( this.jobid >= 1000000 ){
this.jobid_digits = false;
}
else{
this.jobid_digits = true;
}
}
filterPartitions(event: any) {
this.filtered_partitions = [];
for(let i = 0; i < this.partitions.length; i++) {
......@@ -564,14 +545,23 @@ export class SearchComponent implements OnInit {
}
}
searchJID(){
this.monitoringservice.clearFilter();
sessionStorage.removeItem('_filter');
sessionStorage.clear();
this.clearFilterSession();
localStorage.removeItem('JID');
this.monitoringservice.addFilterItem('JID', this.jobid.toString());
this.monitoringservice.addFilterItem('GLOBAL_DATE_FILTER', "false");
localStorage.setItem('JID', this.jobid.toString());
this.router.navigate(['Detail', 'job-details'], {relativeTo: this.route});
}
search() {
this.monitoringservice.clearFilter();
sessionStorage.removeItem('_filter');
sessionStorage.clear();
this.clearFilterSession();
localStorage.removeItem('JID');
///////
......@@ -649,9 +639,7 @@ export class SearchComponent implements OnInit {
min_value *= convert_time_in_seconds_dict[this.interval_array[i].selected_unit];
max_value *= convert_time_in_seconds_dict[this.interval_array[i].selected_unit];
}
this.monitoringservice.addFilterItem(this.interval_array[i].storage_name, min_value + " " + max_value);
// store current unit in localStore
localStorage.setItem(this.interval_array[i].storage_name + '_UNIT', this.interval_array[i].selected_unit);
}
......@@ -662,16 +650,10 @@ export class SearchComponent implements OnInit {
localStorage.setItem('SEARCHBY', this.selected_search_option);
localStorage.setItem('LIVEOPTION', this.selected_live_option);
localStorage.setItem('RJID', this.jobid_digits.toString());
// search-by navigate
if ( this.jobid ){
this.monitoringservice.clearFilter();
this.monitoringservice.addFilterItem('JID', this.jobid.toString());
this.monitoringservice.addFilterItem('GLOBAL_DATE_FILTER', "false");
localStorage.setItem('JID', this.jobid.toString());
this.router.navigate(['Detail', 'job-details'], {relativeTo: this.route});
}
else if ( this.selected_search_option == 'Live' ){
if ( this.selected_search_option == 'Live' ){
if ( this.selected_live_option == 'Live-User' ){
this.router.navigate([this.selected_search_option, 'users-live'], {relativeTo: this.route});}
else if ( this.selected_live_option == 'Live-Job' ){
......
......@@ -16,6 +16,7 @@ export class MonitoringService {
global_end: any;
filterData: any;
backend_url: string;
PartitionConfig: string[];
activeComponent: string;
lastURL: string;
show_detailed_footprints: boolean;
......
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