-
Notifications
You must be signed in to change notification settings - Fork 30
Advanced usage: Nested Samplers and Multi threading
Currently, juliet
allows the user to perform Nested Sampling via classical Nested Sampling (either using MultiNest via PyMultiNest or via simple or multiple ellipsoids via dynesty), via Importance Nested Sampling (via PyMultiNest) or via Dynamic Nested Sampling (via dynesty).
All the above defined algorithms need as input the so-called live-points, which are the ones that explore the prior volume to compute the evidences and used to gather (unweighted) posterior samples (which are internally weighted to perform the final posterior samples which are saved by juliet
). Within juliet
the number of live points is set by default to 1000, but this can be changed via the -nlive
flag, e.g.,
python juliet.py ... -nlive 500
will set the number of live points to 500.
By default, juliet
uses Importance Nested Sampling via PyMultiNest. However, this algorithm starts to be inefficient for dimensions larger than around 20, where Dynamic Nested Sampling starts to excel. To activate dynesty
within juliet
, simply add the --use_dynesty
flag in a juliet
run, i.e.,
python juliet.py ... --use_dynesty
By default, this will perform a juliet
run using dynesty
's multi-ellipsoid Nested Sampling (i.e., similar to MultiNest). Dynamic Nested Sampling is activated via the --dynamic
flag, i.e.,
python juliet.py ... --use_dynesty --dynamic
For typical problems in exoplanetary science, multiple-ellipsoids might be overkill as there is usually one global maximum. If this is believed to be the case, one can turn off the multiple ellipsoids by setting the -dynesty_bound
flag to single
, i.e.,
python juliet.py ... --use_dynesty --dynamic -dynesty_bound single
This latter option usually involves a significant speed-up in computation time. Although this might be sufficient for most usages, further options for dynesty
can be defined; we refer the user to check the possible juliet
flags that allows to do this.
One of the nice features of juliet
(thanks to the usage of MultiNest
and dynesty
for Nested Sampling) is its ability to perform multi-threading to speed up the runs. Depending on the number of cores this can dramatically decrease the computing time, which will be dependant on the number of dimensions of the problem at hand.
Depending on the algorithm used to perform Nested Sampling, turning multi-threading on will be different. Below we detail how to do this within juliet
.
MultiNest
(used in juliet
via PyMultiNest
) provides direct OpenMPI support (which needs to be installed in your machine) for multi-threading. As such, activating multi-threading via MultiNest
is done externally. In order to activate it, instead of starting a juliet
run using python juliet ...
, one would start a juliet
run by doing:
mpirun -np X python juliet.py ...
where X
is the number of threads to be used. This will thus start a juliet
run with X
threads.
If a juliet
run is performed using dynesty
instead of MultiNest
(the latter being juliet
's the default sampler), multi-threading is performed internally via python
parallelization. This has already been coded inside juliet
, and thus using this is extremely simple. To use it, simply add the flag -dynesty_nthreads X
, where X
is the number of threads to use, i.e.:
python juliet.py ... -dynesty_nthreads X
Activating this flag means by default the user wants to perform multi-threading.
- Home
- Installing and basic usage
- Advanced usage: linear models
- Advanced usage: GPs
- Advsanced usage: RV trends
- Advanced usage: time definitions & super sampling
- Advanced usage: Nested Samplers and Multi-threading
- Tutorial 1: K2-140b
- Tutorial 2: the K2-32 multi-planet system
- Citing juliet
- Acknowledgements
- FAQs