def loaddata(): print "loading the data..." Utilities.setSession("openuh") #Utilities.setSession("perfdmf") #trial = TrialMeanResult(Utilities.getTrial("fortran", "test", "O3-2048-real.8-bounds")) #trial = TrialMeanResult(Utilities.getTrial("fortran", "test", "O3-2048-real.8-options")) #trial = TrialMeanResult(Utilities.getTrial("msap_parametric.static", "size.400", "1.threads")) trial = TrialMeanResult( Utilities.getTrial("msap_parametric.optix.static", "size.400", "16.threads")) return trial
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
################################################################### print "--------------- JPython test script start ------------" print "--- Looking for load imbalances --- " # create a rulebase for processing print "Loading Rules..." ruleHarness = RuleHarness.useGlobalRules("openuh/OpenUHRules.drl") # load the trial print "loading the data..." # 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)
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 -------------"
from glue import ExtractNonCallpathEventOperation from glue import DeriveMetricOperation from glue import MergeTrialsOperation from glue import DerivedMetrics from glue import TopXEvents from glue import MeanEventFact ################################################################### print "---------------- JPython test script begin -----------" # create a rulebase for processing ruleHarness = RuleHarness.useGlobalRules("openuh/OpenUHRules.drl") # load a trial trial = TrialMeanResult(Utilities.getTrial("Fluid Dynamic", "rib 45", "1_8")) # calculate the derived metric totalStalls = "BACK_END_BUBBLE_ALL" totalCycles = "CPU_CYCLES" derivor = DeriveMetricOperation(trial, totalStalls, totalCycles, DeriveMetricOperation.DIVIDE) derived = derivor.processData().get(0) for event in derived.getEvents(): MeanEventFact.compareEventToMain(derived, mainEvent, derived, event) print # process the rules RuleHarness.getInstance().processRules()
from glue import TrialMeanResult from glue import TopXEvents from glue import AbstractResult from glue import DeriveMetricOperation from glue import DerivedMetrics from glue import MeanEventFact ################################################################### print "---------------- JPython test script begin -----------" # create a rulebase for processing #ruleHarness = RuleHarness.useGlobalRules("openuh/OpenUHRules.drl") # load a trial Utilities.setSession("openuh") trial = TrialMeanResult(Utilities.getTrial("Fluid Dynamic", "rib 45", "1_8")) # calculate the derived metric totalStalls = "BACK_END_BUBBLE_ALL" totalCycles = "CPU_CYCLES" newMetric = "(BACK_END_BUBBLE_ALL/CPU_CYCLES)" derivor = DeriveMetricOperation(trial, totalStalls, totalCycles, DeriveMetricOperation.DIVIDE) derived = derivor.processData().get(0) # get the top 10 events top10er = TopXEvents(derived, newMetric, AbstractResult.EXCLUSIVE, 10) top10 = top10er.processData().get(0) print "Top 10 events with high stall/cycle ratios:" for event in top10er.getSortedEventNames():
################################################################### print "--------------- JPython test script start ------------" print "--- Calculating inefficiency --- " # create a rulebase for processing #print "Loading Rules..." ruleHarness = RuleHarness.useGlobalRules("openuh/OpenUHRules.drl") # load the trial print "loading the data..." # 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("test") #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 OpenMP", "rib 90", "Original OpenMP 1_16")) # extract the non-callpath events from the trial print "extracting" extractor = ExtractNonCallpathEventOperation(trial) extracted = extractor.processData().get(0) # get basic statistics print "stats"
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 RemoteMemoryRatio global RatioMemoryAccesses global Total global TotalRatio print "--------------- JPython test script start ------------" print "--- Calculating Memory Stall Causes --- " # load the trial print "loading the data..." 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 OpenMP", "rib 90", "1_16")) first = processTrial(trial) trial = TrialResult( Utilities.getTrial("Fluid Dynamic - Optimized OpenMP", "rib 90", "1_16")) second = processTrial(trial) differ = DifferenceOperation(first) differ.addInput(second) diff = differ.processData().get(0) # output the top 10 top10er = TopXEvents(diff, diff.getTimeMetric(), AbstractResult.EXCLUSIVE, 10) top10 = top10er.processData().get(0) for event in top10.getEvents(): print print event, "L1 hits: ", L1Hits, diff.getInclusive(0, event, L1Hits) print event, "L2 hits: ", L2Hits, diff.getInclusive(0, event, L2Hits) print event, "L3 hits: ", L3Hits, diff.getInclusive(0, event, L3Hits) print event, "TLB Penalty: ", TLBPenalty, diff.getInclusive( 0, event, TLBPenalty) print event, "Local Memory Hits: ", LocalMemoryHits, diff.getInclusive( 0, event, LocalMemoryHits) print event, "Remote Memory Hits: ", RemoteMemoryHits, diff.getInclusive( 0, event, RemoteMemoryHits) print event, "Total: ", Total, diff.getInclusive(0, event, Total) print event, "Total Ratio: ", TotalRatio, diff.getInclusive( 0, event, TotalRatio) print event, "local/remote ratio: ", RatioMemoryAccesses, diff.getInclusive( 0, event, RatioMemoryAccesses) print 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 -------------"