Add partial-cpus test
This commit is contained in:
		
							parent
							
								
									60b575c8f8
								
							
						
					
					
						commit
						fe860b2e38
					
				| @ -11,6 +11,7 @@ test_emu(sort-first-and-full-ring.c SORT | ||||
|   SHOULD_FAIL REGEX "cannot find a event previous to clock") | ||||
| test_emu(burst-stats.c REGEX "burst stats: median/avg/max =  33/ 33/ 33 ns") | ||||
| test_emu(mp-simple.c MP) | ||||
| test_emu(partial-cpus.c MP) | ||||
| test_emu(merge-cpus-loom.c MP) | ||||
| test_emu(version-good.c) | ||||
| test_emu(version-bad.c SHOULD_FAIL REGEX "incompatible .* version") | ||||
|  | ||||
							
								
								
									
										34
									
								
								test/emu/ovni/partial-cpus.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								test/emu/ovni/partial-cpus.c
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,34 @@ | ||||
| /* Copyright (c) 2024 Barcelona Supercomputing Center (BSC)
 | ||||
|  * SPDX-License-Identifier: GPL-3.0-or-later */ | ||||
| 
 | ||||
| #include <stdio.h> | ||||
| #include <stdlib.h> | ||||
| #include <unistd.h> | ||||
| #include "common.h" | ||||
| #include "compat.h" | ||||
| #include "instr.h" | ||||
| #include "ovni.h" | ||||
| 
 | ||||
| /* Ensures that we can emit a partial list of CPUs. */ | ||||
| int | ||||
| main(void) | ||||
| { | ||||
| 	int rank = atoi(getenv("OVNI_RANK")); | ||||
| 	int nranks = atoi(getenv("OVNI_NRANKS")); | ||||
| 
 | ||||
| 	if (nranks < 2) | ||||
| 		die("needs at least 2 ranks"); | ||||
| 
 | ||||
| 	ovni_proc_init(1, "loom0", getpid()); | ||||
| 	ovni_thread_init(get_tid()); | ||||
| 
 | ||||
| 	int i = rank; | ||||
| 
 | ||||
| 	/* Only emit one CPU per thread */ | ||||
| 	ovni_add_cpu(i, i); | ||||
| 
 | ||||
| 	instr_thread_execute(i, -1, 0); | ||||
| 	instr_end(); | ||||
| 
 | ||||
| 	return 0; | ||||
| } | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user