PARSEC benchmark 编译

来源:互联网 发布:中国网络声优排行榜 编辑:程序博客网 时间:2024/06/06 03:01

    • Step01 配置环境
    • Step02 编译benchmark
    • Step03 产生脚本rcS文件
    • Step04 关于输入文件
    • Step05 将benchmark所需文件mount进模拟系统
    • 附录

从官网parsec.cs.princeton.edu下载PARSEC3.0
根据Seminar_Parsec3.pdf介绍的内容

Step01 配置环境

You can modify your environment to make the PARSEC tools and its
man pages available at the command line (without full path)

The env.sh script in the PARSEC root directory will do that for you

Source it as follows (example assumes bash shell):
source env.sh

If you use PARSEC a lot you can add that to your login scripts to
have it always available

根据介绍,在终端进入parsec-3.0文件夹,键入命令:

$ source env.sh

Step02 编译benchmark

Use the following command to get some help:
parsecmgmt -h

You can build a PARSEC workload as follows:
parsecmgmt -a build -p [suite].[PACKAGE]

Flag ‘-a’ specifies the desired action, flag ‘-p’ gives one or more
packages

‘parsecmgmt -a info’ gives you a list of all available packages

根据pdf说明,想要知道可以build的benchmark的列表,输入命令:

$ parsecmgmt -a info[PARSEC] PARSEC Distribution v3.0-beta-20150206[PARSEC][PARSEC] PACKAGES[PARSEC][PARSEC] parsec.blackscholes [1] (computational finance)[PARSEC] Prices a portfolio of options[PARSEC]   Package Group: apps[PARSEC]   Contributor:   Intel Corp.[PARSEC]   Aliases:       all workload parsec apps pthreads tbb openmp[PARSEC][PARSEC] parsec.bodytrack [1] (computer vision)[PARSEC] Tracks a human body through space[PARSEC]   Package Group: apps[PARSEC]   Contributor:   Intel Corp.[PARSEC]   Aliases:       all workload parsec apps pthreads tbb openmp[PARSEC][PARSEC] parsec.canneal [1] (engineering)[PARSEC] Optimizes the routing of a chip design[PARSEC]   Package Group: kernels[PARSEC]   Contributor:   Princeton University[PARSEC]   Aliases:       all workload parsec kernels pthreads……

编译举例,编译blackscholes:

$ parsecmgmt -a build -p blackscholes[PARSEC] Packages to build:  parsec.blackscholes[PARSEC] [========== Building package parsec.blackscholes [1] ==========]……[PARSEC] [1] Bienia. Benchmarking Modern Multiprocessors. Ph.D. Thesis, 2011.[PARSEC][PARSEC] Done.

此时,可执行文件在路径/parsec-3.0/pkgs/apps/blackscholes/inst/amd64-linux.gcc/bin下。

Step03 产生脚本.rcS文件

在parsec-3.0文件夹中写入一个writescripts.pl文件(代码见附录),输入
./writescripts.pl <benchmark> <num_of_thread>
产生相应的.rcS文件。
举例,输入命令如下:

$ ./writescripts.pl blackscholes 4

会产生脚本文件如下:

blackscholes_4c_simdev.rcS     blackscholes_4c_simsmall.rcSblackscholes_4c_simlarge.rcS   blackscholes_4c_test.rcSblackscholes_4c_simmedium.rcS

Step04 关于输入文件

上一步脚本文件中的test、simsmall、simmedium、simlarge、simdev对应的输入文件均在/parsec-3.0/pkgs/apps/blackscholes/inputs路径下,解压对应文件即可:

$parsec-3.0$ ls ./pkgs/apps/blackscholes/inputsinput_simdev.tar    input_simmedium.tar  input_test.tarinput_simlarge.tar  input_simsmall.tar

Step05 将benchmark所需文件mount进模拟系统

清单:
可执行文件 eg. blackscholes
输入文件 eg. in_4k.txt
执行文本 eg. blackscholes_4c_simsmall.rcS

其中,前两项mount进模拟系统,过程参考GemFI-Full System全系统仿真。
最后一项放到相应的位置即可。

附录

writescripts.pl文件代码

