-
Notifications
You must be signed in to change notification settings - Fork 900
ompi/datatype: make datatype pack thread safe #1316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@bosilca Please take a look. This is targeted for 2.0.0. |
b8de755
to
76c9c49
Compare
Make sense, the patch is correct but sub-optimal (the packed description will be generated by all threads and then most of them will drop it). |
@bosilca Was thinking that would be ok in this case. Using atomics avoids adding a lock to the datatype structure. I will see if I can optimize the atomics version a bit more to avoid the the duplicate description generation. |
@regrant This is one found by the rma threading benchmarks. |
76c9c49
to
38a90ba
Compare
@bosilca Ok, optimized it a bit better. Now only one thread will create the datatype description. |
@hjelmn this looks good. Thanks for the optimization. 👍 |
Test FAILed. |
This commit makes ompi_datatype_get_pack_description thread safe. The call is used by osc/pt2pt to send the packed description to remote peers. Before this commit if MPI_THREAD_MULTIPLE is enabled and the user uses MPI_Put, MPI_Get, etc we could hit a race where multiple threads attempt to store the packed description on the datatype. Since the code in question is not performance-critical the threading fix uses opal_atomic_* calls instead of bothering with OPAL_THREAD_*. Signed-off-by: Nathan Hjelm <[email protected]>
38a90ba
to
b921831
Compare
ompi/datatype: make datatype pack thread safe
This commit makes ompi_datatype_get_pack_description thread safe. The
call is used by osc/pt2pt to send the packed description to remote
peers. Before this commit if MPI_THREAD_MULTIPLE is enabled and the
user uses MPI_Put, MPI_Get, etc we could hit a race where multiple
threads attempt to store the packed description on the datatype. Since
the code in question is not performance-critical the threading fix
uses opal_atomic_* calls instead of bothering with OPAL_THREAD_*.
Signed-off-by: Nathan Hjelm [email protected]