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.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user