def precondition(self, nj=1, iod=1): ''' Workload independent preconditioning for SSDs. Write two times the device with streaming I/O. @return True if precontioning succeded @exception RuntimeError if fio command fails ''' job = FioJob() job.initialize() job.addKVArg("filename", self.getDevPath()) job.addKVArg("bs", "128k") job.addKVArg("rw", "write") job.addKVArg("direct", "1") job.addSglArg("minimal") job.addKVArg("numjobs", str(nj)) job.addKVArg("ioengine", "libaio") job.addKVArg("iodepth", str(iod)) job.addSglArg("group_reporting") job.addSglArg('refill_buffers') for i in range(SSD.wlIndPrecRnds): logging.info("# Starting preconditioning round " + str(i)) job.addKVArg("name", self.getDevName() + '-run' + str(i)) call, out = job.start() if call == False: logging.error( "# Could not carry out workload independent preconditioning" ) raise RuntimeError, "precondition error, fio command error" else: logging.info(out) logging.info("# Finished workload independent preconditioning") return True
def __init__(self, testname, device, options=None): ''' Constructor @param testname Name of the test, specifies the output file @param device The tested device, a device object ''' ## The name of the test, is used to give the resulting files a name self.__testname = testname ## The tested device, a Device object self.__device = device ## User defined options self.__options = options ## A fio job used to run the tests self.__fioJob = FioJob() ## A list of filenames representing the generated plots self.__figures = [] ## Measurement overview tables, from which plots are generated self.__tables = []