File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515
1616def find_profile_files (build_dir ):
1717 """Find all .profraw files in the build directory."""
18- profile_files = list (Path (build_dir ).rglob ("*.profraw" ))
18+ # Look for both regular .profraw files and MPI rank-specific files
19+ profile_files = []
20+
21+ # Standard .profraw files
22+ profile_files .extend (list (Path (build_dir ).rglob ("*.profraw" )))
23+
24+ # MPI rank-specific files (e.g., file.profraw_rank_0)
25+ profile_files .extend (list (Path (build_dir ).rglob ("*.profraw_rank_*" )))
26+
27+ # Remove duplicates while preserving order
28+ seen = set ()
29+ unique_files = []
30+ for f in profile_files :
31+ if f not in seen :
32+ seen .add (f )
33+ unique_files .append (f )
34+
35+ profile_files = unique_files
36+
1937 if not profile_files :
2038 print ("No profile files found!" , file = sys .stderr )
2139 print (f"Searched in: { Path (build_dir ).absolute ()} " , file = sys .stderr )
You can’t perform that action at this time.
0 commit comments