mirror of
https://github.com/amd/blis.git
synced 2026-04-19 23:28:52 +00:00
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:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user