index=0

    # initialize times
    bat_update_time=0.0
    tbat_update_time=0.0

    for t in xrange(0,max_exp_times):
        print 'loop=%d' %(t+1)
        sys.stdout.flush() # flush print in nohup.out

        # create data
        pd.prepareData(num_lines,bat_file_name,tbat_file_name)

        # update data list
        update_file_name=data_dir+'update'+str(per)+suffix
        pd.prepareUpdateList(per,num_lines,update_file_name)

        # update TBAT
        start1=time.time()
        ud.updateTBAT(tbat_file_name,update_file_name)
        temp1=time.time()-start1
        tbat_update_time_table[index][t]=temp1

        # update BAT
        start2=time.time()
        # ud.updateBATFast2(bat_file_name, update_file_name)
        # ud.updateBAT1(bat_file_name,update_file_name)
        ud.updateBAT3(bat_file_name, update_file_name)
        temp2=time.time()-start2
        bat_update_time_table[index][t]=temp2
        result_file.write('loop = %3d: | tbat_time | %12g | bat_time | %12g | overhead | %12g \n'
    index=0

    # initialize times
    bat_update_time=0.0
    tbat_update_time=0.0

    for t in xrange(0,max_exp_times):
        print 'loop=%d' %(t+1)
        sys.stdout.flush() # flush print in nohup.out

        # create data
        pd.prepareData(num_lines,bat_file_name,tbat_file_name)

        # update data list
        update_file_name=data_dir+'update'+str(per)+suffix
        pd.prepareUpdateList(per,num_lines,update_file_name)

        # update TBAT
        start1=time.time()
        ud.updateTBAT(tbat_file_name,update_file_name)
        temp1=time.time()-start1
        tbat_update_time_table[index][t]=temp1

        # update BAT
        start2=time.time()
        ud.updateBAT1(bat_file_name,update_file_name)
        temp2=time.time()-start2
        bat_update_time_table[index][t]=temp2
        result_file.write('loop = %3d: | tbat_time | %12g | bat_time | %12g | overhead | %12g \n'
                          % (t+1, temp1,temp2,temp2/temp1))