-
Notifications
You must be signed in to change notification settings - Fork 51
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
Barrier cleanup #1092
Barrier cleanup #1092
Conversation
Changes Unknown when pulling 666f56e on garlick:barrier_cleanup into ** on flux-framework:master**. |
Codecov Report
@@ Coverage Diff @@
## master #1092 +/- ##
=========================================
- Coverage 78.03% 77.94% -0.1%
=========================================
Files 151 151
Lines 26105 26115 +10
=========================================
- Hits 20371 20355 -16
- Misses 5734 5760 +26
|
Instead of building libbarrier.so as a standalone library, fold it into libflux.so.
Problem: flux_barrier(), when called with a NULL name, creates a unique barrier name based on a counter which it stores in the flux_t handle under a key. However, the keys used to store and retrieve this state are inconsistent so it starts from scratch each time, resulting in non-unique barrier names. Make the aux key names consistent.
Problem: flux_barrier() implementation calls xzmalloc() and xasprintf() internally. These function call exit(1) on malloc failure and thus are inappropriate in a libflux function. Use malloc() and related functions directly and return ENOMEM to the caller if an out of memory error occurs.
Problem: flux_barrier () hardwires synchronous operation. Have flux_barrier() return a future instead of integer success code. It can be completed with flux_future_get(f, NULL). Convert users.
Relocate "tbarrier" from src/test to t/barrier, like all the other sharness-drive C test programs.
Changes Unknown when pulling 3c384e6 on garlick:barrier_cleanup into ** on flux-framework:master**. |
This looks like pretty good cleanup. I was going to say this misses the doc changes, but there's no doc for flux_barrier yet. So merge? |
Sure, thanks. |
This PR modifies
flux_barrier()
to return aflux_future_t
.It also eliminates the
libflux-barrier.so
shared library and folds the one function in it into libflux. If the barrier module is not loaded, this function will return NULL with errno == ENOSYS.Finally, it cleans up the function to eliminate exit-on-enomem behavior.