def process(): """ Process the files in the queue directory. """ config = ConfigParser() config.read(['../project_config']) for filename in os.listdir(config.get("locations", "queue")) : parser_obj = Parser(os.path.join(config.get("locations", "queue"), filename)) parser_obj.run()
def main(): # TODO : implement getopt style arguments if len(sys.argv) == 2 : filename = sys.argv[1] else : print "Usage: python parser.py <relative-path-to-file>" sys.exit(1) parser_obj = Parser(filename) parser_obj.run()
def process(): """ Process the files in the queue directory. """ config = ConfigParser() config.read(['../project_config']) for filename in os.listdir(config.get("locations", "queue")): parser_obj = Parser( os.path.join(config.get("locations", "queue"), filename)) parser_obj.run()
def main(): # TODO : implement getopt style arguments if len(sys.argv) == 2: filename = sys.argv[1] else: print "Usage: python parser.py <relative-path-to-file>" sys.exit(1) parser_obj = Parser(filename) parser_obj.run()
def show_result(request, filename): #TODO: Check for the case when a duplicate file is submitted, with a pre-existing Md5 sum """ """ # Parse the file if not Md5Log.objects.filter(file_name=filename + '.log'): file = settings.MEDIA_ROOT + 'benchmarkLogs/' + filename + '.log' parser_obj = Parser(file) parser_obj.run() flush_transaction() #transaction.enter_transaction_management() #transaction. time.sleep(3) while not Md5Log.objects.filter(file_name=filename + '.log'): flush_transaction() print Md5Log.objects.filter(file_name=filename + '.log') flush_transaction() continue data_dict = {} #Query the database for Benchmark data from benchmark_logs table file_obj = Md5Log.objects.filter(file_name=filename + '.log')[0] data_dict['BRLCAD_Version'] = file_obj.benchmark.brlcad_version data_dict['Running_Time'] = file_obj.benchmark.running_time data_dict['Time_of_Execution'] = file_obj.benchmark.time_of_execution data_dict['VGR_Rating'] = file_obj.benchmark.approx_vgr data_dict['Log_VGR'] = file_obj.benchmark.log_vgr data_dict['Parameters'] = file_obj.benchmark.params #Query the database for System Information from machine_info table data_dict['Clock_Speed'] = file_obj.benchmark.machineinfo.cpu_mhz data_dict['NCores'] = file_obj.benchmark.machineinfo.cores data_dict['NProcessors'] = file_obj.benchmark.machineinfo.processors data_dict['Vendor_ID'] = file_obj.benchmark.machineinfo.vendor_id data_dict['OS_Type'] = file_obj.benchmark.machineinfo.ostype data_dict[ 'Processor_Model_Name'] = file_obj.benchmark.machineinfo.model_name #Query the database for individual Image Performance data_dict['Rt_Average'] = file_obj.benchmark.rtaverage_set.all()[0].abs_rps data_dict['Rt_Bldg391'] = file_obj.benchmark.rtbldg391_set.all()[0].abs_rps data_dict['Rt_M35'] = file_obj.benchmark.rtm35_set.all()[0].abs_rps data_dict['Rt_Moss'] = file_obj.benchmark.rtmoss_set.all()[0].abs_rps data_dict['Rt_Sphlake'] = file_obj.benchmark.rtbldg391_set.all()[0].abs_rps data_dict['Rt_Star'] = file_obj.benchmark.rtstar_set.all()[0].abs_rps data_dict['Rt_World'] = file_obj.benchmark.rtworld_set.all()[0].abs_rps data_dict['filename'] = filename return render_to_response('result.html', data_dict, context_instance=RequestContext(request))
def show_result(request, filename): #TODO: Check for the case when a duplicate file is submitted, with a pre-existing Md5 sum """ """ # Parse the file if not Md5Log.objects.filter(file_name=filename+'.log'): file = settings.MEDIA_ROOT + 'benchmarkLogs/' + filename + '.log' parser_obj = Parser(file) parser_obj.run() flush_transaction() #transaction.enter_transaction_management() #transaction. time.sleep(3) while not Md5Log.objects.filter(file_name=filename+'.log'): flush_transaction() print Md5Log.objects.filter(file_name=filename+'.log') flush_transaction() continue data_dict = { } #Query the database for Benchmark data from benchmark_logs table file_obj = Md5Log.objects.filter(file_name=filename+'.log')[0] data_dict['BRLCAD_Version'] = file_obj.benchmark.brlcad_version data_dict['Running_Time'] = file_obj.benchmark.running_time data_dict['Time_of_Execution'] = file_obj.benchmark.time_of_execution data_dict['VGR_Rating'] = file_obj.benchmark.approx_vgr data_dict['Log_VGR'] = file_obj.benchmark.log_vgr data_dict['Parameters'] = file_obj.benchmark.params #Query the database for System Information from machine_info table data_dict['Clock_Speed'] = file_obj.benchmark.machineinfo.cpu_mhz data_dict['NCores'] = file_obj.benchmark.machineinfo.cores data_dict['NProcessors'] = file_obj.benchmark.machineinfo.processors data_dict['Vendor_ID'] = file_obj.benchmark.machineinfo.vendor_id data_dict['OS_Type'] = file_obj.benchmark.machineinfo.ostype data_dict['Processor_Model_Name'] = file_obj.benchmark.machineinfo.model_name #Query the database for individual Image Performance data_dict['Rt_Average'] = file_obj.benchmark.rtaverage_set.all()[0].abs_rps data_dict['Rt_Bldg391'] = file_obj.benchmark.rtbldg391_set.all()[0].abs_rps data_dict['Rt_M35'] = file_obj.benchmark.rtm35_set.all()[0].abs_rps data_dict['Rt_Moss'] = file_obj.benchmark.rtmoss_set.all()[0].abs_rps data_dict['Rt_Sphlake'] = file_obj.benchmark.rtbldg391_set.all()[0].abs_rps data_dict['Rt_Star'] = file_obj.benchmark.rtstar_set.all()[0].abs_rps data_dict['Rt_World'] = file_obj.benchmark.rtworld_set.all()[0].abs_rps data_dict['filename'] = filename return render_to_response('result.html', data_dict, context_instance=RequestContext(request))