From 3886c4a8f2e1bfe17cbf7a5a76ba0fc978c6bb48 Mon Sep 17 00:00:00 2001 From: Brandon Potter Date: Wed, 9 Nov 2016 14:27:40 -0600 Subject: syscall_emul: [patch 5/22] remove LiveProcess class and use Process instead The EIOProcess class was removed recently and it was the only other class which derived from Process. Since every Process invocation is also a LiveProcess invocation, it makes sense to simplify the organization by combining the fields from LiveProcess into Process. --- configs/common/cpu2000.py | 18 +++++++++--------- configs/example/apu_se.py | 6 +++--- configs/example/se.py | 4 ++-- configs/learning_gem5/part1/simple.py | 2 +- configs/learning_gem5/part1/two_level.py | 2 +- configs/splash2/cluster.py | 24 ++++++++++++------------ configs/splash2/run.py | 24 ++++++++++++------------ 7 files changed, 40 insertions(+), 40 deletions(-) (limited to 'configs') diff --git a/configs/common/cpu2000.py b/configs/common/cpu2000.py index 5f01d28bf..3d01fe9da 100644 --- a/configs/common/cpu2000.py +++ b/configs/common/cpu2000.py @@ -131,8 +131,8 @@ class Benchmark(object): func(self, isa, os) - def makeLiveProcessArgs(self, **kwargs): - # set up default args for LiveProcess object + def makeProcessArgs(self, **kwargs): + # set up default args for Process object process_args = {} process_args['cmd'] = [ self.name ] + self.args process_args['executable'] = self.executable @@ -147,11 +147,11 @@ class Benchmark(object): return process_args - def makeLiveProcess(self, **kwargs): - process_args = self.makeLiveProcessArgs(**kwargs) + def makeProcess(self, **kwargs): + process_args = self.makeProcessArgs(**kwargs) # figure out working directory: use m5's outdir unless - # overridden by LiveProcess's cwd param + # overridden by Process's cwd param cwd = process_args.get('cwd') if not cwd: @@ -163,9 +163,9 @@ class Benchmark(object): # copy input files to working directory for d in self.inputs_dir: copyfiles(d, cwd) - # generate LiveProcess object - from m5.objects import LiveProcess - return LiveProcess(**process_args) + # generate Process object + from m5.objects import Process + return Process(**process_args) def __str__(self): return self.name @@ -750,5 +750,5 @@ if __name__ == '__main__': print 'class: %s' % bench.__name__ x = bench('alpha', 'tru64', input_set) print '%s: %s' % (x, input_set) - pprint(x.makeLiveProcessArgs()) + pprint(x.makeProcessArgs()) print diff --git a/configs/example/apu_se.py b/configs/example/apu_se.py index 5ec3289d2..28ba92ba1 100644 --- a/configs/example/apu_se.py +++ b/configs/example/apu_se.py @@ -392,9 +392,9 @@ else: # OpenCL driver driver = ClDriver(filename="hsa", codefile=kernel_files) for cpu in cpu_list: - cpu.workload = LiveProcess(executable = executable, - cmd = [options.cmd] + options.options.split(), - drivers = [driver]) + cpu.workload = Process(executable = executable, + cmd = [options.cmd] + options.options.split(), + drivers = [driver]) for cp in cp_list: cp.workload = host_cpu.workload diff --git a/configs/example/se.py b/configs/example/se.py index 4adfe7bb8..5eacf19fe 100644 --- a/configs/example/se.py +++ b/configs/example/se.py @@ -91,7 +91,7 @@ def get_processes(options): idx = 0 for wrkld in workloads: - process = LiveProcess() + process = Process() process.executable = wrkld process.cwd = os.getcwd() @@ -154,7 +154,7 @@ if options.bench: else: exec("workload = %s(buildEnv['TARGET_ISA', 'linux', '%s')" % ( app, options.spec_input)) - multiprocesses.append(workload.makeLiveProcess()) + multiprocesses.append(workload.makeProcess()) except: print >>sys.stderr, "Unable to find workload for %s: %s" % ( buildEnv['TARGET_ISA'], app) diff --git a/configs/learning_gem5/part1/simple.py b/configs/learning_gem5/part1/simple.py index 393240a66..31fdb0de8 100644 --- a/configs/learning_gem5/part1/simple.py +++ b/configs/learning_gem5/part1/simple.py @@ -89,7 +89,7 @@ isa = str(m5.defines.buildEnv['TARGET_ISA']).lower() binary = 'tests/test-progs/hello/bin/' + isa + '/linux/hello' # Create a process for a simple "Hello World" application -process = LiveProcess() +process = Process() # Set the command # cmd is a list which begins with the executable (like argv) process.cmd = [binary] diff --git a/configs/learning_gem5/part1/two_level.py b/configs/learning_gem5/part1/two_level.py index 3dcb71a51..1330d5d0c 100644 --- a/configs/learning_gem5/part1/two_level.py +++ b/configs/learning_gem5/part1/two_level.py @@ -133,7 +133,7 @@ system.mem_ctrl.range = system.mem_ranges[0] system.mem_ctrl.port = system.membus.master # Create a process for a simple "Hello World" application -process = LiveProcess() +process = Process() # Set the command # cmd is a list which begins with the executable (like argv) process.cmd = [binary] diff --git a/configs/splash2/cluster.py b/configs/splash2/cluster.py index a2abc7e48..a0423e6e3 100644 --- a/configs/splash2/cluster.py +++ b/configs/splash2/cluster.py @@ -76,56 +76,56 @@ if args: # -------------------- # Define Splash2 Benchmarks # ==================== -class Cholesky(LiveProcess): +class Cholesky(Process): executable = options.rootdir + '/kernels/cholesky/CHOLESKY' cmd = 'CHOLESKY -p' + str(options.numcpus) + ' '\ + options.rootdir + '/kernels/cholesky/inputs/tk23.O' -class FFT(LiveProcess): +class FFT(Process): executable = options.rootdir + 'kernels/fft/FFT' cmd = 'FFT -p' + str(options.numcpus) + ' -m18' -class LU_contig(LiveProcess): +class LU_contig(Process): executable = options.rootdir + 'kernels/lu/contiguous_blocks/LU' cmd = 'LU -p' + str(options.numcpus) -class LU_noncontig(LiveProcess): +class LU_noncontig(Process): executable = options.rootdir + 'kernels/lu/non_contiguous_blocks/LU' cmd = 'LU -p' + str(options.numcpus) -class Radix(LiveProcess): +class Radix(Process): executable = options.rootdir + 'kernels/radix/RADIX' cmd = 'RADIX -n524288 -p' + str(options.numcpus) -class Barnes(LiveProcess): +class Barnes(Process): executable = options.rootdir + 'apps/barnes/BARNES' cmd = 'BARNES' input = options.rootdir + 'apps/barnes/input.p' + str(options.numcpus) -class FMM(LiveProcess): +class FMM(Process): executable = options.rootdir + 'apps/fmm/FMM' cmd = 'FMM' input = options.rootdir + 'apps/fmm/inputs/input.2048.p' + str(options.numcpus) -class Ocean_contig(LiveProcess): +class Ocean_contig(Process): executable = options.rootdir + 'apps/ocean/contiguous_partitions/OCEAN' cmd = 'OCEAN -p' + str(options.numcpus) -class Ocean_noncontig(LiveProcess): +class Ocean_noncontig(Process): executable = options.rootdir + 'apps/ocean/non_contiguous_partitions/OCEAN' cmd = 'OCEAN -p' + str(options.numcpus) -class Raytrace(LiveProcess): +class Raytrace(Process): executable = options.rootdir + 'apps/raytrace/RAYTRACE' cmd = 'RAYTRACE -p' + str(options.numcpus) + ' ' \ + options.rootdir + 'apps/raytrace/inputs/teapot.env' -class Water_nsquared(LiveProcess): +class Water_nsquared(Process): executable = options.rootdir + 'apps/water-nsquared/WATER-NSQUARED' cmd = 'WATER-NSQUARED' input = options.rootdir + 'apps/water-nsquared/input.p' + str(options.numcpus) -class Water_spatial(LiveProcess): +class Water_spatial(Process): executable = options.rootdir + 'apps/water-spatial/WATER-SPATIAL' cmd = 'WATER-SPATIAL' input = options.rootdir + 'apps/water-spatial/input.p' + str(options.numcpus) diff --git a/configs/splash2/run.py b/configs/splash2/run.py index d6427b7f5..0f374c17d 100644 --- a/configs/splash2/run.py +++ b/configs/splash2/run.py @@ -77,39 +77,39 @@ if not options.numcpus: # -------------------- # Define Splash2 Benchmarks # ==================== -class Cholesky(LiveProcess): +class Cholesky(Process): cwd = options.rootdir + '/kernels/cholesky' executable = options.rootdir + '/kernels/cholesky/CHOLESKY' cmd = ['CHOLESKY', '-p' + str(options.numcpus), options.rootdir + '/kernels/cholesky/inputs/tk23.O'] -class FFT(LiveProcess): +class FFT(Process): cwd = options.rootdir + '/kernels/fft' executable = options.rootdir + '/kernels/fft/FFT' cmd = ['FFT', '-p', str(options.numcpus), '-m18'] -class LU_contig(LiveProcess): +class LU_contig(Process): executable = options.rootdir + '/kernels/lu/contiguous_blocks/LU' cmd = ['LU', '-p', str(options.numcpus)] cwd = options.rootdir + '/kernels/lu/contiguous_blocks' -class LU_noncontig(LiveProcess): +class LU_noncontig(Process): executable = options.rootdir + '/kernels/lu/non_contiguous_blocks/LU' cmd = ['LU', '-p', str(options.numcpus)] cwd = options.rootdir + '/kernels/lu/non_contiguous_blocks' -class Radix(LiveProcess): +class Radix(Process): executable = options.rootdir + '/kernels/radix/RADIX' cmd = ['RADIX', '-n524288', '-p', str(options.numcpus)] cwd = options.rootdir + '/kernels/radix' -class Barnes(LiveProcess): +class Barnes(Process): executable = options.rootdir + '/apps/barnes/BARNES' cmd = ['BARNES'] input = options.rootdir + '/apps/barnes/input.p' + str(options.numcpus) cwd = options.rootdir + '/apps/barnes' -class FMM(LiveProcess): +class FMM(Process): executable = options.rootdir + '/apps/fmm/FMM' cmd = ['FMM'] if str(options.numcpus) == '1': @@ -118,23 +118,23 @@ class FMM(LiveProcess): input = options.rootdir + '/apps/fmm/inputs/input.2048.p' + str(options.numcpus) cwd = options.rootdir + '/apps/fmm' -class Ocean_contig(LiveProcess): +class Ocean_contig(Process): executable = options.rootdir + '/apps/ocean/contiguous_partitions/OCEAN' cmd = ['OCEAN', '-p', str(options.numcpus)] cwd = options.rootdir + '/apps/ocean/contiguous_partitions' -class Ocean_noncontig(LiveProcess): +class Ocean_noncontig(Process): executable = options.rootdir + '/apps/ocean/non_contiguous_partitions/OCEAN' cmd = ['OCEAN', '-p', str(options.numcpus)] cwd = options.rootdir + '/apps/ocean/non_contiguous_partitions' -class Raytrace(LiveProcess): +class Raytrace(Process): executable = options.rootdir + '/apps/raytrace/RAYTRACE' cmd = ['RAYTRACE', '-p' + str(options.numcpus), options.rootdir + '/apps/raytrace/inputs/teapot.env'] cwd = options.rootdir + '/apps/raytrace' -class Water_nsquared(LiveProcess): +class Water_nsquared(Process): executable = options.rootdir + '/apps/water-nsquared/WATER-NSQUARED' cmd = ['WATER-NSQUARED'] if options.numcpus==1: @@ -143,7 +143,7 @@ class Water_nsquared(LiveProcess): input = options.rootdir + '/apps/water-nsquared/input.p' + str(options.numcpus) cwd = options.rootdir + '/apps/water-nsquared' -class Water_spatial(LiveProcess): +class Water_spatial(Process): executable = options.rootdir + '/apps/water-spatial/WATER-SPATIAL' cmd = ['WATER-SPATIAL'] if options.numcpus==1: -- cgit v1.2.3