本文整理汇总了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()
示例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)