11
11
import sys
12
12
import time
13
13
import typing
14
+ from typing import Dict
14
15
from dataclasses import dataclass , field
15
16
from typing import List , Optional
16
17
17
18
import darshan
18
19
import darshan .backend .cffi_backend as darshanll
19
- import includes .config as config
20
- import includes .module as module
21
20
import pandas as pd
22
- from includes .module import HIGH , RECOMMENDATIONS , WARN , Panel , insights_total
23
-
24
- # from includes.module import *
25
- from includes .parser import args
26
21
from packaging import version
27
22
from rich import print
28
23
from rich .padding import Padding
29
24
25
+ import drishti .includes .config as config
26
+ import drishti .includes .module as module
27
+ from drishti .includes .module import HIGH , RECOMMENDATIONS , WARN , Panel , insights_total
28
+
29
+ # from includes.module import *
30
+ from drishti .includes .parser import args
31
+
30
32
31
33
def is_available (name ):
32
34
"""Check whether `name` is on PATH and marked as executable."""
@@ -98,7 +100,7 @@ class AbstractDarshanTrace(abc.ABC):
98
100
99
101
# Report
100
102
modules : typing .Iterable [str ]
101
- name_records : dict [str , str ] = field (default_factory = dict )
103
+ name_records : Dict [str , str ] = field (default_factory = dict )
102
104
103
105
max_read_offset : int = float ('-inf' )
104
106
max_write_offset : int = float ('-inf' )
@@ -108,7 +110,7 @@ class AbstractDarshanTrace(abc.ABC):
108
110
total_files_posix : int = 0
109
111
total_files_mpiio : int = 0
110
112
111
- files : dict [str , dict [str , int ]] = None
113
+ files : Dict [str , Dict [str , int ]] = None
112
114
113
115
total_reads : int = 0
114
116
total_writes : int = 0
@@ -165,7 +167,7 @@ class AbstractDarshanTrace(abc.ABC):
165
167
# TODO: Should be a list of CB nodes for agg
166
168
cb_nodes : Optional [int ] = None
167
169
number_of_compute_nodes : int = 0
168
- hints : list [str ] = dataclasses .field (default_factory = list )
170
+ hints : List [str ] = dataclasses .field (default_factory = list )
169
171
170
172
job_start : Optional [datetime .datetime ] = None
171
173
job_end : Optional [datetime .datetime ] = None
@@ -346,61 +348,62 @@ def _do_something(self):
346
348
# TODO: for trace in traces
347
349
for trace in self .traces :
348
350
pass
349
- module .check_misaligned (self .total_operations , self .total_mem_not_aligned , self .total_file_not_aligned ,
350
- self .modules , self .name_records , self .lustre_df , self .dxt_posix ,
351
- self .dxt_posix_read_data ) # posix alignment
351
+ # module.check_misaligned(self.total_operations, self.total_mem_not_aligned, self.total_file_not_aligned,
352
+ # self.modules, self.name_records, self.lustre_df, self.dxt_posix,
353
+ # self.dxt_posix_read_data) # posix alignment
352
354
353
- module .check_traffic (self .max_read_offset , self .total_read_size , self .max_write_offset , self .total_written_size ,
354
- self .dxt_posix , self .dxt_posix_read_data , self .dxt_posix_write_data ) # redundant reads
355
+ # module.check_traffic(self.max_read_offset, self.total_read_size, self.max_write_offset, self.total_written_size,
356
+ # self.dxt_posix, self.dxt_posix_read_data, self.dxt_posix_write_data) # redundant reads
355
357
356
- module .check_random_operation (self .read_consecutive , self .read_sequential , self .read_random , self .total_reads ,
357
- self .write_consecutive , self .write_sequential , self .write_random ,
358
- self .total_writes , self .dxt_posix ,
359
- self .dxt_posix_read_data , self .dxt_posix_write_data ) # random check
358
+ # module.check_random_operation(self.read_consecutive, self.read_sequential, self.read_random, self.total_reads,
359
+ # self.write_consecutive, self.write_sequential, self.write_random,
360
+ # self.total_writes, self.dxt_posix,
361
+ # self.dxt_posix_read_data, self.dxt_posix_write_data) # random check
360
362
361
- module .check_shared_small_operation (self .total_shared_reads , self .total_shared_reads_small ,
362
- self .total_shared_writes ,
363
- self .total_shared_writes_small , self .shared_files , self .report .name_records )
363
+ # module.check_shared_small_operation(self.total_shared_reads, self.total_shared_reads_small,
364
+ # self.total_shared_writes,
365
+ # self.total_shared_writes_small, self.shared_files, self.report.name_records)
364
366
365
367
module .check_long_metadata (self .count_long_metadata , self .modules )
366
368
367
- module .check_shared_data_imblance (self .posix_shared_data_imbalance_stragglers_count ,
368
- self .posix_data_straggler_files ,
369
- self .report .name_records , self .dxt_posix ,
370
- self .dxt_posix_read_data ,
371
- self .dxt_posix_write_data )
372
-
373
- module .check_shared_time_imbalance (self .posix_stragglers_shared_file_time_imbalance_count ,
374
- self .posix_shared_time_imbalance_detected_files1 , self .report .name_records )
375
-
376
- module .check_individual_write_imbalance (self .posix_data_imbalance_count ,
377
- self .posix_shared_time_imbalance_detected_files2 ,
378
- self .report .name_records , self .dxt_posix , self .dxt_posix_write_data )
369
+ # module.check_shared_data_imblance(self.posix_shared_data_imbalance_stragglers_count,
370
+ # self.posix_data_straggler_files,
371
+ # self.report.name_records, self.dxt_posix,
372
+ # self.dxt_posix_read_data,
373
+ # self.dxt_posix_write_data)
379
374
380
- module .check_mpi_collective_read_operation (self .mpiio_coll_reads , self .mpiio_indep_reads ,
381
- self .total_mpiio_read_operations ,
382
- self .detected_files_mpi_coll_reads , self .report .name_records ,
383
- self .dxt_mpiio )
375
+ # module.check_shared_time_imbalance(self.posix_stragglers_shared_file_time_imbalance_count,
376
+ # self.posix_shared_time_imbalance_detected_files1, self.report.name_records)
384
377
385
- module .check_mpi_collective_write_operation (self .mpiio_coll_writes , self . mpiio_indep_writes ,
386
- self .total_mpiio_write_operations ,
387
- self .detected_files_mpiio_coll_writes , self .report . name_records , self .dxt_mpiio )
378
+ # module.check_individual_write_imbalance (self.posix_data_imbalance_count ,
379
+ # self.posix_shared_time_imbalance_detected_files2 ,
380
+ # self.report.name_records , self.dxt_posix , self.dxt_posix_write_data )
388
381
389
- module .check_individual_read_imbalance (self .imbalance_count_posix_shared_time ,
390
- self .posix_shared_time_imbalance_detected_files3 ,
391
- self .report .name_records , self .dxt_posix , self .dxt_posix_read_data )
382
+ # module.check_mpi_collective_read_operation(self.mpiio_coll_reads, self.mpiio_indep_reads,
383
+ # self.total_mpiio_read_operations,
384
+ # self.detected_files_mpi_coll_reads, self.report.name_records,
385
+ # self.dxt_mpiio)
386
+
387
+ # module.check_mpi_collective_write_operation(self.mpiio_coll_writes, self.mpiio_indep_writes,
388
+ # self.total_mpiio_write_operations,
389
+ # self.detected_files_mpiio_coll_writes, self.report.name_records, self.dxt_mpiio)
390
+ #
391
+ # module.check_individual_read_imbalance(self.imbalance_count_posix_shared_time,
392
+ # self.posix_shared_time_imbalance_detected_files3,
393
+ # self.report.name_records, self.dxt_posix, self.dxt_posix_read_data)
392
394
393
395
module .check_mpi_none_block_operation (self .mpiio_nb_reads , self .mpiio_nb_writes , self .has_hdf5_extension ,
394
396
self .modules )
395
397
396
398
397
399
398
400
def _small_operation_insight (self ):
399
- module .check_small_operation (self .total_reads , self .total_reads_small , self .total_writes ,
400
- self .total_writes_small ,
401
- self .small_operation_detected_files ,
402
- self .modules , self .report .name_records , self .dxt_posix , self .dxt_posix_read_data ,
403
- self .dxt_posix_write_data )
401
+ pass
402
+ # module.check_small_operation(self.total_reads, self.total_reads_small, self.total_writes,
403
+ # self.total_writes_small,
404
+ # self.small_operation_detected_files,
405
+ # self.modules, self.report.name_records, self.dxt_posix, self.dxt_posix_read_data,
406
+ # self.dxt_posix_write_data)
404
407
405
408
406
409
@@ -921,7 +924,7 @@ def __init__(self, traces: List[DarshanTrace]):
921
924
reports = [current_trace .report for current_trace in traces ]
922
925
self .name_records = dict ()
923
926
for report in reports :
924
- self .name_records |= report .name_records
927
+ self .name_records . update ( report . name_records ) # self.name_records |= report.name_records
925
928
926
929
def aggregate_traces (self ):
927
930
self .modules = set ()
@@ -953,7 +956,7 @@ def aggregate_traces(self):
953
956
self .total_files_posix += current_trace .total_size_posix
954
957
self .total_files_mpiio += current_trace .total_files_mpiio
955
958
956
- self .files |= current_trace .files
959
+ self .files . update ( current_trace . files ) # self.files |= current_trace.files
957
960
958
961
self .total_reads += current_trace .total_reads
959
962
self .total_writes += current_trace .total_writes
0 commit comments