3 Run the application with "--help" for documentation of how to run
6 Copyright (c) 2005 Scali AS. All Rights Reserved.
11 import lustre_obdsurveylib
15 # Compability with older python-distributions:
16 import optik as optparse
21 parser = optparse.OptionParser(version="%prog 1.0", usage="%prog <--diskio | --network | --networkdiskio> <targetlist>")
22 parser.add_option("--pagesize", type="int", default=4, help="Set the pagesize (KB)")
23 parser.add_option("--size", type="int", default=100, help="Set the dataset-size (MB)")
24 parser.add_option("--minrecordsize", type="int", default=1024, help="Minimum record size (KB)")
25 parser.add_option("--maxrecordsize", type="int", default=1024, help="Maximum record size (KB)")
26 parser.add_option("--minthreads", type="int", default=1, help="Minimum number of threads")
27 parser.add_option("--maxthreads", type="int", default=16, help="Maximum number of threads")
28 parser.add_option("--diskio", action="store_const", const="diskio", dest="mode",
29 help="Test local IO-performance on a set of OSTs. List OSTs as a space-seperated list of node:ostname.")
30 parser.add_option("--networkio", action="store_const", const="networkio", dest="mode",
31 help="Test network-performance. List network-connections as a space-seperated list of server:client pairs.")
32 parser.add_option("--networkdiskio", action="store_const", const="networkdiskio", dest="mode",
33 help="Test IO-performance over network. Assumes existing OSC-devices. List OSCs as a space-seperated list of"
34 "node:oscname pairs.")
35 (options, args) = parser.parse_args()
36 args = map(lambda arg: tuple(string.split(arg, ":")), args)
37 # Set up lustre-devices according to mode:
39 if options.mode == "diskio":
40 for node, device in args:
41 obdfilter = lustre_obdsurveylib.ExistingOBDFilter(node, device)
42 echo_client = lustre_obdsurveylib.EchoClient(node, device+"_client", obdfilter)
43 clients.append(echo_client)
44 elif options.mode == "networkio":
45 for servername, clientname in args:
46 obdecho = lustre_obdsurveylib.OBDEcho(servername, "test_obdecho")
47 osc = lustre_obdsurveylib.OSC(clientname, "test_osc", obdecho)
48 echo_client = lustre_obdsurveylib.EchoClient(clientname, "test_client", osc)
49 clients.append(echo_client)
50 elif options.mode == "networkdiskio":
51 for clientname, oscname in args:
52 osc = lustre_obdsurveylib.ExistingOSC(clientname, oscname)
53 echo_client = lustre_obdsurveylib.EchoClient(clientname, oscname+"_client", osc)
54 clients.append(echo_client)
56 parser.error("You need to specify either --diskio, --networkio or --networkdiskio")
57 rsz = options.minrecordsize
58 while rsz <= options.maxrecordsize:
59 threads = options.minthreads
60 while threads <= options.maxthreads:
61 results = lustre_obdsurveylib.ParallelTestBRW(clients, threads, options.size, ('w', 'r'), rsz, options.pagesize)
62 print "ost %2d sz %7dK rsz %4d thr %2d" % (len(clients), results[0].getTotalSize(), rsz, threads),
63 for result in results:
65 result.verifyExitCodes()
67 print "%30s" % "ERROR",
69 print "%s %8.2f [%8.2f,%8.2f]" % (result.getTestType(), result.getTotalBandwidth(), result.getMinBandwidth(), result.getMaxBandwidth()),
75 if __name__ == '__main__':
76 log = logging.getLogger()
77 log.addHandler(logging.StreamHandler())
78 log.setLevel(logging.INFO)