Currently NESO executables are called using subprocess.run with capture_output keyword argument set to True to capture the stdout and stderr output streams, with the captured output available on process completion in the returned CompletedProcess object (which is passed to the extract_outputs function usd to generate the outputs). While this allows inspecting / displaying what was written to the output streams after the simulation has finished running, it would be useful to have the option of displaying the outputs streams as the model is running to check on progress and/or allow easier debugging when errors occur.
Currently NESO executables are called using
subprocess.run
withcapture_output
keyword argument set toTrue
to capture thestdout
andstderr
output streams, with the captured output available on process completion in the returnedCompletedProcess
object (which is passed to theextract_outputs
function usd to generate the outputs). While this allows inspecting / displaying what was written to the output streams after the simulation has finished running, it would be useful to have the option of displaying the outputs streams as the model is running to check on progress and/or allow easier debugging when errors occur.One option for doing this would be to instead create the subprocess using
asyncio
and asynchronously process outputs written to thestdout
andstderr
streams as suggested in this StackOverflow answer.