-
Notifications
You must be signed in to change notification settings - Fork 50
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
flux-broker: all ranks appear to open log-filename attribute #2581
Comments
Ugh, sorry. Good catch on the file opening problem. It would not hurt to move up the The |
Want to just throw the fix into your current work? Or if you'd like I could make the world's tiniest PR. (I guess I could add a test to make it more worthwhile) |
Sure, I'll add it to the PR I am working on. |
Problem: when the broker is started with the 'log-filename' attribute set on the command line, the log file is opened from all broker ranks. This does not match the documentation or the code. Move initialization of logbuf->rank in logbuf_initialize() to before logbuf_register_attrs() is called. Now the test for rank 0 is only true on rank 0. Move the logbuf->h initialization too for consistency. Fixes flux-framework#2581
While quickly working through
flux start
example in flux-framework/flux-workflow-examples#40, I noticed that it appears setting thelog-filename
attribute via-S
on the broker commandline causes the logfile to be opened by all ranks, instead of just rank 0 as is documented in manual and code.The issue appears to be that the log-file is opened when the attribute is set, and the attribute is being set before
logbuf->rank
, so all broker ranks are rank 0.To verify, I used printf debugging:
I verified the following small change fixes the issue:
However, I'm not sure if some other initialization should also be moved up in the function (e.g.
logbuf->h
isn't set until the end), and also the broker rank attribute is set here (via a function calledfake_rank
) and I'm not sure why. Code copied below for reference:The text was updated successfully, but these errors were encountered: