add threads per timing plot
This commit is contained in:
		
							parent
							
								
									f2e462842e
								
							
						
					
					
						commit
						af1125f477
					
				
					 2 changed files with 9 additions and 2 deletions
				
			
		|  | @ -7,8 +7,9 @@ threads, timings = [], [] | |||
| for file in os.listdir('timings'): | ||||
|     with open(f'timings/{file}', 'r') as f: | ||||
|         n, t = f.read().strip().split(',') | ||||
|         threads.append(int(n)) | ||||
|         timings.append(float(t)) | ||||
|         if n != 'None': | ||||
|             threads.append(int(n)) | ||||
|             timings.append(float(t)) | ||||
| threads = np.array(threads) | ||||
| timings = np.array(timings) | ||||
| 
 | ||||
|  | @ -20,4 +21,10 @@ fig, axs = plt.subplots() | |||
| # Remember to label your axis | ||||
| # Feel free to make it pretty | ||||
| 
 | ||||
| 
 | ||||
| axs.scatter(threads, timings) | ||||
| axs.set_xlabel("Number of Threads") | ||||
| axs.set_ylabel("Timings in seconds") | ||||
| axs.grit = True | ||||
| 
 | ||||
| plt.savefig('threads_v_timings.png', dpi=300) | ||||
|  |  | |||
							
								
								
									
										
											BIN
										
									
								
								exercises/exerciseA/threads_v_timings.png
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								exercises/exerciseA/threads_v_timings.png
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 51 KiB | 
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue