def processTrial(trial): # extract the non-callpath events from the trial print "extracting non-callpath..." extractor = ExtractNonCallpathEventOperation(trial) extracted = extractor.processData().get(0) # print "extracting event..." # extractor = ExtractEventOperation(trial, "MAIN__") # extracted = extractor.processData().get(0) # get basic statistics print "computing mean..." statMaker = BasicStatisticsOperation(extracted, True) stats = statMaker.processData() means = stats.get(BasicStatisticsOperation.MEAN) # get main event mainEvent = means.getMainEvent() print "Main Event: ", mainEvent # calculate all derived metrics print "Deriving memory stall metrics..." derived, PowerPerProc = getMemoryModel(means) return derived
def main(trialName): global mainEvent global True global False global Joules global PPJ print "--------------- JPython test script start ------------" print "--- Calculating Power Models --- " # create a rulebase for processing #print "Loading Rules..." #ruleHarness = RuleHarness.useGlobalRules("openuh/OpenUHRules.drl") # load the trial print "loading the data..." # check to see if the user has selected a trial Utilities.setSession("openuh") trial = TrialResult( Utilities.getTrial("Fluid Dynamic Energy/Power", trialName, "1_1")) # extract the non-callpath events from the trial print "extracting non-callpath..." extractor = ExtractNonCallpathEventOperation(trial) extracted = extractor.processData().get(0) # get basic statistics print "computing mean..." statMaker = BasicStatisticsOperation(extracted, False) stats = statMaker.processData() means = stats.get(BasicStatisticsOperation.MEAN) # get main event mainEvent = means.getMainEvent() print "Main Event: ", mainEvent # calculate all derived metrics print print "Deriving power metric..." derived, PowerPerProc = getPowerModel(means) # get the top 10 events top10er = TopXEvents(derived, derived.getTimeMetric(), AbstractResult.EXCLUSIVE, 10) top10 = top10er.processData().get(0) # just one thread thread = 0 # iterate over events, output inefficiency derived metric print #print "Top 10 Average", PowerPerProc, "values per thread for this trial:" #for event in top10er.getSortedEventNames(): #print event, derived.getExclusive(thread, event, PowerPerProc) print #print mainEvent, "INCLUSIVE: ", derived.getInclusive(thread, mainEvent, PowerPerProc) print # compute the energy consumed by each event print "Computing joules consumed..." derived, EnergyPerProc = getEnergy(derived, PowerPerProc) Joules = EnergyPerProc # iterate over events, output inefficiency derived metric print #print "Top 10 Average", EnergyPerProc, "values per thread for this trial:" #for event in top10er.getSortedEventNames(): #print event, derived.getExclusive(thread, event, EnergyPerProc) print #print mainEvent, "INCLUSIVE: ", derived.getInclusive(thread, mainEvent, EnergyPerProc) print # compute the floating point operations per joule per event print "Computing FP_OPS/joule..." derived, FlopsPerJoule = getFlopsPerJoule(derived, EnergyPerProc) PPJ = FlopsPerJoule # iterate over events, output inefficiency derived metric print #print "Top 10 Average", FlopsPerJoule, "values per thread for this trial:" #for event in top10er.getSortedEventNames(): #print event, derived.getExclusive(thread, event, FlopsPerJoule) print #print mainEvent, "INCLUSIVE: ", derived.getInclusive(thread, mainEvent, FlopsPerJoule) print # compute the floating point operations per joule per event print "Computing Instructions Per Cycle..." derived, IPC = getIPC(derived) # iterate over events, output inefficiency derived metric print #print "Top 10 Average", IPC, "values per thread for this trial:" #for event in top10er.getSortedEventNames(): #print event, derived.getExclusive(thread, event, IPC) print #print mainEvent, "INCLUSIVE: ", derived.getInclusive(thread, mainEvent, IPC) print # compute the floating point operations per joule per event print "Computing Issued Per Cycle..." derived, issuedPerCycle = getIssuedPerCycle(derived) # iterate over events, output inefficiency derived metric print #print "Top 10 Average", issuedPerCycle, "values per thread for this trial:" #for event in top10er.getSortedEventNames(): #print event, derived.getExclusive(thread, event, issuedPerCycle) print #print mainEvent, "INCLUSIVE: ", derived.getInclusive(thread, mainEvent, issuedPerCycle) print #print "Time to completion..." print #for event in top10er.getSortedEventNames(): #print event, derived.getExclusive(thread, event, derived.getTimeMetric())/1000000 print #print mainEvent, "INCLUSIVE: ", derived.getInclusive(thread, mainEvent, derived.getTimeMetric())/1000000 # process the rules #RuleHarness.getInstance().processRules() print "---------------- JPython test script end -------------" return derived
# choose the right database configuration - a string which matches the end of the jdbc connection, # such as "perfdmf" to match "jdbc:derby:/Users/khuck/src/tau2/apple/lib/perfdmf" Utilities.setSession("openuh") # load just the average values across all threads, input: app_name, exp_name, trial_name #trial = TrialResult(Utilities.getTrial("Fluid Dynamic", "rib 45", "1_8")) #trial = TrialResult(Utilities.getTrial("msap_parametric.optix.dynamic.4", "size.400", "16.threads")) #trial = TrialResult(Utilities.getTrial("msap_parametric.optix.static_nowait", "size.400", "16.threads")) trial = TrialResult(Utilities.getTrial("static", "size.400", "16.threads")) #trial = TrialResult(Utilities.getTrial("msap_parametric.optix.dynamic.1", "size.400", "16.threads")) #trial = TrialResult(Utilities.getCurrentTrial()) # extract the non-callpath events from the trial extractor = ExtractNonCallpathEventOperation(trial) extracted = extractor.processData().get(0) # get basic statistics statMaker = BasicStatisticsOperation(extracted, False) stats = statMaker.processData() stddev = stats.get(BasicStatisticsOperation.STDDEV) means = stats.get(BasicStatisticsOperation.MEAN) totals = stats.get(BasicStatisticsOperation.TOTAL) mainEvent = means.getMainEvent() print "Main Event: ", mainEvent # get the ratio between stddev and total ratioMaker = RatioOperation(stddev, means) #ratioMaker = RatioOperation(stddev, means) ratios = ratioMaker.processData().get(0)
def extractNonCallpath(input): # extract the non-callpath events from the trial extractor = ExtractNonCallpathEventOperation(input) #extractor = ExtractCallpathEventOperation(input) return extractor.processData().get(0)
def main(): global mainEvent global True global False global L1Hits global L2Hits global L3Hits global L1DataStalls global InstMiss global L2Refs global L2DataRef global L2Misses global L3Misses global TLBPenalty global EarCache global LocalMemoryHits global RemoteMemoryHits global RemoteMemoryAccesses global RatioMemoryAccesses global Total global TotalRatio print "--------------- JPython test script start ------------" print "--- Calculating Memory Stall Causes --- " # create a rulebase for processing print "Loading Rules..." ruleHarness = RuleHarness.useGlobalRules("openuh/OpenUHRules.drl") # load the trial print "loading the data..." # check to see if the user has selected a trial tmp = Utilities.getCurrentTrial() if tmp != None: trial = TrialResult(tmp) print else: # remove these two lines to bypass this and use the default trial print "No trial selected - script exiting" return # choose the right database configuration - a string which matches the end of the jdbc connection, # such as "perfdmf" to match "jdbc:derby:/Users/khuck/src/tau2/apple/lib/perfdmf" #Utilities.setSession("openuh") # load just the average values across all threads, input: app_name, exp_name, trial_name #trial = TrialResult(Utilities.getTrial("Fluid Dynamic - Unoptimized", "rib 45", "1_8")) # extract the non-callpath events from the trial print "extracting non-callpath..." extractor = ExtractNonCallpathEventOperation(trial) extracted = extractor.processData().get(0) # get basic statistics print "computing mean..." statMaker = BasicStatisticsOperation(extracted, True) stats = statMaker.processData() means = stats.get(BasicStatisticsOperation.MEAN) # get main event mainEvent = means.getMainEvent() print "Main Event: ", mainEvent # calculate all derived metrics print "Deriving memory stall metrics..." derived, PowerPerProc = getMemoryModel(means) # iterate over events, output inefficiency derived metric for event in derived.getEvents(): MeanEventFact.compareEventToMain(derived, mainEvent, derived, event) print print # output the top 10 top10er = TopXEvents(derived, derived.getTimeMetric(), AbstractResult.EXCLUSIVE, 10) top10 = top10er.processData().get(0) for event in top10.getEvents(): print if event == mainEvent: print event, "L1 hits: ", L1Hits, derived.getInclusive( 0, event, L1Hits) print event, "L2 hits: ", L2Hits, derived.getInclusive( 0, event, L2Hits) print event, "L3 hits: ", L3Hits, derived.getInclusive( 0, event, L3Hits) print event, "TLB Penalty: ", TLBPenalty, derived.getInclusive( 0, event, TLBPenalty) print event, "Local Memory Hits: ", LocalMemoryHits, derived.getInclusive( 0, event, LocalMemoryHits) print event, "Remote Memory Hits: ", RemoteMemoryHits, derived.getInclusive( 0, event, RemoteMemoryHits) print event, "Total: ", Total, derived.getInclusive( 0, event, Total) print event, "Total Ratio: ", TotalRatio, derived.getInclusive( 0, event, TotalRatio) print event, "local/remote ratio: ", RatioMemoryAccesses, derived.getInclusive( 0, event, RatioMemoryAccesses) else: print event, "L1 hits: ", L1Hits, derived.getExclusive( 0, event, L1Hits) print event, "L2 hits: ", L2Hits, derived.getExclusive( 0, event, L2Hits) print event, "L3 hits: ", L3Hits, derived.getExclusive( 0, event, L3Hits) print event, "TLB Penalty: ", TLBPenalty, derived.getExclusive( 0, event, TLBPenalty) print event, "Local Memory Hits: ", LocalMemoryHits, derived.getExclusive( 0, event, LocalMemoryHits) print event, "Remote Memory Hits: ", RemoteMemoryHits, derived.getExclusive( 0, event, RemoteMemoryHits) print event, "Total: ", Total, derived.getExclusive( 0, event, Total) print event, "Total Ratio: ", TotalRatio, derived.getExclusive( 0, event, TotalRatio) print event, "local/remote ratio: ", RatioMemoryAccesses, derived.getExclusive( 0, event, RatioMemoryAccesses) print # process the rules RuleHarness.getInstance().processRules() print "---------------- JPython test script end -------------"
def main(): global mainEvent global True global False print "--------------- JPython test script start ------------" print "--- Calculating Power Models --- " # create a rulebase for processing #print "Loading Rules..." #ruleHarness = RuleHarness.useGlobalRules("openuh/OpenUHRules.drl") # load the trial print "loading the data..." # check to see if the user has selected a trial tmp = Utilities.getCurrentTrial() if tmp != None: trial = TrialResult(tmp) print else: # remove these two lines to bypass this and use the default trial print "No trial selected - script exiting" return Utilities.setSession("openuh") # load just the average values across all threads, input: app_name, exp_name, trial_name #trial = TrialResult(Utilities.getTrial("msap_parametric.optix.static", "size.400", "16.threads")) #trial = TrialResult(Utilities.getTrial("Fluid Dynamic - Unoptimized", "rib 45", "1_8")) # extract the non-callpath events from the trial print "extracting non-callpath..." extractor = ExtractNonCallpathEventOperation(trial) extracted = extractor.processData().get(0) # print "extracting event..." # extractor = ExtractEventOperation(trial, "MAIN__") # extracted = extractor.processData().get(0) # get basic statistics print "computing mean..." statMaker = BasicStatisticsOperation(extracted, True) stats = statMaker.processData() means = stats.get(BasicStatisticsOperation.MEAN) # get main event mainEvent = means.getMainEvent() print "Main Event: ", mainEvent # calculate all derived metrics print "Deriving power metrics..." derived, PowerPerProc = getPowerModel(means) # get the top 10 "power dense" events top10er = TopXEvents(derived, PowerPerProc, AbstractResult.EXCLUSIVE, 10) top10 = top10er.processData().get(0) # just one thread thread = 0 # iterate over events, output inefficiency derived metric print "Top 10 Average", PowerPerProc, "values per thread for this trial:" for event in top10er.getSortedEventNames(): print event, top10.getExclusive(thread, event, PowerPerProc) print print mainEvent, "INCLUSIVE: ", derived.getInclusive(thread, mainEvent, PowerPerProc) print # compute the energy consumed by each event print "Computing joules consumed..." derived, EnergyPerProc = getEnergy(derived, PowerPerProc) # get the top 10 "power dense" events top10er = TopXEvents(derived, EnergyPerProc, AbstractResult.EXCLUSIVE, 10) top10 = top10er.processData().get(0) # iterate over events, output inefficiency derived metric print "Top 10 Average", EnergyPerProc, "values per thread for this trial:" for event in top10er.getSortedEventNames(): print event, top10.getExclusive(thread, event, EnergyPerProc) #print event, top10.getExclusive(thread, event, "LINUX_TIMERS") #print event, top10.getExclusive(thread, event, "(LINUX_TIMERS*1.0E-6)") print print mainEvent, "INCLUSIVE: ", derived.getInclusive(thread, mainEvent, EnergyPerProc) #print mainEvent, derived.getExclusive(thread, event, "LINUX_TIMERS") #print mainEvent, derived.getExclusive(thread, event, "(LINUX_TIMERS*1.0E-6)") print # compute the floating point operations per joule per event print "Computing FP_OPS/joule..." derived, FlopsPerJoule = getFlopsPerJoule(derived, EnergyPerProc) # get the top 10 "power dense" events top10er = TopXEvents(derived, FlopsPerJoule, AbstractResult.EXCLUSIVE, 10) top10 = top10er.processData().get(0) # iterate over events, output inefficiency derived metric print "Top 10 Average", FlopsPerJoule, "values per thread for this trial:" for event in top10er.getSortedEventNames(): print event, top10.getExclusive(thread, event, FlopsPerJoule) print print mainEvent, "INCLUSIVE: ", derived.getInclusive(thread, mainEvent, FlopsPerJoule) print # process the rules #RuleHarness.getInstance().processRules() print "---------------- JPython test script end -------------"