Add OpenMP barrier before releasing threadinfo & global communicator to avoid race (#225)

- Added `#pragma omp barrier` just before threads start releasing their threadinfo / global
  communicator.
- This ensures all threads reach this sync point, preventing interleaved cleanup.

Co-authored-by: harsdave <harsdave@amd.com>
This commit is contained in:
Dave, Harsh
2025-10-24 16:22:45 +05:30
committed by GitHub
parent ab25b825aa
commit 90d252d59a
2 changed files with 4 additions and 2 deletions

View File

@@ -101,7 +101,7 @@ void* bli_sba_acquire
}
#else
block = bli_malloc_user( req_size, &r_val );
block = bli_malloc_intl( req_size, &r_val );
#endif
@@ -145,7 +145,7 @@ void bli_sba_release
}
#else
bli_free_user( block );
bli_free_intl( block );
#endif
}

View File

@@ -121,6 +121,8 @@ err_t bli_l3_sup_thread_decorator
thread
);
/* Synchronize all threads */
#pragma omp barrier
// Free the current thread's thrinfo_t structure.
bli_l3_sup_thrinfo_free( rntm_p, thread );
}