🤖 Bug fix for real attributes in parallel socket input (glvis -a)#368
🤖 Bug fix for real attributes in parallel socket input (glvis -a)#368
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes glvis -a behavior for parallel socket input in server mode by ensuring the “real attributes” setting is propagated into per-connection visualization sessions (so material attributes are preserved instead of being overwritten with processor ranks).
Changes:
- Thread the
keep_attr(-a/--real-attributes) flag throughGLVisServer(...)and into each newSession. - Initialize
Sessionwindows withwin.data_state.keep_attrsoStreamReaderpreserves real mesh attributes for parallel socket streams.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
najlkin
left a comment
There was a problem hiding this comment.
Looks good 👍 . It has been broken for a long time and the refactoring fixed that for other places, but even the parameters were missing here, so I was wondering if the bug is not a feature 😅.
We have a script command for that (psolution), but stream commands work differently and each part is sent with just solution, so we cannot just add easily a parameter there. Perhaps we could add some commands which would go before solution? 🤔 But we do not have that for other things and it requires to change how things are constructed and processed. Right now, StreamReader reads the stream and initializes DataState from which the visualization is initialized and only then processing is passed to communication_thread, which processes the rest. If we do not want change this completely, we could think of adding these initialization commands to StreamReader and let it process as many as needed until it reaches some solution command 🤔
|
The changes for stream commands for keeping attributes and other things are in #369 . |
I think it used to work before e6c40a8, but I could be wrong.
Just to confirm: the above paragraph is about the potential improvement suggestion to support this via a socket command? |
It goes a way longer before that, I just checked it worked the last time in v4.2, where it used to be a global variable, so it got broken with moving these methods to
Yes, basically describes the reasoning behind #369 . It can be merged here or separately, it is not inter-dependent. |
dylan-copeland
left a comment
There was a problem hiding this comment.
Thanks @tzanio! I tested, and everything looks fine. My only suggestion is to improve the documentation for the implementation of this functionality. It looks like keep_attr controls whether DataState::SetGridFunction calls ComputeDofsOffsets, and it is not clear to me why this would determine whether F11 splits the domain by attribute vs. parallel partition. Documentation could be added for keep_attr and these functions, as well as how they determine the behavior of F11.
|
@dylan-copeland , |
Disclaimer
The initial versions of this PR were written with a coding agent 🤖, however:
Overview
This is a bug fix for
glvis -awhich did not work correctly for parallel socket input.Testing
Start the server with
then send a solution via socket, from a mesh with multiple attributes, e.g.
and check that F11 pulls apart material subdomains, not processor subdomains.
Potential improvements