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


Python ExperimentController.set_global方法代码示例

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


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

示例1: list

# 需要导入模块: from nepi.execution.ec import ExperimentController [as 别名]
# 或者: from nepi.execution.ec.ExperimentController import set_global [as 别名]
command = "ping -c5 nepi.inria.fr"

# Add simulated nodes and applications
nodes = list()
apps = list()

for i in xrange(node_count):
    node = create_node(ec, username, pl_user, pl_password)
    nodes.append(node)

    for j in xrange(app_count):
        app = add_app(ec, command, node)
        apps.append(app)

# Set perisent blacklist to True
ec.set_global('PlanetlabNode', 'persist_blacklist', True)

# Deploy the experiment
zero_time = datetime.datetime.now()

# Launch thread to monitor CPU and memory usage
thread_monitor_deploy.start()

# Deploy experiment
ec.deploy()

# Wait until nodes and apps are deployed
ec.wait_deployed(nodes + apps)

# Time to deploy
ttd_time = datetime.datetime.now()
开发者ID:phiros,项目名称:nepi,代码行数:33,代码来源:planetlab.py

示例2:

# 需要导入模块: from nepi.execution.ec import ExperimentController [as 别名]
# 或者: from nepi.execution.ec.ExperimentController import set_global [as 别名]
ec.set(node2, "cleanExperiment", True)
ec.set(node2, "cleanProcesses", True)

node3 = ec.register_resource("planetlab::Node")
ec.set(node3, "username", username)
ec.set(node3, "pluser", pl_user)
ec.set(node3, "plpassword", pl_password)
ec.set(node3, "cleanExperiment", True)
ec.set(node3, "cleanProcesses", True)

# Set the global attribute 'persist_blacklist' 
# (that applies to all PlanetlabNodes) to persist the 
# use of the blacklist, meaning leaving out of the
# provisioning the nodes in that file, and adding the new blacklisted
# nodes to the file.
ec.set_global("planetlab::Node", "persist_blacklist", True)

# apps
app1 = ec.register_resource("linux::Application")
command = "ping -c5 google.com" 
ec.set(app1, "command", command)
ec.register_connection(app1, node1)

app2 = ec.register_resource("linux::Application")
command = "ping -c5 google.com" 
ec.set(app2, "command", command)
ec.register_connection(app2, node2)

app3 = ec.register_resource("linux::Application")
command = "ping -c5 google.com" 
ec.set(app3, "command", command)
开发者ID:phiros,项目名称:nepi,代码行数:33,代码来源:blacklist.py


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