gem5-gpu 运行 PARSEC2.1

本文详细介绍了PARSEC基准测试程序,包括如何下载和配置PARSEC应用程序,以及如何使用rcS生成器来创建不同规模的测试案例。此外还提供了各种测试案例的具体参数设置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

PARSEC是针对共享内存多核处理器(CPU)的一套基准测试程序,详细介绍见wiki:http://wiki.cs.princeton.edu/index.php/PARSEC,主要参考:http://www.cs.utexas.edu/~cart/parsec_m5/,下载parsec、inputs:http://parsec.cs.princeton.edu/download.htm

阅读此教程的前提是,你已经配置好全系统模拟环境。

首先,下载所需的PARSEC应用程序,这一步已经在配置全系统时完成,即磁盘镜像中根目录下的parsec文件夹。要想重新编译请看http://www.cs.utexas.edu/~cart/parsec_m5/,在http://parsec.cs.princeton.edu/download.htm下载的源文件是否需要对gem5-gpu做针对性的更改:未知,需要实验来给出结果。

其次,下载一个rcS生成器:http://www.cs.utexas.edu/~parsec_m5/writescripts.pl,这是一个Perl脚本,很多Linux发行版默认安装了Perl,只需赋予用户该文件的可执行权限即可,源文件的最后注明了用法。PARSEC wiki页面最后也有个别程序的用法。

可以看到生成了5个rcS脚本,命名格式为“benchName_threadsNumberc_input",其中input的含义:

test:尽可能小的输入,dev:我没看懂,small:真实输入,运行时间约1s,medium:真实输入,运行时间约5s,large:真实输入,运行时间约15s,native:真实输入,运行时间约15min。

rcS文件内容可供参考,参考其命令格式,可以通过运行 ./bench --help-all 查看程序的其他用法。

付用法,具体含义见源文件main.cpp

