original_docstring: 
          Compute the PDF when the
          different phases are allocated 
          different cores. Check if
          the superposition of PDF holds.
      
docstring: Compute the PDF when the
  different phases are allocated
  different cores. Check if
  the superposition of PDF holds.
docstring_tokens: Compute the PDF when the different phases are allocated different cores . Check if the superposition of PDF holds .
code: def expansion_pdf_comp():
      """
          Compute the PDF when the
          different phases are allocated 
          different cores. Check if
          the superposition of PDF holds.
      """
  
      # 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")
  
      # Retrieve the PDFs of all the phases
      i1  = ptsl.etPDF(i1_table[89,:],ptsl.BINS)
      i2  = ptsl.etPDF(i2_table[89,:],ptsl.BINS)
      crc = ptsl.etPDF(crc_table[89,:],ptsl.BINS)
      pdf1 = ptsl.etPDF(ph1_table[89,8,:],ptsl.BINS)
      pdf2 = ptsl.etPDF(ph2_table[89,16,:],ptsl.BINS)
      pdf3 = ptsl.etPDF(ph3_table[89,20,:],ptsl.BINS)
      pdf4 = ptsl.etPDF(ph4_table[89,24,:],ptsl.BINS)
  
      sfet   = pdf1 + pdf1 + pdf2 + pdf2 + i1 + i1 + pdf3 + pdf3 + i2 + pdf4 + crc
      print(sfet)
  
      # (Actual Distribution)
      tmp        = pd.read_csv("/home/amaity/Dropbox/Datasets-Analyses/ptss-poc/Validation-Datasets/alloc_prbs-90_cores-8-16-20-24/dataset_sf.csv")
      c2         = tmp['ExecutionTime'] * 1000.0
      #print(np.mean(c2))
      print("Actual Ditribution Mean : %f, std %f" % (np.mean(c2),np.std(c2)))
  
      # Plot the pdf
      plt.plot(sfet.xp,sfet.pdf(sfet.xp),label="Estimated")
      plt.hist(c2,bins=len(ptsl.BINS),density=True,label="Oct-28")
      plt.xlim(2200,5000)
      plt.xlabel("Execution Time (in ms)")
      plt.ylabel("PDF")
      plt.legend()
      plt.title("Execution Time Distribution")
      #plt.savefig("comparison-prb100-cores2.pdf")
      # fig,axes = plt.subplots(nrows=1, ncols=2, figsize=(10, 5))
      # # Actual (PDF)
      # axes[0].set_title("Actual PDF")
      # axes[0].hist(c2,bins=ptsl.BINS,color='blue')
      # axes[0].set_ylabel("Probabilty Distribution")
      # axes[0].set_xlabel("Execution Time (us)")
      # axes[0].set_xlim(500,5000)
      # # Estimated (PDF)
      # axes[1].set_title("Estimated PDF")
      # axes[1].plot(sfet.xp,sfet.pdf(sfet.xp),color='black')
      # axes[1].set_ylabel("Probabilty Distribution")
      # axes[1].set_xlabel("Execution Time (us)")
      # axes[1].set_xlim(500,5000)
      # #axes[1].set_xlim(0.7,3)
code_tokens: def expansion_pdf_comp ( ) : 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" ) i1 = ptsl . etPDF ( i1_table [ 89 , : ] , ptsl . BINS ) i2 = ptsl . etPDF ( i2_table [ 89 , : ] , ptsl . BINS ) crc = ptsl . etPDF ( crc_table [ 89 , : ] , ptsl . BINS ) pdf1 = ptsl . etPDF ( ph1_table [ 89 , 8 , : ] , ptsl . BINS ) pdf2 = ptsl . etPDF ( ph2_table [ 89 , 16 , : ] , ptsl . BINS ) pdf3 = ptsl . etPDF ( ph3_table [ 89 , 20 , : ] , ptsl . BINS ) pdf4 = ptsl . etPDF ( ph4_table [ 89 , 24 , : ] , ptsl . BINS ) sfet = pdf1 + pdf1 + pdf2 + pdf2 + i1 + i1 + pdf3 + pdf3 + i2 + pdf4 + crc print ( sfet ) tmp = pd . read_csv ( "/home/amaity/Dropbox/Datasets-Analyses/ptss-poc/Validation-Datasets/alloc_prbs-90_cores-8-16-20-24/dataset_sf.csv" ) c2 = tmp [ 'ExecutionTime' ] * 1000.0 print ( "Actual Ditribution Mean : %f, std %f" % ( np . mean ( c2 ) , np . std ( c2 ) ) ) plt . plot ( sfet . xp , sfet . pdf ( sfet . xp ) , label = "Estimated" ) plt . hist ( c2 , bins = len ( ptsl . BINS ) , density = True , label = "Oct-28" ) plt . xlim ( 2200 , 5000 ) plt . xlabel ( "Execution Time (in ms)" ) plt . ylabel ( "PDF" ) plt . legend ( ) plt . title ( "Execution Time Distribution" )
short_docstring: Compute the PDF when the
  different phases are allocated
  different cores.
short_docstring_tokens: Compute the PDF when the different phases are allocated different cores .
comment: """
          Compute the PDF when the
          different phases are allocated 
          different cores. Check if
          the superposition of PDF holds.
      """$SEP$# The pdfs are already computed, load them from the pdf db file$SEP$# Retrieve the PDFs of all the phases$SEP$# (Actual Distribution)$SEP$#print(np.mean(c2))$SEP$# Plot the pdf$SEP$#plt.savefig("comparison-prb100-cores2.pdf")$SEP$# fig,axes = plt.subplots(nrows=1, ncols=2, figsize=(10, 5))$SEP$# # Actual (PDF)$SEP$# axes[0].set_title("Actual PDF")$SEP$# axes[0].hist(c2,bins=ptsl.BINS,color='blue')$SEP$# axes[0].set_ylabel("Probabilty Distribution")$SEP$# axes[0].set_xlabel("Execution Time (us)")$SEP$# axes[0].set_xlim(500,5000)$SEP$# # Estimated (PDF)$SEP$# axes[1].set_title("Estimated PDF")$SEP$# axes[1].plot(sfet.xp,sfet.pdf(sfet.xp),color='black')$SEP$# axes[1].set_ylabel("Probabilty Distribution")$SEP$# axes[1].set_xlabel("Execution Time (us)")$SEP$# axes[1].set_xlim(500,5000)$SEP$# #axes[1].set_xlim(0.7,3)