예제 #1
0
 def __init__(self, dataDir, tempDir, remote=None):
   """
   Load input files for a scenario
   """
   from xpedite.util.cpuInfo import decodeCpuInfo
   with open(os.path.join(dataDir, BASELINE_CPU_INFO_PATH)) as fileHandle:
     self.fullCpuInfo = json.load(fileHandle, object_hook=decodeCpuInfo)
   appInfoPath = os.path.join(tempDir, XPEDITE_APP_INFO_PATH)
   self.profileInfo = loadProfileInfo(
     dataDir, PROFILE_INFO_PATH, appInfoPath=appInfoPath, remote=remote
   )
예제 #2
0
 def __init__(self, dataDir):
   """
   Load files with expected results for comparison
   """
   import six.moves.cPickle as pickle
   from xpedite.jupyter.xpediteData    import XpediteDataReader
   with open(os.path.join(dataDir, PROBE_CMD_BASELINE_PATH), 'rb') as probeFileHandle:
     self.baselineProbeMap = pickle.load(probeFileHandle) # pylint: disable=c-extension-no-member
   with XpediteDataReader(os.path.join(dataDir, REPORT_CMD_BASELINE_PATH)) as xpediteDataReader:
     self.baselineProfiles = xpediteDataReader.getData(PROFILES_KEY)
   self.baselineProfileInfo = loadProfileInfo(dataDir, GENERATE_CMD_BASELINE_PATH)
예제 #3
0
 def __init__(self, dataDir, tempDir, remote=None):
     """
 Load input files for a scenario
 """
     with open(os.path.join(dataDir, BASELINE_CPU_INFO_PATH)) as fileHandle:
         self.fullCpuInfo = json.load(fileHandle)
     appInfoPath = os.path.join(tempDir, XPEDITE_APP_INFO_PATH)
     self.profileInfo = loadProfileInfo(dataDir,
                                        PROFILE_INFO_PATH,
                                        appInfoPath=appInfoPath,
                                        remote=remote)
예제 #4
0
def test_generate_cmd_vs_baseline(scenarioName):
  """
  Test xpedite generate by generating a new profileInfo.py file and comparing to baseline
  profileInfo.py in the test data directory
  """
  from test_xpedite.test_profiler.app import TargetLauncher
  from xpedite.profiler.probeAdmin    import ProbeAdmin
  with SCENARIO_LOADER[scenarioName] as scenarios:
    with TargetLauncher(CONTEXT, scenarios) as app:
      probes = ProbeAdmin.loadProbes(app.xpediteApp)
      profileInfoFile = generateProfileInfoFile(app.xpediteApp, probes)
      generatedProfileInfo = loadProfileInfo('', profileInfoFile)
      (generatedProfileInfo.benchmarkPaths, generatedProfileInfo.cpuSet, generatedProfileInfo.pmc) = (None, None, None)
    findDiff(generatedProfileInfo.__dict__, scenarios.baselineProfileInfo.__dict__)
    assert generatedProfileInfo == scenarios.baselineProfileInfo