def GetProdU(): pdq.Init("") pdq.streams = pdq.CreateClosed("Production", pdq.TERM, 20.0, 20.0) pdq.nodes = pdq.CreateNode("CPU", pdq.CEN, pdq.FCFS) pdq.nodes = pdq.CreateNode("DK1", pdq.CEN, pdq.FCFS) pdq.nodes = pdq.CreateNode("DK2", pdq.CEN, pdq.FCFS) pdq.SetDemand("CPU", "Production", 0.30) pdq.SetDemand("DK1", "Production", 0.08) pdq.SetDemand("DK2", "Production", 0.10) pdq.Solve(pdq.APPROX) return (pdq.GetUtilization("CPU", "Production", pdq.TERM))
ugw = 0.0 umf = 0.0 udsk = [0.0] * FS_DISKS udasd = [0.0] * MF_DISKS util = [0.0] * no_nodes # Reset array for device_idx in range(no_nodes): node = pdq.GetNode(device_idx) devname = node["devname"] # print "Devname ", devname for work_idx in range(no_streams): job = pdq.GetJob(work_idx) trans_name = job["TransName"] util[device_idx] += 100 * pdq.GetUtilization(devname, trans_name, pdq.TRANS) #----- Order of print out follows that in 1993 CMG paper ----------------------- print "Transaction \tLatency(Secs)" print "----------- \t-----------" for idx in range(no_streams): job = pdq.GetJob(idx) print "%s\t%7.4f" % (job["TransName"], job["TransSysResponse"]) print "\n" for idx in range(no_nodes): node = pdq.GetNode(idx) # print idx, node["devname"]
pdq.SetDemand(cname, wname, gen) # gen + intervene pdq.SetDemand(BUS, wname, 1.0) #--------------------------------------------------------------------- pdq.Solve(pdq.APPROX) #----- Bus utilizations ---------------------------------------------- (no, Wrdop) = intwt(Nrdop) for i in range(no): wname = "%s%d" % (RDOP, i) Ubrd += pdq.GetUtilization(BUS, wname, pdq.TERM) Ubrd *= Wrdop if (WBACK): (no, Wwbop) = intwt(Nwbop) for i in range(no): wname = "%s%d" % (WROP, i) Ubwr += pdq.GetUtilization(BUS, wname, pdq.TERM) Ubwr *= Wwbop (no, Winvl) = intwt(Ninvl)