Skip to content

Commit

Permalink
Get rid of local copy of ompi_mpi_thread_multiple.
Browse files Browse the repository at this point in the history
The global variable is set once in ompi_init, it's safe to
read it within the lock region.

Signed-off-by: Rainer Keller <rainer.keller@hs-esslingen.de>
  • Loading branch information
hpcraink committed Mar 25, 2024
1 parent 7081d1a commit 667536d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions ompi/mca/pml/base/pml_base_bsend.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ int mca_pml_base_bsend_attach(void* addr, int size)
{
int align;

bool thread_safe = ompi_mpi_thread_multiple;
if(NULL == addr || size <= 0) {
return OMPI_ERR_BUFFER;
}
Expand All @@ -150,7 +149,7 @@ int mca_pml_base_bsend_attach(void* addr, int size)
}

/* try to create an instance of the allocator - to determine thread safety level */
mca_pml_bsend_allocator = mca_pml_bsend_allocator_component->allocator_init(thread_safe, mca_pml_bsend_alloc_segment, NULL, NULL);
mca_pml_bsend_allocator = mca_pml_bsend_allocator_component->allocator_init(ompi_mpi_thread_multiple, mca_pml_bsend_alloc_segment, NULL, NULL);
if(NULL == mca_pml_bsend_allocator) {
OPAL_THREAD_UNLOCK(&mca_pml_bsend_mutex);
return OMPI_ERR_BUFFER;
Expand Down

0 comments on commit 667536d

Please sign in to comment.