zoukankan      html  css  js  c++  java
  • ltp-ddt smp_cpu_affinity

    # @name SMP CPU Affinity
    # @desc Check that processes assigned to multiple CPUs complete without errors
    # @requires smp
    # @setup_requires

    SMP_S_FUNC_CPUAFFINITY_NO-LB_CORE1 source 'common.sh';  num_cores=`cat /sys/devices/system/cpu/online`; echo $num_cores | grep -E '[[:digit:]]+-' > /dev/null && multi_run_processes.sh -s "dd if=/dev/urandom of=/dev/null bs=1M count=10" -l "-n 10 -a 0x1 -d 0"

    SMP_S_FUNC_CPUAFFINITY_NO-LB_CORE2 source 'common.sh';  num_cores=`cat /sys/devices/system/cpu/online`; echo $num_cores | grep -E '[[:digit:]]+-' > /dev/null && multi_run_processes.sh -s "dd if=/dev/urandom of=/dev/null bs=1M count=10" -l "-n 10 -a 0x2 -d 0"

    SMP_S_FUNC_CPUAFFINITY_LB source 'common.sh';  num_cores=`cat /sys/devices/system/cpu/online`; echo $num_cores | grep -E '[[:digit:]]+-' > /dev/null && multi_run_processes.sh -s "dd if=/dev/urandom of=/dev/null bs=1M count=10" -l "-n 20 -a 0xFFFFFFFF -d 0"
     
    multi_run_processes.sh -s "dd if=/dev/urandom of=/dev/null bs=1M count=10" -l "-n 10 -a 0x1 -d 0"
     
    # usage:
    # multi_run_processes.sh <process list> [<process list2> ...] -v
    #   where        -v is an optional flag and when present indicates that priority
    #                 of two processes has to be verified using time taken
    #                 for process execution
    #
    #                 process_list= -s "#-separated commands" -l "-n <num_instances>
    #                        -a <cpu affinity mask> -d <inter-process start delay>
    #                        -p <priority> -r <realtime priority>"
     
    -s "dd if=/dev/urandom of=/dev/null bs=1M count=10"
    -l "-n 10 -a 0x1 -d 0"
     
     
    run_processes.sh -c  "dd if=/dev/urandom of=/dev/null bs=1M count=10" -n 10 -a 0x1 -d 0
     
    # usage: run_processes.sh -c <"#-separated commands">
    #                  [-n <num_of_instances> ]
    #                  [-a <cpu_affinity_mask>]
    #                  [-d <delay_in_sec> ]
    #                  [-p <priority> ]
    #                  [-r <realtime priority> ]
    #                  [-w] On first failure, wait for all processes
    # if cpu affinity is set, then taskset is used to spawn the processes
     
    [-a <cpu_affinity_mask>]
    在哪个CPU上运行,二进制就在哪一个上赋值为1
    那么例如出现pid 8987's current affinity mask: ff   ff是16进制,转换二进制:11111111,意思就是在8个CPU上运行!
    比如说16进制的40,那么转换二进制01000000,意思就是在第7块CPU上运作
     
  • 相关阅读:
    python求余、除法运算、向下圆整、round圆整
    【转】从入门到实践 json练习详解~~和ython : groupby 结果浅解,&之后的 y_list=[v for _,v in y]
    ### 模块“*.dll”已加载,但对DllRegisterServer的调用失败,错误代码为0x80070005
    python从excel里读取数据
    文本文件和二进制文件的区别
    析构函数 声明为protected
    c语言中ln,lg,log的表示。c语言中ln,lg,log的表示。
    js设计模式--创建型--单例模式
    js设计模式--创建型--工厂模式
    解决ElementUI的table组件在flex布局下宽度不能自适应的问题
  • 原文地址:https://www.cnblogs.com/idyllcheung/p/10904021.html
Copyright © 2011-2022 走看看