signac-flow icon indicating copy to clipboard operation
signac-flow copied to clipboard

Message management for running with signac flow directives

Open PheelyC opened this issue 4 years ago • 3 comments

Feature description

At the moment when running with operation directives or command line option, the Environment messages are printed each time and the progress bar is forced to start a new line as shown below. signac_flow_message

I would like to have a silent option that controls the signac flow messages that are not part of the progress bar, such that the bar can be static.

PheelyC avatar Jul 23 '21 19:07 PheelyC

@PheelyC Can you confirm if this happens with the "fork" directive disabled? We discussed enabling "fork" for your application on Slack, so I wonder if it's due to output from the forked process.

bdice avatar Jul 23 '21 19:07 bdice

Upon further testing, I found that other directives than fork do not generate the issue, however, if I use the timeout option (run -t num) in the command line as I run, the issue comes up.

PheelyC avatar Jul 23 '21 19:07 PheelyC

@PheelyC There are some options like timeout that require forking — the fork directive can force execution in a subprocess, but setting fork=False isn’t guaranteed to avoid forking if other options require it. That would explain why you’re seeing the messages in both of those cases. 👍

https://docs.signac.io/projects/flow/en/latest/api.html?highlight=Fork#flow.directives

Copying the current docs here for posterity (we are reworking this portion of the docs):

The fork directive can be set to True to enforce that a particular operation is always executed within a subprocess and not within the Python interpreter’s process even if there are no other reasons that would prevent that. Note: Setting fork=False will not prevent forking if there are other reasons for forking, such as a timeout.

bdice avatar Jul 23 '21 19:07 bdice