original_docstring: 
          An improved version of compute_mean_diff1
  
          Computes the difference mean (and std) of estimated 
          subframe execution time distribution
          and actual subframe execution time distribution
  
          PDFs of subframe execution time are computed 
          using method-1
      
docstring: An improved version of compute_mean_diff1
  Computes the difference mean (and std) of estimated
  subframe execution time distribution
  and actual subframe execution time distribution
  
  PDFs of subframe execution time are computed
  using method-1
docstring_tokens: An improved version of compute_mean_diff1 Computes the difference mean ( and std ) of estimated subframe execution time distribution and actual subframe execution time distribution PDFs of subframe execution time are computed using method - 1
code: def compute_pdf_distance_v1():
      """
          An improved version of compute_mean_diff1
  
          Computes the difference mean (and std) of estimated 
          subframe execution time distribution
          and actual subframe execution time distribution
  
          PDFs of subframe execution time are computed 
          using method-1
      """
      shape          = (ptsl.W,ptsl.M,2)    # Workload, Cores and Mean estimated, Mean actual and Number of Cores
      ret_mean       = np.full(shape,-1.7)  # for storing the mean
      ret_std        = np.full(shape,-1.7)  # for storing the std 
  
      # The pdfs are already computed, load them from the pdf db file
      ph1_table = np.load("pdf-risk-db3/ph1db.npy")
      ph2_table = np.load("pdf-risk-db3/ph2db.npy")
      ph3_table = np.load("pdf-risk-db3/ph3db.npy")
      ph4_table = np.load("pdf-risk-db3/ph4db.npy")
      i1_table  = np.load("pdf-risk-db3/i1db.npy")
      i2_table  = np.load("pdf-risk-db3/i2db.npy")
      crc_table = np.load("pdf-risk-db3/crcdb.npy")
      
      for w in range(89,100):
          i1  = ptsl.etPDF(i1_table[w,:],ptsl.BINS)
          i2  = ptsl.etPDF(i2_table[w,:],ptsl.BINS)
          crc = ptsl.etPDF(crc_table[w,:],ptsl.BINS)
          #print(pd.DataFrame(i2_table[w,:]))
          #return
          for m in range(1,ptsl.M):
              start_time     = timeit.default_timer()
  
              # Retrieve the PDFs of all the phases
              pdf1 = ptsl.etPDF(ph1_table[w,m,:],ptsl.BINS)
              pdf2 = ptsl.etPDF(ph2_table[w,m,:],ptsl.BINS)
              pdf3 = ptsl.etPDF(ph3_table[w,m,:],ptsl.BINS)
              pdf4 = ptsl.etPDF(ph4_table[w,m,:],ptsl.BINS)
                  
              # Compose the execution time distribution
              sfet            = pdf1 + pdf1 + pdf2 + pdf2 + i1 + i1 + pdf3 + pdf3 + i2 + pdf4 + crc
              ret_mean[w,m,0] = sfet.mean()
              ret_std[w,m,0]  = sfet.std()
              print(sfet)
  
              # (Actual Distribution)
              tmp              = pd.read_csv("/home/amaity/Desktop/Datasets/ptss-raw-execution-data/ecolab-knl-2018-10-28/alloc_prbs-"+str(w+1)+"_cores-"+str(m+1)+"/dataset_sf.csv")
              c2               = (tmp['ExecutionTime'].values) * 1000.0
              # Median Filtering
              m2               = np.median(c2)
              c4               = list(filter((lambda x : abs(x-m2) < 5*m2),c2))
              ret_mean[w,m,1]  = np.mean(c4)
              ret_std[w,m,1]   = np.std(c4)
              print("Actual Distribution Mean : %f, std %f" % (np.mean(c4),np.std(c4)))
  
              # Also compute the error
              err_mean = abs(ret_mean[w,m,0] - ret_mean[w,m,1])*100/ret_mean[w,m,0]
              err_std  = abs(ret_std[w,m,0] - ret_std[w,m,1])*100/ret_std[w,m,0]
              elapsed = timeit.default_timer() - start_time
              print("Error mean : %.2f, std : %.2f"%(err_mean,err_std))
              print("Computed discrepancy for %d prbs on %d cores in %f seconds\n\n"%(w+1,m,elapsed))
              
      np.save("pdf-discrepancy-mean.npy",ret_mean)
      np.save("pdf-discrepancy-std.npy",ret_std)
      #return ret