blackscholes;<nthreads> <inputdir>in_4.txt <inputdir>prices.txt;<nthreads> <inputdir>in_16.txt <inputdir>prices.txt;<nthreads> <inputdir>in_4K.txt <inputdir>prices.txt;<nthreads> <inputdir>in_16K.txt <inputdir>prices.txt;<nthreads> <inputdir>in_64K.txt <inputdir>prices.txt
bodytrack;<inputdir>sequenceB_1 4 1 5 1 0 <nthreads>;<inputdir>sequenceB_1 4 1 100 3 0 <nthreads>;<inputdir>sequenceB_1 4 1 1000 5 0 <nthreads>;<inputdir>sequenceB_2 4 2 2000 5 0 <nthreads>;<inputdir>sequenceB_4 4 4 4000 5 0 <nthreads>
canneal;<nthreads> 5 100 <inputdir>10.nets 1;<nthreads> 100 300 <inputdir>100.nets 2;<nthreads> 10000 2000 <inputdir>100000.nets 32;<nthreads> 15000 2000 <inputdir>200000.nets 64;<nthreads> 15000 2000 <inputdir>400000.nets 128
dedup;-c -p -f -t <nthreads> -i <inputdir>test.dat -o <inputdir>output.dat.ddp;-c -p -f -t <nthreads> -i <inputdir>hamlet.dat -o <inputdir>output.dat.ddp;-c -p -f -t <nthreads> -i <inputdir>medias.dat -o <inputdir>output.dat.ddp;-c -p -f -t <nthreads> -i <inputdir>mediam.dat -o <inputdir>output.dat.ddp;-c -p -f -t <nthreads> -i <inputdir>medial.dat -o <inputdir>output.dat.ddp
facesim;-h;-timing -threads <nthreads>;-timing -threads <nthreads>;-timing -threads <nthreads>;-timing -threads <nthreads>
ferret;<inputdir>corelt lsh <inputdir>queriest 1 1 <nthreads> <inputdir>output.txt;<inputdir>coreld lsh <inputdir>queriesd 5 5 <nthreads> <inputdir>output.txt;<inputdir>corels lsh <inputdir>queriess 10 20 <nthreads> <inputdir>output.txt;<inputdir>corelm lsh <inputdir>queriesm 10 20 <nthreads> <inputdir>output.txt;<inputdir>corell lsh <inputdir>queriesl 10 20 <nthreads> <inputdir>output.txt
fluidanimate;<nthreads> 1 <inputdir>in_5K.fluid <inputdir>out.fluid;<nthreads> 3 <inputdir>in_15K.fluid <inputdir>out.fluid;<nthreads> 5 <inputdir>in_35K.fluid <inputdir>out.fluid;<nthreads> 5 <inputdir>in_100K.fluid <inputdir>out.fluid;<nthreads> 5 <inputdir>in_300K.fluid <inputdir>out.fluid
freqmine;<inputdir>T10I4D100K_3.dat 1;<inputdir>T10I4D100K_1k.dat 3;<inputdir>kosarak_250k.dat 220;<inputdir>kosarak_500k.dat 410;<inputdir>kosarak_990k.dat 790
rtview;<inputdir>octahedron.obj -nodisplay -automove -nthreads <nthreads> -frames 1 -res 1 1;<inputdir>bunny.obj -nodisplay -automove -nthreads <nthreads> -frames 1 -res 16 16;<inputdir>happy_buddha.obj -nodisplay -automove -nthreads <nthreads> -frames 3 -res 480 270;<inputdir>happy_buddha.obj -nodisplay -automove -nthreads <nthreads> -frames 3 -res 960 540;<inputdir>happy_buddha.obj -nodisplay -automove -nthreads <nthreads> -frames 3 -res 1920 1080
streamcluster;2 5 1 10 10 5 none <inputdir>output.txt <nthreads>;3 10 3 16 16 10 none <inputdir>output.txt <nthreads>;10 20 32 4096 4096 1000 none <inputdir>output.txt <nthreads>;10 20 64 8192 8192 1000 none <inputdir>output.txt <nthreads>;10 20 128 16384 16384 1000 none <inputdir>output.txt <nthreads>
swaptions;-ns 1 -sm 5 -nt <nthreads>;-ns 3 -sm 50 -nt <nthreads>;-ns 16 -sm 5000 -nt <nthreads>;-ns 32 -sm 10000 -nt <nthreads>;-ns 64 -sm 20000 -nt <nthreads>
vips;im_benchmark <inputdir>barbados_256x288.v <inputdir>output.v;im_benchmark <inputdir>barbados_256x288.v <inputdir>output.v;im_benchmark <inputdir>pomegranate_1600x1200.v <inputdir>output.v;im_benchmark <inputdir>vulture_2336x2336.v <inputdir>output.v;im_benchmark <inputdir>bigben_2662x5500.v <inputdir>output.v
x264;--quiet --qp 20 --partitions b8x8,i4x4 --ref 5 --direct auto --b-pyramid --weightb --mixed-refs --no-fast-pskip --me umh --subme 7 --analyse b8x8,i4x4 --threads <nthreads> -o <inputdir>eledream.264 <inputdir>eledream_32x18_1.y4m;--quiet --qp 20 --partitions b8x8,i4x4 --ref 5 --direct auto --b-pyramid --weightb --mixed-refs --no-fast-pskip --me umh --subme 7 --analyse b8x8,i4x4 --threads <nthreads> -o <inputdir>eledream.264 <inputdir>eledream_64x36_3.y4m;--quiet --qp 20 --partitions b8x8,i4x4 --ref 5 --direct auto --b-pyramid --weightb --mixed-refs --no-fast-pskip --me umh --subme 7 --analyse b8x8,i4x4 --threads <nthreads> -o <inputdir>eledream.264 <inputdir>eledream_640x360_8.y4m;--quiet --qp 20 --partitions b8x8,i4x4 --ref 5 --direct auto --b-pyramid --weightb --mixed-refs --no-fast-pskip --me umh --subme 7 --analyse b8x8,i4x4 --threads <nthreads> -o <inputdir>eledream.264 <inputdir>eledream_640x360_32.y4m;--quiet --qp 20 --partitions b8x8,i4x4 --ref 5 --direct auto --b-pyramid --weightb --mixed-refs --no-fast-pskip --me umh --subme 7 --analyse b8x8,i4x4 --threads <nthreads> -o <inputdir>eledream.264 <inputdir>eledream_640x360_128.y4m
Benchmarkinputcpu_threadsstart_fromsim_secondsROI timecpu_threadsstart_fromsim_secondsROI time
blackscholessmall1 0.4799s 0.480s2  0.24s
bodytrack   1.4s1.4s    
canneal   0.774s0.772s    
dedup   2.913s2.912s    
facesim         
ferret         
fluidanimate   2.597s2.6s    
freqmine   1.536s1.54s    
rtview         
streamcluster   2.532s2.532s    
swaption         
vips         
x264   0.4699s0.468s    

