|
| 1 | +## -*- Mode:Python; -*- ## |
| 2 | +## |
| 3 | +## Copyright (c) 2018 ResiliNets, ITTC, University of Kansas |
| 4 | +## |
| 5 | +## Author: Siddharth Gangadhar |
| 6 | +## |
| 7 | +## James P.G. Sterbenz <jpgs@ittc.ku.edu>, director |
| 8 | +## ResiliNets Research Group http://wiki.ittc.ku.edu/resilinets |
| 9 | +## Information and Telecommunication Technology Center (ITTC) |
| 10 | +## and Department of Electrical Engineering and Computer Science |
| 11 | +## The University of Kansas Lawrence, KS USA. |
| 12 | +## |
| 13 | + |
| 14 | +import os |
| 15 | +import pdb |
| 16 | +import cfgPbsWriter |
| 17 | +from cfgPbsWriter import * |
| 18 | + |
| 19 | +###################################################################################################### |
| 20 | +# Initialize config parameters |
| 21 | +scenario = "error" |
| 22 | +#error = "error = 0,0.0000001,0.000001,0.00001,0.0001,0.001,0.01" |
| 23 | +#error = "error = 0" |
| 24 | +error = [0] |
| 25 | +script = "script = single-multiple-flow" |
| 26 | +simTime = [600] |
| 27 | +#simTime = [600,1200,1800] |
| 28 | +runs = 'runs = 1' |
| 29 | +pktSize = 'pktSize = 1500' |
| 30 | +accessSpeed = 'accessSpeed = 10Gbps' |
| 31 | +accessDelay = 'accessDelay = 0.1ms' |
| 32 | +pcapFile = 'pcapFile = /tmp/' |
| 33 | +csvName = 'csvName = ' |
| 34 | +#qSize = [1] |
| 35 | +qSize = [0.2,0.4,0.6,0.8,1] |
| 36 | +outputFactor = 'outputFactor = Mb' |
| 37 | +dceProt = 'dceProt = ' |
| 38 | +qSizeFileName = 'qSizeFileName = ' |
| 39 | +#qSizeFileName = 'qMonitoring = ' |
| 40 | +cmd = 'cmd = /work/siddharth/ns-3/dce-Nov15/dce/source/ns-3-dce/build/bin/%(script)s --error=%(x)s --seed=%(runNo)s --pktSize=%(pktSize)s --accessSpeed=%(accessSpeed)s --accessDelay=%(accessDelay)s --bottleneckSpeed=%(bottleneckSpeed)s --bottleneckDelay=%(bottleneckDelay)s --pcapFile=%(pcapFile)s --queue_size=%(queue_size)s --dceProt=%(dceProt)s --stopTime=%(stopTime)s --qMonitoring=%(qMonitoring)s --qSizeFileName=%(qSizeFileName)s' |
| 41 | +speed = [2000,4000,6000,8000,10000] |
| 42 | +#speed=[200,400,600,800] |
| 43 | +#speed = [200,400,600,800,1000] |
| 44 | +speedUnit = "Mbps" |
| 45 | +delay = [10,50,100,150,200,250] |
| 46 | +#delay=[50,100,150,200,250] |
| 47 | +#delay = [10,50,100,150,200,250] |
| 48 | +# for multiple flows |
| 49 | +#tcpVariants = ["cubic,reno"] |
| 50 | +tcpVariants = ["bic,bic","cubic,cubic","htcp,htcp","highspeed,highspeed","yeah,yeah","scalable,scalable","illinois,illinois","bic,reno","cubic,reno","htcp,reno","highspeed,reno","yeah,reno","scalable,reno","illinois,reno"] |
| 51 | +# for single flow |
| 52 | +#tcpVariants = ["cubic", "bic"] |
| 53 | +#tcpVariants = ["bic", "cubic", "highspeed", "htcp", "hybla", "Illinois", "lp", "reno", "scalable", "westwood", "vegas", "yeah", "veno"] |
| 54 | +#tcpVariants = ["bic", "cubic", "highspeed", "htcp", "Illinois", "scalable", "yeah"] |
| 55 | +#tcpVariants = ["bic,bic","cubic,cubic","htcp,htcp","highspeed,highspeed","yeah,yeah","scalable,scalable","illinois,illinois"] |
| 56 | +delayUnit = "ms" |
| 57 | + |
| 58 | +######################################################################################################## |
| 59 | +######################################################################################################## |
| 60 | +# Create pbs scripts for *.cfg files in the created directory |
| 61 | +#os.chdir(cfgDir) |
| 62 | +jobsDir = "mul-flows-Jan15_11-18" # look into this later |
| 63 | +driverFileName = "driver.sh" |
| 64 | +driverFileName = os.path.join(jobsDir, driverFileName) |
| 65 | + |
| 66 | +#for files in os.listdir("."): |
| 67 | +# if files.endswith(".cfg"): |
| 68 | +# cfgPbsWriter (files, jobsDir, tcpVariants) |
| 69 | + |
| 70 | +######################################################################################################### |
| 71 | + |
| 72 | +# Write config files in current directory |
| 73 | + |
| 74 | +for err in error: |
| 75 | + for q in qSize: |
| 76 | + for sim in simTime: |
| 77 | + for spe in speed: |
| 78 | + for de in delay: |
| 79 | + for tcp in tcpVariants: |
| 80 | + bottleneckSpeed = "bottleneckSpeed = " + str(spe) + speedUnit |
| 81 | + bottleneckDelay = "bottleneckDelay = " + str(de) + delayUnit |
| 82 | + stopTime = "stopTime = " + str(sim) |
| 83 | + bdpQsz = "bdpQsz = " + str(q) |
| 84 | + errorValue = "error = " + str(err) |
| 85 | + tcpNoComma = tcp.replace(",", "-") |
| 86 | + cfgID = scenario + "_" + str(err)+ "_" + str(spe) + speedUnit + "_" + str(de) + delayUnit + "_" + str(sim) + "_" + str(q) + "_" + tcpNoComma |
| 87 | + cfgFileName = cfgID + ".cfg" |
| 88 | + qMonFileName = "qSizeFileName = " + cfgID + ".mon" |
| 89 | + cfgFile = open (cfgFileName, "wb") |
| 90 | + cfgFile.write ("[" + scenario + "]" + "\n") |
| 91 | + cfgFile.write (errorValue + "\n") |
| 92 | + cfgFile.write (script + "\n") |
| 93 | + cfgFile.write (runs + "\n") |
| 94 | + cfgFile.write (pktSize + "\n") |
| 95 | + cfgFile.write (accessSpeed + "\n") |
| 96 | + cfgFile.write (accessDelay + "\n") |
| 97 | + cfgFile.write (bottleneckSpeed + "\n") |
| 98 | + cfgFile.write (bottleneckDelay + "\n") |
| 99 | + cfgFile.write (pcapFile + cfgID + "\n") |
| 100 | + cfgFile.write (csvName + cfgID + "\n") |
| 101 | + cfgFile.write (bdpQsz + "\n") |
| 102 | + cfgFile.write (outputFactor + "\n") |
| 103 | + cfgFile.write (dceProt + tcp + "\n") |
| 104 | + cfgFile.write (stopTime + "\n") |
| 105 | + cfgFile.write (qMonFileName + "\n") |
| 106 | + cfgFile.write (bdpQsz + "\n") |
| 107 | + cfgFile.write (cmd + "\n") |
| 108 | + cfgFile.close() |
| 109 | + cfgPbsWriter (cfgFileName, jobsDir) |
| 110 | + |
| 111 | +# create a shell script to qsub all pbs jobs |
| 112 | +driverFile = open(driverFileName, "wb") |
| 113 | +for files in os.listdir(jobsDir): |
| 114 | + if files.endswith(".pbs"): |
| 115 | + driverFile.write ("qsub " + files + "\n") |
| 116 | +driverFile.close () |
0 commit comments