code_tokens: def compute_pdf_distance_v1 ( ) : shape = ( ptsl . W , ptsl . M , 2 ) ret_mean = np . full ( shape , - 1.7 ) ret_std = np . full ( shape , - 1.7 ) ph1_table = np . load ( "pdf-risk-db3/ph1db.npy" ) ph2_table = np . load ( "pdf-risk-db3/ph2db.npy" ) ph3_table = np . load ( "pdf-risk-db3/ph3db.npy" ) ph4_table = np . load ( "pdf-risk-db3/ph4db.npy" ) i1_table = np . load ( "pdf-risk-db3/i1db.npy" ) i2_table = np . load ( "pdf-risk-db3/i2db.npy" ) crc_table = np . load ( "pdf-risk-db3/crcdb.npy" ) for w in range ( 89 , 100 ) : i1 = ptsl . etPDF ( i1_table [ w , : ] , ptsl . BINS ) i2 = ptsl . etPDF ( i2_table [ w , : ] , ptsl . BINS ) crc = ptsl . etPDF ( crc_table [ w , : ] , ptsl . BINS ) for m in range ( 1 , ptsl . M ) : start_time = timeit . default_timer ( ) pdf1 = ptsl . etPDF ( ph1_table [ w , m , : ] , ptsl . BINS ) pdf2 = ptsl . etPDF ( ph2_table [ w , m , : ] , ptsl . BINS ) pdf3 = ptsl . etPDF ( ph3_table [ w , m , : ] , ptsl . BINS ) pdf4 = ptsl . etPDF ( ph4_table [ w , m , : ] , ptsl . BINS ) sfet = pdf1 + pdf1 + pdf2 + pdf2 + i1 + i1 + pdf3 + pdf3 + i2 + pdf4 + crc ret_mean [ w , m , 0 ] = sfet . mean ( ) ret_std [ w , m , 0 ] = sfet . std ( ) print ( sfet ) tmp = pd . read_csv ( "/home/amaity/Desktop/Datasets/ptss-raw-execution-data/ecolab-knl-2018-10-28/alloc_prbs-" + str ( w + 1 ) + "_cores-" + str ( m + 1 ) + "/dataset_sf.csv" ) c2 = ( tmp [ 'ExecutionTime' ] . values ) * 1000.0 m2 = np . median ( c2 ) c4 = list ( filter ( ( lambda x : abs ( x - m2 ) < 5 * m2 ) , c2 ) ) ret_mean [ w , m , 1 ] = np . mean ( c4 ) ret_std [ w , m , 1 ] = np . std ( c4 ) print ( "Actual Distribution Mean : %f, std %f" % ( np . mean ( c4 ) , np . std ( c4 ) ) ) err_mean = abs ( ret_mean [ w , m , 0 ] - ret_mean [ w , m , 1 ] ) * 100 / ret_mean [ w , m , 0 ] err_std = abs ( ret_std [ w , m , 0 ] - ret_std [ w , m , 1 ] ) * 100 / ret_std [ w , m , 0 ] elapsed = timeit . default_timer ( ) - start_time print ( "Error mean : %.2f, std : %.2f" % ( err_mean , err_std ) ) print ( "Computed discrepancy for %d prbs on %d cores in %f seconds\n\n" % ( w + 1 , m , elapsed ) ) np . save ( "pdf-discrepancy-mean.npy" , ret_mean ) np . save ( "pdf-discrepancy-std.npy" , ret_std )
short_docstring: An improved version of compute_mean_diff1
  Computes the difference mean (and std) of estimated
  subframe execution time distribution
  and actual subframe execution time distribution
short_docstring_tokens: An improved version of compute_mean_diff1 Computes the difference mean ( and std ) of estimated subframe execution time distribution and actual subframe execution time distribution
comment: """
          An improved version of compute_mean_diff1
  
          Computes the difference mean (and std) of estimated 
          subframe execution time distribution
          and actual subframe execution time distribution
  
          PDFs of subframe execution time are computed 
          using method-1
      """$SEP$# Workload, Cores and Mean estimated, Mean actual and Number of Cores$SEP$# for storing the mean$SEP$# for storing the std $SEP$# The pdfs are already computed, load them from the pdf db file$SEP$#print(pd.DataFrame(i2_table[w,:]))$SEP$#return$SEP$# Retrieve the PDFs of all the phases$SEP$# Compose the execution time distribution$SEP$# (Actual Distribution)$SEP$# Median Filtering$SEP$# Also compute the error$SEP$#return ret