码迷,mamicode.com
首页 > 编程语言 > 详细

Python脚本运行linux命令

时间:2017-07-15 14:53:08      阅读:181      评论:0      收藏:0      [点我收藏+]

标签:get   int   log   dir   system   core   benchmark   access   python脚本   

用gem5执行不同的脚本,将stats输出到不同的目录;

#!/usr/bin/env python3

#
# A Python script to run all Chai‘s data-partition benchmarks with different partition ratios.
#
# Copyright (C) Huan Chen 2017
#

import os

ratios = [
    #‘0‘,
    #‘0.05‘,
    #‘0.1‘,
    #‘0.15‘,
    ‘0.2‘,
    ‘0.25‘,
    ‘0.3‘,
    ‘0.35‘,
    ‘0.4‘,
    ‘0.45‘,
    ‘0.5‘,
    ‘0.55‘,
    ‘0.6‘,
    ‘0.65‘,
    ‘0.7‘,
    ‘0.75‘,
    ‘0.8‘,
    ‘0.85‘,
    ‘0.9‘,
    ‘0.95‘,
    ‘0.1‘
]

def run(ratio):
    cmd_run =‘/home/hao/gem5-gpu/gem5/build/X86_VI_hammer_GPU/gem5.opt -d /home/hao/gem5-gpu/m5out‘+ratio+‘ /home/hao/gem5-gpu/gem5-gpu/configs/fs_fusion.py --script=/home/hao/gem5-gpu/m5out‘+ratio+‘/BS.rcS  --cpu-type=timing  --gpu_core_config=Maxwell --num-cpus=8 --clusters=8 --cores_per_cluster=2 --num-dirs=4 --mem-type=DDR4_2400_x64 --total-mem-size=3GB --access-host-pagetable‘
    print(cmd_run)
    os.system(cmd_run)

def run_experiments():
    for ratio in ratios:
        run(ratio)

run_experiments()

 

Python脚本运行linux命令

标签:get   int   log   dir   system   core   benchmark   access   python脚本   

原文地址:http://www.cnblogs.com/chenhuanBlogs/p/7182492.html

踩
(0)
赞
(0)
   
举报
评论 一句话评论(0)
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!