Closed peter-t-fox closed 11 months ago
Hi Peter, sorry for the slow reaction, and thanks for reporting!
I'll probably add a command line option to write the string to a file to avoid potential confusion with other output, but I'll keep this and make sure to flush the buffer as well.
Great, thank you.
Hi Peter, I've added a new option (#238) that writes the location to a file. If it's not given, the manager will write the location to standard output as before, but now with a flush. Will that work for you?
This was released with version 0.7.0. Could you please test, and if this fixes it for you, close this issue?
Thanks! Sorry I didn't see this sooner: I don't seem to have notifications enabled. I am still working with version 0.6.0, but I should be able to test this soon. Thanks for making this change: it looks like it should do what I need.
@LourensVeen I have switched to using MUSCLE3 0.7.0, and I have had an opportunity to test this. It's now working as I would expect: the addition of flush=True
means I don't have to to force the manager to print the IP address via PYTHONUNBUFFERED
or similar.
So I think this issue can now be closed: thanks for your help!
If starting the manager and models manually from a script, the script needs to capture the
tcp:<ip>:<port>
string printed by the manager, and pass it to the models in their environment.However, the manager's
stdout
is not flushed, and so this is difficult e.g.We can force a flush by using the PYTHONUNBUFFERED environment variable:
or by using
python -u
to start the manager.Since the network information printed to
stdout
is needed for use in the case where the user is starting each of the components manually, it might be helpful to support that use case by updating the line:to
This way the user doesn't have to manually force a flush of the buffer.