#!/usr/bin/perl@benches = ('blackscholes', 'bodytrack', 'canneal', 'dedup', 'facesim',             'ferret', 'fluidanimate', 'freqmine', 'streamcluster',            'swaptions', 'vips', 'x264', 'rtview' );$inputsets[1] = "test";$inputsets[2] = "simdev";$inputsets[3] = "simsmall";$inputsets[4] = "simmedium";$inputsets[5] = "simlarge";$checkpointing = 0;# check for proper inputif( scalar(@ARGV) < 2 || scalar(@ARGV) > 3 ) {  printUsage();  exit;} elsif( scalar(@ARGV) > 2 ) {  for( $i = 2; $i < scalar(@ARGV); $i++ ) {    if( $ARGV[$i] eq "--ckpts" ) {      $checkpointing = 1;    } else {      print "Unrecognized option: $ARGV[$i]\n";      printUsage();      exit;    }  }}# grab input$bench = $ARGV[0];$found = 0;foreach $b (@benches) {  if( $bench eq $b ) {    $found = 1;  }}if( ! $found ) {  printBenches();}# set up the input dir$inputdir = "/parsec/install/inputs/$bench/";$numthreads = int($ARGV[1]);# open the input sets file:open( INFILE, "./inputsets.txt" );$found = 0;while( ! $found && ($line = <INFILE>) ) {  if( $line =~ m/$bench/ ) {    $found = 1;    chomp( $line );    @tokens = split(/\;/,$line);    # replace the input dir and numthreads    for( $i = 0; $i < scalar(@tokens); $i++ ) {      while( $tokens[$i] =~ m/<inputdir>/ ) {        $tokens[$i] =~ s/<inputdir>/$inputdir/;      }      $tokens[$i] =~ s/<nthreads>/$numthreads/;      # print "$tokens[$i]\n";    }    for( $i = 1; $i < scalar(@inputsets); $i++ ) {      $inp = $inputsets[$i];      if( $checkpointing == 0 ) {        $filename = $bench."_".$numthreads."c_".$inp.".rcS";      } else {        $filename = $bench."_".$numthreads."c_".$inp."_ckpts.rcS";      }      open( FILE, "> $filename" ) or die "File problem\n";      print FILE "#!/bin/sh\n\n";      print FILE "# File to run the $bench benchmark\n\n";      if( $bench eq "vips" ) {        print FILE "export IM_CONCURRENCY=$numthreads\n";      }      if( $checkpointing == 0 ) {        print FILE "cd /parsec/install/bin\n";      } else {        print FILE "cd /parsec/install/bin.ckpts\n";      }      if( $checkpointing == 0 ) {        print FILE "/sbin/m5 switchcpu\n";      }      print FILE "/sbin/m5 dumpstats\n";      print FILE "/sbin/m5 resetstats\n";      print FILE "./$bench $tokens[$i]\n";      print FILE "echo \"Done :D\"\n";      print FILE "/sbin/m5 exit\n";      print FILE "/sbin/m5 exit\n";      close( FILE );    }  }}# close the input file:close( INFILE );######################### Methods########################sub printUsage() {  print "Writes the .rcS files for specified parsec benchmark\n";  print "with specified number of threads\n\n";  print "Usage:\n";  print "\t./writescripts.pl <benchmark> <nthreads> [opt: --ckpts]\n";  print "Options:\n";  print "  --ckpts        Use the checkpoint binaries in scripts\n";}sub printBenches() {  print "Valid PARSEC Benchmarks:\n";  foreach $b (@benches) {    print "\t$b\n";  }}
0 0
原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 医保卡忘了密码怎么办 手机qq红包忘记支付密码怎么办 微信红包忘记支付密码怎么办 充点话费充错了怎么办 qq转账记录删除了怎么办 qq转账记录删了怎么办 qq怎么办?q币转给微信 q币送不了别人怎么办 新qq号忘记了怎么办 手机qq登不上去怎么办 qq的账号忘了怎么办 微信红包密码输错锁了怎么办 陌陌钱包异常钱怎么办 对公账户转错了怎么办 微信零钱转账限额怎么办 微信红包充错话费怎么办 qq支付20万限额怎么办 qq红包20万限额怎么办 微信充qb冲错了怎么办 液相色谱柱干了怎么办 微信钱包充流量没到账怎么办 qq买流量不到账怎么办 冲q币电话冲错号了怎么办 下载cf什么文件损坏怎么办 cf老是36_2怎么办啊 永辉超市积分卡怎么办 超市积分卡丢了怎么办 医保卡磁条坏了怎么办 社保卡磁条坏了怎么办 鞋子长了怎么办m.s.cn 厚底皮拖鞋穿松了怎么办 白色帆布鞋洗后发黄怎么办 运动鞋子买大了怎么办 格力空调出现fo怎么办 绝味鸭脖代金券的附券撕了怎么办 耐克鞋子开胶了怎么办 苹果6s自动重启怎么办 钱不够想买手机怎么办 安卓机屏幕密码忘了怎么办 屏幕解锁密码忘了怎么办 华为手机屏幕解锁密码忘了怎么办