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上运作
     
  • 相关阅读:
    多项式全家桶——Part.3 多项式求逆、除法、开根号
    多项式全家桶——Part.2 多项式位运算
    多项式全家桶——Part.1 多项式加减乘
    CSP2019总结
    jzoj6384. 【NOIP2019模拟2019.10.23】珂学家
    jzoj6377. 【NOIP2019模拟2019.10.05】幽曲[埋骨于弘川]
    jzoj6374. 【NOIP2019模拟2019.10.04】结界[生与死的境界]
    jzoj6370. 【NOIP2019模拟2019.9.28】基础 fake 练习题
    一个初学者的辛酸路程-基于Django写BBS项目
    一个初学者的辛酸路程-依旧Django
  • 原文地址:https://www.cnblogs.com/idyllcheung/p/10904021.html
Copyright © 2011-2022 走看看