Closed FelixNoessler closed 1 year ago
Hi Felix (@FelixNoessler) Thank you for the request. I'll take a look. I tried this many years ago (maybe 10 years or so) but didn't come up with a good solution for this. In principle it should be possible I think, but no guarantees ...
Hello Rob,
when I remove the stdout= part, then everything is printed to the console. Is it possible to include an option (keyword argument?) whether to print the log to the console or to the log file? Or even save it to file and print it?
I think I tried the 'tee' command to duplicate the streams. Maybe I'll try your suggestion initially. I am a bit busy right now, might take a few days.
When you say "save it and print it", do you mean print the file repeatedly? It is updated by multiple threads.
I think I tried the 'tee' command to duplicate the streams. Maybe I'll try your suggestion initially. I am a bit busy right now, might take a few days.
No worries :)
When you say "save it and print it", do you mean print the file repeatedly? It is updated by multiple threads.
No, I dont want to print it several times.
The idea with tee is quite good, this works:
run(pipeline(par(m.cmds); stdout=`tee -a $(m.log_file[1])`))
Great, thanks for testing that. I'll enable the tee version using a keyword argument.
Hi @FelixNoessler Just pushed StanSample.jl v6.13.6 which has a new keyword show_logging
. E.g. in Pluto:
let
m_schools = SampleModel("eight_schools", stan_schools)
rc = stan_sample(m_schools; data, num_chains=5, use_cpp_chains=true, show_logging=true)
end;
That will hopefully work for you.
Thanks, that is perfect and was very quick! :)
Thanks @FelixNoessler
I'll update the README in the next release mentioning your contribution. Don't hear to often from folks on Windows so it is always nice to get confirmation it works ok!
Hello,
I manually installed Cmdstan in windows 11 and it works together with
StanSample.jl
. However, for long runs it is nice to see the progress printed to the console. At the moment, only warnings are printed. I know that I can look into the log file and see the progress there, but this is a bit cumbersome. The progress is printed when I use cmdstan directly. Is there an option to print the progress directly in the console withStanSample.jl
?Thank you for creating and maintaining the package!
Best, Felix
I tried the example code (but even for more complex models the progress is not printed):
Julia Version 1.8.2
Commit 36034abf26 (2022-09-29 15:21 UTC)
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: 8 × 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-13.0.1 (ORCJIT, tigerlake)