Skip to content

Conversation

@hjelmn
Copy link
Member

@hjelmn hjelmn commented Jun 22, 2016

This fixes a couple of performance regressions and is targeted to 2.0.0.

@nysal, @thananon Let me know if there is anything else that should be fixed. The RC needs to go out ASAP.

hjelmn added 2 commits June 22, 2016 09:52
The OPAL_ENABLE_MULTI_THREADS macro is always defined as 1. This was
causing us to always use the multi-thread path for synchronization
objects. The code has been updated to use the opal_using_threads()
function. When MPI_THREAD_MULTIPLE support is disabled at build time
(2.x only) this function is a macro evaluating to false so the
compiler will optimize out the MT-path in this case. The
OPAL_ATOMIC_ADD_32 macro has been removed and replaced by the existing
OPAL_THREAD_ADD32 macro.

Signed-off-by: Nathan Hjelm <hjelmn@lanl.gov>
This commit adds another check to the low-priority callback
conditional that short-circuits the atomic-add if there are no
low-priority callbacks. This should improve performance in the common
case.

Signed-off-by: Nathan Hjelm <hjelmn@lanl.gov>
} else {
OPAL_ATOMIC_CMPSET_32(&(sync->count), 0, 0);
sync->status = -1;
/* this is an error path so just use the atomic */
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Want to point out this error path was wrong. OPAL_ATOMIC_CMPSET_32(&(sync->count), 0, 0); does nothing.

@thananon
Copy link
Member

👍
Thank you, Nathan.

@hjelmn hjelmn merged commit 4c4a8bb into open-mpi:master Jun 22, 2016
(sync)->next = NULL; \
(sync)->prev = NULL; \
(sync)->status = 0; \
if (opal_using_threads()) { \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since PTHREAD_COND_INIT and PTHREAD_MUTEX_INIT already check for opal_using_threads(), this branch might be redundant ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed. I didn't think to check what those macro did. Will clean it up in a bit.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless you want to do it. I can add your commit to the 2.x PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't see your comment until later, timezone issues. I see that you already have a PR to fix it - #1811

Thanks 👍

@nysal
Copy link
Member

nysal commented Jun 22, 2016

@hjelmn Apart from the previous comment it looks good 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants