示例#1
0
def run(opts, platParamsName, topo, shape, jobs, perNicParams=None):

    topoInfo = TopoConfig.getTopoInfo(topo, shape)
    topoObj = TopoConfig.getTopoObj(topo)

    print 'Platform: configuration "{0}"'.format(platParamsName)
    print 'Network: topo={0} shape={1} numNodes={2}'.format(
        topo, shape, topoInfo.getNumNodes())

    platParams = Platform.getParams(platParamsName)

    nicConfig = NicConfig.NicConfig(platParams.nicParams, opts, perNicParams)
    rtrConfig = RtrConfig.RtrConfig(platParams.networkParams, opts)

    hermesParams = platParams.hermesParams
    emberParams = platParams.emberParams

    Merlin.setTopoParams(topoInfo.getParams())
    Merlin.setRtrParams(rtrConfig.getParams())

    nullEmber = NullEmber.create(emberParams, hermesParams)

    loadInfo = LoadInfo.LoadInfo(nicConfig, topoInfo.getNumNodes(), nullEmber)

    topoObj.setEndPointFunc(loadInfo.setNode)

    for job in jobs:

        if None == job.getNidlist():
            nidList = LoadUtils.genNidList( topoInfo.getNumNodes(), \
              job.getNumNodes(), job.getRandom() )
            job.setNidList(nidList)
        job.printInfo()

        loadInfo.addEmberConfig(
            EmberConfig.EmberConfig(emberParams, hermesParams, job, opts))

    topoObj.prepParams()
    topoObj.build()
示例#2
0
def run( opts, platParamsName, topo, shape, jobs, perNicParams = None ):

	topoInfo = TopoConfig.getTopoInfo( topo, shape )	
	topoObj = TopoConfig.getTopoObj( topo )

	print 'Platform: configuration "{0}"'.format( platParamsName )
	print 'Network: topo={0} shape={1} numNodes={2}'.format( topo, shape, topoInfo.getNumNodes() )

	platParams = Platform.getParams( platParamsName )

	nicConfig = NicConfig.NicConfig( platParams.nicParams, opts, perNicParams )
	rtrConfig = RtrConfig.RtrConfig( platParams.networkParams, opts )

	hermesParams = platParams.hermesParams
	emberParams = platParams.emberParams

	Merlin.setTopoParams( topoInfo.getParams() )
	Merlin.setRtrParams( rtrConfig.getParams() )

	nullEmber = NullEmber.create( emberParams, hermesParams) 

	loadInfo = LoadInfo.LoadInfo( nicConfig, topoInfo.getNumNodes(), nullEmber )

	topoObj.setEndPointFunc( loadInfo.setNode )

	for job in jobs:
	
		if None == job.getNidlist():
			nidList = LoadUtils.genNidList( topoInfo.getNumNodes(), \
					job.getNumNodes(), job.getRandom() )
			job.setNidList( nidList )
		job.printInfo()

		loadInfo.addEmberConfig( EmberConfig.EmberConfig( emberParams, hermesParams, job, opts ) )

	topoObj.prepParams()
	topoObj.build()