def execute(self, cleanup=True): """ Execute the bugger :return: """ res = None try: res = self._server.execute(self._pdict, cleanup) except KeyboardInterrupt: self.monitor.stop() server2 = Server(self.url) server2.kill() except socket.error: self.log.error("Server was interrupted") exit(1) finally: self.monitor.stop() if res is None: raise ValueError("Run failed") resstr = "%s\t%s\t %s\t %s\t %s\t %s\t %s" % ( str(datetime.datetime.utcnow()), self.message, self._pdict["cpuRangeVal"], self._pdict["outputDir"], res["Wallclock"], res["peak"] / 1024.**3, res["avg"] / 1024**3) self.log.info( "date \t\t\t message \t\t cpu \t outputdir \t time \t peak_mem \t avg_mem" ) self.log.info(resstr) with open(os.path.expanduser("~/result.dat"), "a") as out: out.write(resstr + "\n")
def execute(self, cleanup=True): """ Execute the bugger :return: """ res = None try: res = self._server.execute(self._pdict, cleanup) except KeyboardInterrupt: self.monitor.stop() server2 = Server(self.url) server2.kill() except socket.error: self.log.error("Server was interrupted") exit(1) finally: self.monitor.stop() if res is None: raise ValueError("Run failed") resstr = "%s\t%s\t %s\t %s\t %s\t %s\t %s" % (str(datetime.datetime.utcnow()), self.message, self._pdict["cpuRangeVal"], self._pdict["outputDir"], res["Wallclock"], res["peak"]/1024.**3, res["avg"]/1024**3) self.log.info("date \t\t\t message \t\t cpu \t outputdir \t time \t peak_mem \t avg_mem") self.log.info(resstr) with open(os.path.expanduser("~/result.dat"), "a") as out: out.write(resstr+"\n")