Skip to content

Understand parallelisation #233

@LucaMantani

Description

@LucaMantani

I have now performed many different tests, both in my laptop and in the hpc, and using MPI seems to consistently yield slower results.

ultranest: 4.3.1
mpich: 4.2.1

I have also tried downgrading ultranest to 3.6.4, but still the test was unsuccessful.

I have been testing with this custom snippet, to make sure it's not something we do in colibri:

import ultranest
import time
import ultranest.stepsampler as ustepsampler


def log_likelihood(params):
    return -0.5 * sum((params - 0.5) ** 2 / 0.1**2)


def bayesian_prior(cube):
    return cube


Nparams = 50

parameters = ["w%i" % i for i in range(Nparams)]

sampler = ultranest.ReactiveNestedSampler(
    parameters,
    log_likelihood,
    bayesian_prior,
    log_dir="ultranest_log",
)

sampler.stepsampler = ustepsampler.SliceSampler(
                generate_direction=ultranest.stepsampler.generate_mixture_random_direction,
                nsteps=2*Nparams,
            )

t0 = time.time()
ultranest_result = sampler.run()
t1 = time.time()

print("ULTRANEST RUNNING TIME: %f" % (t1 - t0))

# sampler.plot()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions