Executing the taskyield in a loop causes the runtime to maximize the probablily that we end up running the task again before we have the chance to emit the PPe event, so making the emulator panic as this breaks the current OpenMP task model.
		
			
				
	
	
		
			23 lines
		
	
	
		
			452 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			452 B
		
	
	
	
		
			C
		
	
	
	
	
	
| /* Copyright (c) 2025 Barcelona Supercomputing Center (BSC)
 | |
|  * SPDX-License-Identifier: GPL-3.0-or-later */
 | |
| 
 | |
| /*
 | |
|  * Ensures that we can emit a sequence of PPx, PPe, PPx, PPe events for the same
 | |
|  * OpenMP task to execute it again.
 | |
|  *
 | |
|  * See: https://gitlab.pm.bsc.es/rarias/ovni/-/issues/208
 | |
|  */
 | |
| 
 | |
| int
 | |
| main(void)
 | |
| {
 | |
| 	#pragma omp parallel
 | |
| 	#pragma omp master
 | |
| 	#pragma omp task untied
 | |
| 	{
 | |
| 		for (int i = 0; i < 10000; i++) {
 | |
| 			#pragma omp taskyield
 | |
| 		}
 | |
| 	}
 | |
| }
 |