Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flushing the print buffer when running MultiNest #108

Open
gabrielastro opened this issue Aug 29, 2024 · 4 comments
Open

Flushing the print buffer when running MultiNest #108

gabrielastro opened this issue Aug 29, 2024 · 4 comments
Labels
wontfix This will not be worked on

Comments

@gabrielastro
Copy link

A small one: I am running species from a script and the output gets mixed up:

Interpolating WISE/WISE.W1... [DONE]
Interpolating WISE/WISE.W2... [DONE]
Interpolating WISE/WISE.W3...[…]/species/species/fit/fit_model.py:1718: RuntimeWarning: overflow encountered in scalar divide
  -0.5
[…]/species/species/fit/fit_model.py:1720: RuntimeWarning: overflow encountered in scalar power
  * (phot_item[0] - phot_flux) ** 2
[…]/species/species/util/model_util.py:458: RuntimeWarning: overflow encountered in power
  model_flux *= 10.0 ** (-0.4 * ext_filt)
[…]/species/species/util/model_util.py:449: RuntimeWarning: overflow encountered in multiply
  if "ism_ext" in model_param:
 *****************************************************
 MultiNest v3.10
 Copyright Farhan Feroz & Mike Hobson
 Release Jul 2015

 no. of live points = 2000
 dimensionality =   10
 *****************************************************
 Starting MultiNest
 generating live points
 live points generated, starting sampling
Acceptance Rate:                        0.999512
Replacements:                               2050
Total Samples:                              2051
Nested Sampling ln(Z):            **************
Importance Nested Sampling ln(Z):     183.325581 +/-  0.999756
Acceptance Rate:                        0.997151
Replacements:                               2100

…

Nested Sampling ln(Z):                241.594402
Importance Nested Sampling ln(Z):     239.276677 +/-  0.089403
Acceptance Rate:                        0.088813
Replacements:                              38900
 [DONE]

Fitting 10 parameters:

…

Total Samples:                            464532
Nested Sampling ln(Z):                241.633970
Importance Nested Sampling ln(Z):     239.280403 +/-  0.089069
 ln(ev)=   241.78528815170094      +/-   8.5812366936118753E-002
 Total Likelihood Evaluations:       464532
 Sampling finished. Exiting MultiNest

i.e. the higher-level species output goes on and afterwards the rest of the one from MultiNest comes…

Thanks!

@tomasstolker
Copy link
Owner

During the call of MultiNest, species is not printing anything, but that may happen when using multiprocessing.

@tomasstolker tomasstolker added the wontfix This will not be worked on label Aug 29, 2024
@gabrielastro
Copy link
Author

Thanks for your quick answer here too. Sorry for not specifying but this was a serial run. What I meant was that MultiNest finishes but does not print out everything yet, the normal species output comes (e.g., [DONE] and then continuing with the script), and then the rest of the MultiNest output comes. Maybe there is a MultiNest buffer that could be flushed once it is finished and before species starts printing again? But only if it is easy. And this was while saving the log to a file through nohup python3 script.py 2>&1 >> species.log &; sorry for forgetting to mention it, even though I do not think it should be specific to this.

@tomasstolker
Copy link
Owner

Hmm not sure why that happened. I don't think that is an issue of species because "Fitting X parameters" and "[Done]" should have been printed before MultiNest is called.

@gabrielastro
Copy link
Author

Ok, strange! I will try to test it a bit later and see if I can find an explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants