def buildLogPNetwork(self): import re nproc = sst.getMPIRankCount() * sst.getThreadCount() switchParams = self.params["switch"] self.fillInParamsLogP() lat = switchParams["out_in_latency"] switches = [] for i in range(nproc): switch = sst.Component("LogP %d" % i, "macro.logp_switch") switch.addParams(macroToCoreParams(switchParams)) switch.addParam("id", i) switches.append(switch) for i in range(self.num_nodes): injSW = self.system.nodeToLogPSwitch(i) ep = self.nodes[i] sw = switches[injSW] linkName = "logPinjection%d->%d" % (i, injSW) link = sst.Link(linkName) portName = "output %d %d" % (sst.macro.NICLogPInjectionPort, i) ep.addLink(link, portName, smallLatency) #put no latency here portName = "input %d %d" % (sst.macro.NICLogPInjectionPort, i) sw.addLink(link, portName, smallLatency) for i in range(self.num_nodes): ep = self.nodes[i] for p in range(nproc): linkName = "logPejection%d->%d" % (i, injSW) link = sst.Link(linkName) sw = switches[p] portName = "output %d %d" % (i, sst.macro.NICLogPInjectionPort) sw.addLink(link, portName, lat) portName = "input %d %d" % (i, sst.macro.NICLogPInjectionPort) ep.addLink(link, portName, lat)
def buildLogPNetwork(self): import re nproc = sst.getMPIRankCount() * sst.getThreadCount() switchParams = self.params["switch"] linkParams = switchParams["link"] ejParams = switchParams["ejection"] lat = self.latency(ejParams) #gotta multiply the lat by 2 match = re.compile("(\d+[.]?\d*)(.*)").search(lat) if not match: sys.exit("improperly formatted latency %s" % lat) num, units = match.groups() num = eval(num) * 2 lat = "%8.4f%s" % (num,units.strip()) switches = [] for i in range(nproc): switch = sst.Component("logp %d" % i, "macro.logp_switch") #switch = sst.Component("logp %d" % i, "macro.logp_switch") switch.addParams(macroToCoreParams(switchParams)) switch.addParam("id", i) switches.append(switch) #NEWLY ADDED BEGIN #switch.addParam("electrical_bandwidth" , "10Gb/s") #switch.addParam("optical_bandwidth", "1Gb/s") #NEWLY ADDED END for i in range(nproc): sw_i = switches[i] for j in range(nproc): sw_j = switches[j] if i==j: continue linkName = "logPnetwork%d->%d" % (i,j) link = sst.Link(linkName) portName = "in-out %d %d" % (j, sst.macro.SwitchLogPNetworkPort) sw_i.addLink(link, portName, lat) portName = "in-out %d %d" % (i, sst.macro.SwitchLogPNetworkPort) sw_j.addLink(link, portName, lat) for i in range(self.num_nodes): injSW = self.system.nodeToLogPSwitch(i) ep = self.nodes[i] sw = switches[injSW] linkName = "logPinjection%d->%d" % (i, injSW) link = sst.Link(linkName) portName = "in-out %d %d" % (sst.macro.NICLogPInjectionPort, sst.macro.SwitchLogPInjectionPort) #portName = "injection %d %d" % (sst.macro.NICLogPInjectionPort, sst.macro.SwitchLogPInjectionPort) ep.addLink(link, portName, smallLatency) #put no latency here portName = "in-out %d %d" % (i, sst.macro.SwitchLogPInjectionPort) #portName = "ejection %d %d" % (i, sst.macro.SwitchLogPInjectionPort) sw.addLink(link, portName, smallLatency)
def buildLogPNetwork(self): import re nproc = sst.getMPIRankCount() * sst.getThreadCount() switchParams = self.params["switch"] linkParams = switchParams["link"] ejParams = switchParams["ejection"] lat = self.latency(ejParams) #gotta multiply the lat by 2 match = re.compile("(\d+[.]?\d*)(.*)").search(lat) if not match: sys.exit("improperly formatted latency %s" % lat) num, units = match.groups() num = eval(num) * 2 lat = "%8.4f%s" % (num,units.strip()) switches = [] for i in range(nproc): switch = sst.Component("LogP %d" % i, "macro.logp_switch") switch.addParams(macroToCoreParams(switchParams)) switch.addParam("id", i) switches.append(switch) for i in range(nproc): sw_i = switches[i] for j in range(nproc): sw_j = switches[j] if i==j: continue linkName = "logPnetwork%d->%d" % (i,j) link = sst.Link(linkName) portName = "in-out %d %d" % (j, sst.macro.SwitchLogPNetworkPort) sw_i.addLink(link, portName, lat) portName = "in-out %d %d" % (i, sst.macro.SwitchLogPNetworkPort) sw_j.addLink(link, portName, lat) for i in range(self.num_nodes): injSW = self.system.nodeToLogPSwitch(i) ep = self.nodes[i] sw = switches[injSW] linkName = "logPinjection%d->%d" % (i, injSW) link = sst.Link(linkName) portName = "in-out %d %d" % (sst.macro.NICLogPInjectionPort, sst.macro.SwitchLogPInjectionPort) ep.addLink(link, portName, smallLatency) #put no latency here portName = "in-out %d %d" % (i, sst.macro.SwitchLogPInjectionPort) sw.addLink(link, portName, smallLatency)