当前位置: 首页>>代码示例>>Python>>正文


Python Model.nv_2方法代码示例

本文整理汇总了Python中Model.Model.nv_2方法的典型用法代码示例。如果您正苦于以下问题:Python Model.nv_2方法的具体用法?Python Model.nv_2怎么用?Python Model.nv_2使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Model.Model的用法示例。


在下文中一共展示了Model.nv_2方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: defaultTests

# 需要导入模块: from Model import Model [as 别名]
# 或者: from Model.Model import nv_2 [as 别名]
def defaultTests(columns="", verbosity="default"):
        """ create and run a set of standard test scenarios """
        # note the key background parameters
        m = Model("")
        misc = ", %d/%ds, %s/%s/s" % (m.time_timeout, m.time_detect,
                                      printSize(m.rate_mirror, 1000),
                                      printSize(m.rate_flush, 1000))

        # create a list of tests to be run
        mlist = list()

        # run tests for all the interesting combinations
        for cp in (1, 2, 3):
            for primary in (" v", "nv"):
                sList = ["none"] if cp == 1 else [" v", "nv", "symmetric"]
                for secondary in sList:
                    # suppress irrelevent combinations
                    if primary == "nv" and secondary == " v":
                        continue

                    # figure out how to caption this configuration
                    if secondary == "symmetric":
                        desc = ("symmetric: %d %s cp" % (cp, primary))
                    elif (cp > 1):
                        desc = ("prim: %s   %d %s cp" %
                               (primary, cp - 1, secondary))
                    else:
                        desc = "prim: %s      0 cp" % (primary)

                    # instantiate the model
                    m = Model(desc + misc)
                    m.copies = cp
                    m.nv_1 = (primary == "nv")
                    m.cache_1 = 4 * GB
                    if secondary == "symmetric":
                        m.symmetric = True
                        m.cache_1 *= cp
                        m.nv_2 = (primary == "nv")
                        m.cache_2 = 0
                    elif cp > 1:
                        m.nv_2 = (secondary == "nv")
                        m.cache_2 = 40 * GB
                    mlist.append(m)

        # run all the specified models
        run(mlist, columns, verbosity)
开发者ID:markkampe,项目名称:KeepsOnTickin,代码行数:48,代码来源:main.py


注:本文中的Model.Model.nv_2方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。