转载于:https://www.cnblogs.com/chenhuanBlogs/p/8615548.html

### 配置和运行 gem5 模拟器中的 ARM 架构与 PARSEC-3.0 gem5 是一种功能强大的全系统计算机体系结构仿真平台,支持多种架构的模拟,其中包括 ARM 构架。PARSEC (Princeton Application Repository for Shared-Memory Computers) 3.0 提供了一系列多线程应用程序作为基准测试工具集。 #### 安装和配置 gem5 支持 ARM 架构 为了使 gem5 能够成功模拟 ARM 构架下的工作负载,需完成以下设置: 1. **下载并编译 gem5** 下载最新版本的 gem5 并按照官方文档说明进行构建。对于 ARM 架构的支持,推荐使用 `--with-arm-isas` 参数来启用特定于 ARM 的指令集支持[^1]。 ```bash scons build/ARM/gem5.opt -j$(nproc) ``` 2. **准备操作系统镜像文件** 使用适合 ARM 处理器的操作系统盘符(如 Linux 发行版)。可以采用预定义好的 Disk Image 或者自行制作满足需求的虚拟磁盘环境[^2]。 3. **创建启动脚本** 编写用于初始化系统的 Python 启动脚本来加载 OS 和应用软件包。下面是一个简单的例子展示如何指定 CPU 类型、内存大小以及硬盘映射关系等参数[^3]: ```python import m5 from m5.objects import * system = System() system.clk_domain = SrcClockDomain() system.clk_domain.clock = '1GHz' system.clk_domain.voltage_domain = VoltageDomain() # Processor setup system.cpu = ArmO3CPU(cpu_id=0) # Memory bus and memory controller configuration system.membus = SystemXBar() system.mem_ctrl = DDR3_1600_x64(size='2GB') system.mem_ctrl.port = system.membus.master # Cache hierarchy definition omitted here... process = Process() process.cmd = ['<path_to_parsec_binary>'] system.cpu.workload = process system.cpu.createThreads() root = Root(full_system=True, system=system) m5.instantiate() exit_event = m5.simulate() print('Exiting @ tick {} because {}'.format(m5.curTick(), exit_event.getCause())) ``` #### 整合 PARSEC-3.0 到 gem5 中 要让 PARSEC 应用程序能够在 gem5 上执行,则需要遵循这些步骤: 1. **安装 PARSEC 工具链** 参考 PARSEC 文档获取其源码,并针对目标硬件平台交叉编译所有组件。确保最终生成可移植至仿真的二进制格式的应用实例[^4]。 2. **调整输入数据路径** 如果某些解析依赖外部资源或者大型数据库,请确认它们被正确打包进入初始状态快照之中以便访问[^5]。 通过上述方法即可实现基于 gem5 对 ARM 设备上运行 PARSEC 基准测试的工作流建模分析目的。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值