1313from .trace import Trace
1414
1515from ..utils .io import zipopen
16- from ..utils .exceptions import WrongLoaderError
16+ from ..utils .exceptions import WrongLoaderError , ExtraePRVNoOnOffEventsError
1717
1818from ..dimemas import dimemas_idealise
1919from ..extrae import paramedir_analyze_any_of , chop_prv_to_roi , remove_trace
2020
2121base_configs = {
22- k : tuple (resource_filename (' pypop' , w ) for w in v )
22+ k : tuple (resource_filename (" pypop" , w ) for w in v )
2323 for k , v in {
2424 "Serial Useful Computation" : (
2525 "cfgs/serial_useful_computation.cfg" ,
3737}
3838
3939omp_configs = {
40- k : tuple (resource_filename (' pypop' , w ) for w in v )
40+ k : tuple (resource_filename (" pypop" , w ) for w in v )
4141 for k , v in {
4242 "OpenMP Total Runtime" : (
4343 "cfgs/omp_total_runtime.cfg" ,
5353}
5454
5555ideal_configs = {
56- k : tuple (resource_filename (' pypop' , w ) for w in v )
56+ k : tuple (resource_filename (" pypop" , w ) for w in v )
5757 for k , v in {
5858 "Ideal Useful Computation" : ("cfgs/total_useful_computation.cfg" ,),
5959 "Ideal Runtime" : ("cfgs/total_runtime.cfg" ,),
@@ -120,6 +120,7 @@ def _gather_statistics(self):
120120 self ._tracefile ,
121121 self ._kwargs .get ("chop_to_roi" , False ),
122122 self ._kwargs .get ("outpath" , None ),
123+ self ._kwargs .get ("chop_fail_is_error" , False )
123124 )
124125
125126 @staticmethod
@@ -142,19 +143,26 @@ def _split_layoutstring(prv_td):
142143 return (commsize , threads )
143144
144145 @staticmethod
145- def _analyze_tracefile (trace , chop_to_roi , outpath ):
146+ def _analyze_tracefile (trace , chop_to_roi , outpath , chop_fail_is_error ):
146147 if outpath :
147148 makedirs (outpath , exist_ok = True )
148149
149- if chop_to_roi :
150- if outpath :
151- tgtname = ".chop" .join (splitext (basename (trace )))
152- outfile = path_join (outpath , tgtname )
150+ try :
151+ if chop_to_roi :
152+ if outpath :
153+ tgtname = ".chop" .join (splitext (basename (trace )))
154+ outfile = path_join (outpath , tgtname )
155+ else :
156+ outfile = None
157+ cut_trace = chop_prv_to_roi (trace , outfile )
153158 else :
154- outfile = None
155- cut_trace = chop_prv_to_roi (trace , outfile )
156- else :
159+ cut_trace = trace
160+ except ExtraePRVNoOnOffEventsError as err :
161+ if chop_fail_is_error :
162+ raise err
163+ warn ("Unable to chop to ROI: ({}) - Continuing without chopping" .format (err ))
157164 cut_trace = trace
165+ chop_to_roi = False
158166
159167 stats = [
160168 paramedir_analyze_any_of (
0 commit comments