Giter Site home page Giter Site logo

johannesbuchner / pymultinest Goto Github PK

View Code? Open in Web Editor NEW
191.0 19.0 87.0 2.09 MB

Pythonic Bayesian inference and visualization for the MultiNest Nested Sampling Algorithm and PyCuba's cubature algorithms.

Home Page: http://johannesbuchner.github.io/PyMultiNest/

License: Other

Python 100.00%
nested-sampling python monte-carlo

pymultinest's Introduction

PyMultiNest -- Python interface for MultiNest

This library provides programmatic access to MultiNest and PyCuba.

What is MultiNest?

MultiNest is a program and a sampling technique. As a Bayesian inference technique, it allows parameter estimation and model selection. (find out more in the MultiNest paper, http://arxiv.org/abs/0809.3437, or in a classic MCMC sampler, http://apemost.sf.net/ ). Recently, MultiNest added Importance Nested Sampling (INS, see http://arxiv.org/abs/1306.2144) which is now also supported.

The efficient Monte Carlo algorithm for sampling the parameter space is based on nested sampling and the idea of disjoint multi-dimensional ellipse sampling.

For the scientific community, where Python is becoming the new lingua franca (luckily), I provide an interface to MultiNest.

https://travis-ci.com/JohannesBuchner/PyMultiNest.svg?branch=master

The automatic build makes sure both Python 2.7 and Python 3 are working correctly with MultiNest and Cuba. It also tests that MultiNest works with MPI enabled.

What does PyMultiNest do?

PyMultiNest

  • provides an easy-to-use interface to MultiNest and Cuba integration algorithms
  • allows connecting with your existing scientific Python code (numpy, scipy)
  • allows Prior & LogLikelihood functions written in Python.
  • Easy plotting, visualization and summary of MultiNest results.
  • Running MultiNest with MPI

The plotting can also be run on existing MultiNest output, and when not using PyMultiNest for running MultiNest.

Citing PyMultiNest

See http://johannesbuchner.github.io/PyMultiNest/index.html#citing-pymultinest

Plotting results, corner and trace plots

If you got pymultinest running with your likelihood (based on the pymultinest_demo*.py examples), you can create plots of the marginal probability distributions.

If you set outputfiles_basename="myprefix-" in the run, you need to create a file myprefix-params.json which gives the names of each parameters, for example:

[
  "param1",
  "param2",
  "$N\_\mathrm{H}$",
  "norm",
]

Then you can run:

$ python pymultinest-folder/multinest_marginals.py myprefix-

which will create marginal plots for you.

Recently I also added support for corner.py (needs to be installed):

$ python pymultinest-folder/multinest_marginals_corner.py myprefix-

Also possible is trace and corner plots:

$ python pymultinest-folder/multinest_marginals_fancy.py myprefix-

This last one has some potential drawbacks however: The code I borrowed here from dynesty is not meant for multi-modal nested sampling which reorders the points, so the trace plot may not be 100% correct for multi-modal problems.

Questions and Problems

For any questions or problems with the software, please open an issue. This helps other people google the same question.

Using MultiNest with Python?

Look at the documentation available at http://johannesbuchner.github.io/PyMultiNest/

What is PyCuba?

Cuba (http://www.feynarts.de/cuba/, https://github.com/JohannesBuchner/cuba) is a multidimensional numerical integration library for low dimensions. PyCuba allows integration of Python functions, providing an advanced alternative to the basic functions provided in scipy.integrate.

In the Bayesian sense, it is possible to use Cuba for model selection.

Q: Python callback functions are too slow!

If you really identified that your callback functions are too slow, even when using the usual tricks (numpy, etc.), you can implement and compile them as C functions.

You still have the neat python interface (default parameters, etc.), but achieve full execution speed, as only native code is executed while MultiNest runs.

pymultinest's People

Contributors

adamormondroyd avatar aignas avatar astromancer avatar beckermr avatar colmtalbot avatar hposborn avatar jgukelberger avatar johannesbuchner avatar khyox avatar markdewing avatar mattpitkin avatar piwanek avatar segasai avatar smfactor avatar thjsal avatar vetlewi avatar warrickball avatar williamjameshandley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pymultinest's Issues

Segfault in MULTINEST

I have a class that wraps pymultinest so that I can build likelihoods on the fly:


class mnfit:

def __init__(self,silent=False):

    self.silent = silent
    self.n_live_points = 10
    self.importance_nested_sampling = True
    self.resume = False
    self.verbose = True
    self.sampling_efficiency = 'model'



def LoadData(self):

    pass

def Explore(self):
    '''
    This member function invokes multinest.
    The data must be loaded and the likelihood set
    '''
    if not os.path.exists("chains"): os.mkdir("chains")

    # we want to see some output while it is running
    if not self.silent:
        print "SILENT"
        progress = pymultinest.ProgressPlotter(n_params = self.n_params); progress.start()
        threading.Timer(2, show, ["chains/1-phys_live.points.pdf"]).start() # delayed opening


    # run MultiNest
    pymultinest.run(self.likelihood, self.prior, self.n_params, importance_nested_sampling = self.importance_nested_sampling, resume = self.resume, verbose = self.verbose, sampling_efficiency = self.sampling_efficiency, n_live_points = self.n_live_points, init_MPI=False)


    # ok, done. Stop our progress watcher
    if not self.silent:
        progress.stop()

Since the run function expects a likelihood and prior with 3 arguments, I have a function that creates a call back:


def ConstructLikelihood(self):
    '''
    Provides a likelihood function based off the data and
    model provided. This function is fed to MULTINEST.

    '''

    # The Likelihood function for MULTINEST
    def likelihood(params, ndim, nparams):


        logL = 0. # This will be -2. * log(L)
        for det,mod,lh in zip(self.detList,self.models,self.lhs):


            # Here the model's params are set and the
            # and the matrix is convolved to get
            # model counts

            mod.SetParams(params) #set params for the models
            modCnts = mod.GetModelCnts() # convolve the matrix and ret counts

            lh.SetModelCounts(modCnts[det.activeLoChan:det.activeHiChan+1]) #pass model counts to lh

            # Here the DataBin objects' source and background
            # counts are sent to the likelihood object

            lh.SetBackGround(det.bkg[det.activeLoChan:det.activeHiChan+1],det.berr[det.activeLoChan:det.activeHiChan+1])
            lh.SetCounts(det.source[det.activeLoChan:det.activeHiChan+1])

            #This is log(L) so the joint stat is an addition


            logL+=lh.ComputeLikelihood()
        #print "logL = %f"%logL
        jointLH = exp(-0.5*(logL))

        return jointLH

    # Because this is inside a class we want to create a
    # likelihood function that does not have an object ref
    # as an argument, so it is created here as a callback

    self.likelihood = likelihood
    self.prior = self.models[0].prior

However, while running all the demos and examples results in success, I get the following output when I run the code:


MultiNest v3.4
Copyright Farhan Feroz & Mike Hobson
Release Oct 2013

no. of live points = 10
dimensionality = 4


Starting MultiNest
generating live points
[pool12:30332] *** Process received signal ***
[pool12:30332] Signal: Segmentation fault: 11 (11)
[pool12:30332] Signal code: Address not mapped (1)
[pool12:30332] Failing at address: 0x7fee62c00000
[pool12:30332] [ 0] 0 libsystem_platform.dylib 0x00007fff8884a5aa _sigtramp + 26
[pool12:30332] [ 1] 0 ??? 0x000000010154db90 0x0 + 4317305744
[pool12:30332] [ 2] 0 Python 0x00000001004ba2c7 PyObject_Call + 99
[pool12:30332] [ 3] 0 Python 0x0000000100502fdf slot_sq_item + 210
[pool12:30332] [ 4] 0 Python 0x00000001004da78b iter_iternext + 33
[pool12:30332] [ 5] 0 Python 0x00000001004b9d3c PyIter_Next + 16
[pool12:30332] [ 6] 0 Python 0x00000001004b9bc6 PySequence_Tuple + 240
[pool12:30332] [ 7] 0 Python 0x00000001004fb7ed tuple_new + 206
[pool12:30332] [ 8] 0 Python 0x00000001004fc81b type_call + 50
[pool12:30332] [ 9] 0 Python 0x00000001004ba2c7 PyObject_Call + 99
[pool12:30332] [10] 0 Python 0x0000000100536951 PyEval_EvalFrameEx + 13138
[pool12:30332] [11] 0 Python 0x0000000100539aa5 fast_function + 192
[pool12:30332] [12] 0 Python 0x00000001005365bb PyEval_EvalFrameEx + 12220
[pool12:30332] [13] 0 Python 0x0000000100539aa5 fast_function + 192
[pool12:30332] [14] 0 Python 0x00000001005365bb PyEval_EvalFrameEx + 12220
[pool12:30332] [15] 0 Python 0x0000000100539aa5 fast_function + 192
[pool12:30332] [16] 0 Python 0x00000001005365bb PyEval_EvalFrameEx + 12220
[pool12:30332] [17] 0 Python 0x000000010053346e PyEval_EvalCodeEx + 1612
[pool12:30332] [18] 0 Python 0x00000001004d818f function_call + 349
[pool12:30332] [19] 0 Python 0x00000001004ba2c7 PyObject_Call + 99
[pool12:30332] [20] 0 Python 0x00000001005362bf PyEval_EvalFrameEx + 11456
[pool12:30332] [21] 0 Python 0x000000010053346e PyEval_EvalCodeEx + 1612
[pool12:30332] [22] 0 Python 0x00000001004d818f function_call + 349
[pool12:30332] [23] 0 Python 0x00000001004ba2c7 PyObject_Call + 99
[pool12:30332] [24] 0 Python 0x000000010053924b PyEval_CallObjectWithKeywords + 93
[pool12:30332] [25] 0 _ctypes.so 0x000000010103c9f3 closure_fcn + 446
[pool12:30332] [26] 0 _ctypes.so 0x00000001010422a0 ffi_closure_unix64_inner + 520
[pool12:30332] [27] 0 _ctypes.so 0x0000000101041946 ffi_closure_unix64 + 70
[pool12:30332] [28] 0 libmultinest.so 0x0000000101cc04e5 __nested_MOD_gen_initial_live + 6288
[pool12:30332] [29] 0 libmultinest.so 0x0000000101cc1a81 __nested_MOD_nestsample + 3821
[pool12:30332] *** End of error message ***
Segmentation fault: 11

My thoughts are that this is some problem with referencing in the python objects. Thanks for any help you can provide!

Output problems for summary and stats files

Hi - some of the output files are not produced, but I haven't tracked down why yet (sorry!), e.g. 1-summary.txt. If the file does not already exist, it is produced but is empty.

1-post_separate.dat is empty when multimodal=True.

1-stats.txt is incomplete:

Global Evidence: -0.690049101357911621E+01 +/- 0.602774045152852864E-01

Local Mode Properties

Total Modes Found: 2

This is for all combinations of the verbose, write_output and multimodal keywords.

pymultinest.Analyzer(n_params = n_params).get_stats()['modes']
analysing data from chains/1-.txt
[]

is empty (whether multimodal is True or False), so I don't know where to get e.g. the MAP parameters from except by calculating those and other stats myself.

I guess you'll want a minimal example..?

evtol

@JohannesBuchner For me evtol has zero effect on the size of the evidence uncertainties - the only way I can find to reduce them is to increase the number of live points. Am I doing something wrong? Do you see the same behaviour? Thanks!

Passing args to likelihood/prior functions

Would this be possible? I.e.

def myprior(cube, ndim, nparams, *args):
    # do prior transformation

def myloglikelihood(cube, ndim, nparams, *args):
    x_data, y_data, error_data = args
    mod_data = some_model(cube)
    return np.sum((-0.5 * ((y_data - mod_data) / error_data) ** 2))

def main(x_data, y_data, err_data):
    parameters = ["x", "y"]
    n_params = len(parameters)

    pymultinest.run(myloglike, myprior, n_params, args=(x_data, y_data, err_data))

Thanks.

Bug in _read_table?

Hi, we encountered an issue in the analyse.py script. Specifically, the problem was in:

mode['maximum'] = self._read_table(modelines[1])[:,1].tolist()

Looking at _read_table, the following text block:

Maximum Likelihood Parameters
Dim No. Parameter
1 123
2 123

(being approximate, obviously) is split up into title and table, but then the line:

header, table = txt.split("\n", 1)

splits the ORIGINAL txt input, not the new "table" that is now 3 lines. Should this line read:

header, table = table.split("\n", 1)?

Interestingly I do not encounter this error with numpy 1.7.1, but my colleague does using 1.5.1. The if statement in loadtxt2d does not seem to adequately fix the problem of trying to input the string line "Dim", as a conversion to float error results.

Linux version of code produces infinities in likelihood evaluations

This strangely enough works on Macs. The python function seemingly gives the same output. We use the newest version of the libraries.

I think it's possibly related to this line of code that splits the model_param into a numpy array:

def multinest_evaluate(self, model_param, ndim, nparam):
    # returns the likelihood of observing the data given the model param_names
    model_param = np.array([model_param[i] for i in xrange(nparam)])

evidence_tolerance --> how to put the stopping criterion?

My PyMultiNest runs seem to run very well for my problem, and I can find higher logLikelihood values than with any other method (emcee for example). However, the acceptance ratio decreases rapidly, and after some 20 to 30k accepted points (with const_efficiency_mode=True and n_live_points=1000) the likelihood does not increase any more. I believe that this happens close to the global maximum, however multinest tries to go further and does not stop. I tried to increase evidence_tolerance, but I can not figure out what is a reasonable value for it. What does this stopping criterion represent? How high should I put it if I am interested only in the posterior samples? My best logLikelihood values are around -53000, which should be close to the optimum I guess.
Also, if I stop the run manually or via the max_iter parameter the post_equal_weights.dat contains only one line, instead of a sample of the posterior. Is this normal? How are these posterior samples created? Can I do this manually? How is the number of points in the posterior sample determined?
Thanks

Proper log prior

I'm using pymultinest to explore a big parameter space (27 independent parameters). Some of the parameters can range from 10.0 to 1.0e-6. Generally, all I've done in the prior function is multiple e.g. cube[0] by 10.0, so that the parameter space is [0, 10.0]. But I'm thinking this might misrepresent the potential values, as really small values may never be explored. Do you recommend a better way to do this type of exploration? Thanks!

How to compile Cuba and APEMoST

I have a question when installing PyMultiNest, in the tutorial you mentioned that we should get and compile Cuba and APEMoST, after that we will get libcuba.so and libapemost.so.

However I am not sure if I compile them in the right way. I download both Cuba and APEMoST and then extract them from the tar.gz file. Is this what you mean by compiling it?
The thing is that after I do this, I do not have a libcuba.so and libapemost.so, do you mind providing some help on this? Thank you very much!

I am using a mac with Yosemite system 10.10.3.

problem with random seed

Hi Johannes - I think this may be a multinest rather than pymultinest issue, but I've been experiencing significant variations in parameter estimates depending on the input seed used (whether clock or fixed). Either the inferred parameters are consistent with the correct answers (with correspondingly fewer likelihood calls), or they take much longer and give biased results. It's fine to use a seed that works, but who knows what the 'correct' answer is when applied to real data, and hence whether the results are biased.

I'll contact Farhan too, but has anyone else experienced this, or do you have any other advice?

Thanks!

mac use of pymultinest_demo.py

Hi - I think there's a bug in pymultinest_demo.py in that on a mac os.name returns 'posix' rather than 'mac', so there are a couple of crashes/the plotting doesn't work. A way round it is to use platform.system in show() e.g.

def show(filepath):
""" open the output (pdf) file for the user """
if platform.system == 'Darwin': subprocess.call(('open', filepath))
elif os.name == 'nt': os.startfile(filepath)
elif os.name == 'blah': subprocess.call(('xdg-open', filepath))

though in that incarnation it obviously breaks for posix.

Thanks!

Small MPI bug - Calling MPI_Init or MPI_Init_thread twice is erroneous.

Hello, I think I found a bug running PyMultiNest in MPI. I use your cmake version of MuliNest. Without MPI,

    python pymultinest_demo_minimal.py

the code runs as expected. But with MPI,

 mpirun -np 2 python pymultinest_demo_minimal.py 
Error starting MPI. Terminating.
--------------------------------------------------------------------------
MPI_ABORT was invoked on rank 1 in communicator MPI_COMM_WORLD 
with errorcode 16.

NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes.
You may or may not see output from other processes, depending on
exactly when Open MPI kills them.
--------------------------------------------------------------------------
--------------------------------------------------------------------------
Calling MPI_Init or MPI_Init_thread twice is erroneous.
--------------------------------------------------------------------------
Error starting MPI. Terminating.
--------------------------------------------------------------------------
mpirun has exited due to process rank 1 with PID 9249 on
node andrew-laptop exiting without calling "finalize". This may
have caused other processes in the application to be
terminated by signals sent by mpirun (as reported here).
--------------------------------------------------------------------------
[andrew-laptop:09247] 1 more process has sent help message help-mpi-api.txt / mpi-abort
[andrew-laptop:09247] Set MCA parameter "orte_base_help_aggregate" to 0 to see all help / error messages

I suspect that the problem is in run.py

libname = 'libmultinest.so'
try: # detect if run through mpiexec/mpirun
    from mpi4py import MPI
    if MPI.COMM_WORLD.Get_size() > 1: # need parallel capabilities
        libname = 'libmultinest_mpi.so'
except ImportError:
    pass

That code is attempting to initialise MPI twice. With simply,

libname = 'libmultinest_mpi.so'

I have no problems.

cube.toList() or .toArray() ?

Hi Johannes,

Various python functions don't recognise cube as being list-like/array-like, e.g. in my loglike I have to do something like:

c=[]
for i in range(ndim):
    c.append(cube[i])

model=numpy.polynomial.polynomial.polyval(freqs,c)
...

I don't know (at all), but presumably the cube -> c conversion is slow.

Of course individual elements of cube can be addressed as cube[0] etc. List comprehension, i.e. [ci for ci in cube] doesn't seem to convert to a list either.

Is there any appetite for adding a method to the cube class to do the conversion (to a list or numpy array) at a lower level? Maybe it exists already or I'm just driving it wrongly...

CMake and MKL Fatal Error

Hi Johannes,

I have an issue with running pymultinest on the local cluster at my institute (no root permission), where I have compiled MultiNest using the CMake version put on your site.
When running the "cmake .." in the "build" folder there are no errors reported.
When afterwards running "make" everything except for "eggboxC" and "eggboxC++" also compiles with no errors. For the two above exceptions the error is something like:
"""
Scanning dependencies of target eggboxC
[ 63%] Building C object src/example_eggbox_C/CMakeFiles/eggboxC.dir/eggbox.c.o
Linking C executable ../../../bin/eggboxC
CMakeFiles/eggboxC.dir/eggbox.c.o: In function run': eggbox.c:(.text+0x127): undefined reference to__nested_MOD_nestrun'
collect2: ld returned 1 exit status
make[2]: *** [../bin/eggboxC] Error 1
make[1]: *** [src/example_eggbox_C/CMakeFiles/eggboxC.dir/all] Error 2
make: *** [all] Error 2
"""

Anyway, after running the pymultinest setup I can import pymultinest without any errors.
When I then try to run e.g. the "pymultinest_demo" all goes well for a while, but every time it stops with the error:

"""
.
.
.
Nested Sampling ln(Z): 64.459124
Acceptance Rate: 0.608211
Replacements: 2400
Total Samples: 3946
Nested Sampling ln(Z): 67.875897

MKL FATAL ERROR: Cannot load neither libmkl_mc3.so nor libmkl_def.so
"""

I know that these .so files are in my LD_LIBRARY_PATH, so I'm guessing its a problem with the Makefile from cmake...

Do you have any suggestions for a solution?

Cheers,
Mikkel

pycuba userdata problems

Hi there,

I'm really only interested in pycuba from this package (in fact I just isolated it and wrote a simple setup script for just pycuba). On a side note -- do you mind if I tinker with it and create a fork with the isolated pycuba? I think this would be useful to people (well at least me), even if they don't care so much about the rest of the MCMC stuff.

Anyway, to the problem... I haven't dealt with ctypes before. I see how to use the calls to Cuhre etc. (which are exemplified in your demo). When I run demo() it works fine, when i strip it down just to use the basic Cuhre one it works fine. But when I try to use the "userdata" variable I get errors. I'm not really sure how to define the userdata. I've tried just using

Cuhre(Integrand,ndim=3,userdata = 0.5)

in the call to Cuhre, and in the Integrand, having

...
 b = userdata
...

but it complains with

ctypes.ArgumentError: argument 4: <type 'exceptions.TypeError'>: Don't know how to convert parameter 4

I was wondering if I had to make userdata a ctype variable before chucking it into the call to Cuhre()? And what type must I make it?

Cheers,
Steven

Not handeling negative log evidence

Dear Johannes

It seems that the analyse module break at negative log evidence.

def _read_error_line(self, l):
#print '_read_error_line', l
name, values = l.split(' ', 1)
name = name.strip(': ').strip()
v, error = values.split(" +/- ")
return name, float(v), float(error)

The strip(' ',1) breaks as negative log evidence gives a ' -' not a ' ', I tried a fix along the lines of:

def _read_error_line(self, l):
#print '_read_error_line', l
index = re.search("[-0-9]",l).start()
name = l[0:index]
values = l[index:]
name, values = l.split(':', 1)
name = name.rstrip().lstrip().strip(':')
v, error = values.split(" +/- ")
return name, float(v), float(error)

But it break the code when trying to detect number of modes somewhere in

def get_stats(self):
"""
information about the modes found:
mean, sigma, maximum a posterior in each dimension
"""
lines = file(self.stats_file).readlines()
text = "".join(lines)
parts = text.split("\n\n\n")
del parts[0]
stats = {
'modes':[]
}
# Global Evidence
self._read_error_into_dict(lines[0], stats)
i = 0
for p in parts:
modelines = p.split("\n\n")
mode = {
'index':i
}
i = i + 1
modelines1 = modelines[0].split("\n")
# Strictly local evidence
self._read_error_into_dict(modelines1[1], mode)
self._read_error_into_dict(modelines1[2], mode)
t = self._read_table(modelines[1], title = "Parameters")
mode['mean'] = t[:,1].tolist()
mode['sigma'] = t[:,2].tolist()
mode['maximum'] = self._read_table(modelines[1])[:,1].tolist()
mode['maximum a posterior'] = self._read_table(modelines[1])[:,1].tolist()
stats['modes'].append(mode)
return stats

Do you have a suggestion for a quick fix?

ERROR: nCdims can not be greater than ndims.

Hi, I tried to run pymultinest_demo and got the error:

ERROR: nCdims can not be greater than ndims.

I checked in run.py, and n_dims, n_params, and n_clustering_params were all 2. But then in nested.F90, nCdims was 100, not 2. I looked at the order of inputs and they seem to be incompatible:

subroutine nestRun(nest_IS,nest_mmodal,nest_ceff,nest_nlive,nest_tol,nest_ef,nest_ndims,nest_totPar,nest_nCdims,maxClst, &
nest_updInt,nest_Ztol,nest_root,seed,nest_pWrap,nest_fb,nest_resume,nest_outfile,initMPI,nest_logZero,nest_maxIter, &
loglike,dumper,context)

whereas at the end of run.py,

lib.run(c_int(multimodal), c_int(const_efficiency_mode), 
    c_int(n_live_points), c_double(evidence_tolerance), 
    c_double(sampling_efficiency), c_int(n_dims), c_int(n_params),
    c_int(n_clustering_params), c_int(max_modes), 
    c_int(n_iter_before_update), c_double(mode_tolerance), 
    outputfiles_basename, c_int(seed), wraps,
    c_int(verbose), c_int(resume), 
    c_int(write_output), c_int(init_MPI), 
    c_double(log_zero), c_int(max_iter),
    c_int(context))

I appear to be missing nest_IS, and thus nCdims is coming from max_modes instead of n_clustering_params. At the end it also seems like I am missing what should be input to loglike and dumper.

I should have up to date versions of both MultiNest and PyMultiNest, as I just downloaded them yesterday and got them compiled today. Why are they incompatible?

Mac OS install issues

Hi Johannes,
I've tried installing on my mac using both the cmake and the "other" version. With cmake, I ran into the following problem:

(some text cut here)
    Scanning dependencies of target multinest_static
    [ 43%] Building Fortran object src/CMakeFiles/multinest_static.dir/utils.f90.o
    [ 44%] Building Fortran object src/CMakeFiles/multinest_static.dir/utils1.f90.o
    [ 46%] Building Fortran object src/CMakeFiles/multinest_static.dir/kmeans_clstr.f90.o
    [ 48%] Building Fortran object src/CMakeFiles/multinest_static.dir/xmeans_clstr.f90.o
    [ 50%] Building Fortran object src/CMakeFiles/multinest_static.dir/posterior.F90.o
    [ 51%] Building Fortran object src/CMakeFiles/multinest_static.dir/priors.f90.o
    [ 53%] Building Fortran object src/CMakeFiles/multinest_static.dir/nested.F90.o
    [ 55%] Building Fortran object src/CMakeFiles/multinest_static.dir/cwrapper.f90.o
    Linking Fortran static library ../../lib/libmultinest.a
    Error copying file "/Users/adam/repos/MultiNest/build/src/kmeans_clstr.mod" to "/Users/adam/repos/MultiNest/modules/".
    make[2]: *** [../lib/libmultinest.a] Error 1
    make[1]: *** [src/CMakeFiles/multinest_static.dir/all] Error 2
    make: *** [all] Error 2

with the other version, I followed these instructions: http://www.astrobetter.com/wiki/tiki-index.php?page=MultiNest+Installation+Notes and was able to build libnest3.so, but I have no idea what PyMultiNest actually requires, and symlinking libnest3.so to libmultinest.so doesn't work:

$ python -c 'import pymultinest'
problem: dlopen(libmultinest.so, 6): Symbol not found: ___addtf3
  Referenced from: /usr/local/lib/libquadmath.0.dylib
  Expected in: /usr/local/lib/libgcc_s.1.dylib
 in /usr/local/lib/libquadmath.0.dylib

I'm on Mac OS X 10.7 with the open-MPI v4.7.1 compilers:

dor ~/repos/MultiNest master$ mpif90 -dumpversion
4.7.1
dor ~/repos/MultiNest master$ mpicc -dumpversion
4.7.1
dor ~/repos/MultiNest master$ mpiCC -dumpversion
4.7.1

Can you offer any assistance?

Missing plot module

Hi,

The code seems wonderful (the example works great up until the plotting section), but when I initialize, I get the error:

[mcoughlin@ldas-pcdev1 pymultinest]$ python init.py
No module named plot
WARNING: no plotting available -- check matplotlib installation and error above
Only MultiNest run capabilities enabled.

Is there a plot.py function I am missing?

Thank you,
Michael

pymultinest and MPI

I am attempting to run the pymultinest demo and I am getting sporadic behavior (sometimes segfaults, sometimes hanging, sometimes invalid literals, etc.). I have installed v2.17 of Multinest with MPI enabled and the multi nest examples run fine, including the C and C++ versions.

Below is a simplified version of the demo I am using (with extra print statements).

import pymultinest
import math
import os, threading, subprocess
if not os.path.exists("chains"): os.mkdir("chains")

# Taken from the eggbox problem.
def myprior(cube, ndim, nparams):
    print "cube before", [cube[i] for i in range(ndim)]
    for i in range(ndim):
        cube[i] = cube[i] * 10 * math.pi
    print "python cube after", [cube[i] for i in range(ndim)]

def myloglike(cube, ndim, nparams):
    chi = 1.
    print "cube", [cube[i] for i in range(ndim)], cube
    for i in range(ndim):
        chi *= math.cos(cube[i] / 2.)
    print "returning", math.pow(2. + chi, 5)
    return math.pow(2. + chi, 5)

# number of dimensions our problem has
parameters = ["x", "y"]
n_params = len(parameters)

# run MultiNest
print 'Starting sampler'
pymultinest.run(myloglike, myprior, n_params, resume = False, verbose = True, sampling_efficiency = 0.3)
print 'Finished sampling'

And here is how I am calling it and some of the output. In this case, the output just hangs. As you can see, it never gets to the print statements in the likelihood and prior functions. Any suggestions for debugging or some hidden parameter to make this work (presumably something to do with MPI)?

machine% python pymultinest_demo.py
Starting sampler


MultiNest v2.17
Copyright Farhan Feroz & Mike Hobson
Release Mar 2012

no. of live points = 1000
dimensionality = 2


Starting MultiNest
generating live points
live points generated, starting sampling
Acceptance Rate: 1.000000
Replacements: 1050
Total Samples: 1050
ln(Z): -5.020128
Acceptance Rate: 1.000000
Replacements: 1100
Total Samples: 1100
ln(Z): -4.351668
Acceptance Rate: 1.000000
Replacements: 1150
Total Samples: 1150
ln(Z): -3.970683
Acceptance Rate: 1.000000
Replacements: 1200
Total Samples: 1200
ln(Z): -3.707272

Plots blowing up for very small confidence intervals

When the estimated confidence interval is very small the seems to be numerical problems with calculating some indexes

Global Evidence:
3.796537739683588e+01 +- 1.166964614087022e-01
Traceback (most recent call last):
File "ttv.py", line 56, in
p.plot_conditional(i, None, with_ellipses = True, with_points = False)
File "/home/andor/pymultinest2/pymultinest/analyse.py", line 186, in plot_conditional
grid_z1[a,b] += values[i]
IndexError: index (95) out of range (0<=index<40) in dimension 0

In this part of the code:

for i in range(len(values)):
a = int((dim1_column[i] - min1) * (n - 1) / (max1 - min1))
if dim2 is not None:
b = int((dim2_column[i] - min2) * (m - 1) / (max2 - min1))
else:
b = 0
grid_z1[a,b] += values[i]
n_z1[a,b] += 1

It seems that if max1 and min1 are very close, the calculation blows up and gives a's outside the range of a.

What does the grid_z1 and n_z1 represent? Would it not be possible to reconstruct these function with python function like cumsum and digitize, the current implementation seems prone to errors.

Wouldn't a function like griddata from be what you need http://www.scipy.org/Cookbook/Matplotlib/Gridding_irregularly_spaced_data

Segfault in pymultinest

Hello

I have been working on getting pymultinest to run. I have compiled multinest version 2.7 together with the current iteration of pymultinest. I have managed to get the code to compile and I can import pymultinest, but running the demo generates a segfault:

(gdb) backtrace
#0 0x00007ffff7ff8fc1 in ?? ()
#1 0x00007ffff6597946 in _LogLike (Cube=0x17396d0, ndim=0x7ffff65967c4, npars=0x7ffff6596990, lnew=

0x7fffffffcc70) at cnest.c:19

#2 0x00007ffff638efcd in gen_initial_live (p=..., phyp=..., l=..., loglike=

0x7ffff659790c <_LogLike>, context=0) at nested.F90:383

#3 0x00007ffff638ff29 in nestsample (loglike=0x7ffff659790c <_LogLike>, context=0)

at nested.F90:255

#4 0x00007ffff63913b9 in nestrun (nest_mmodal=.TRUE., nest_ceff=.FALSE., nest_nlive=1000,

nest_tol=0.5, nest_ef=0.29999999999999999, nest_ndims=2, nest_totpar=2, nest_ncdims=2, 
maxclst=100, nest_updint=100, nest_ztol=0.5, nest_root=..., seed=-1, nest_pwrap=..., 
nest_fb=.TRUE., nest_resume=.TRUE., loglike=0x7ffff659790c <_LogLike>, context=0, 
_nest_root=-10924) at nested.F90:195

#5 0x00007ffff6597b66 in run (mmodal=1, ceff=0, nlive=1000, tol=0.5, efr=0.29999999999999999,

ndims=2, nPar=2, nClsPar=2, maxModes=100, updInt=100, Ztol=0.5, rootstr=
0x7ffff7f0dbec "chains/1-", seed=-1, pWrap=0x19787f0, fb=1, resume=1, context=0) at cnest.c:48

#6 0x00007ffff67b102c in ffi_call_unix64 ()

at /build/buildd/python2.6-2.6.5/Modules/_ctypes/libffi/src/x86/unix64.S:75

#7 0x00007ffff67b0713 in ffi_call (cif=0x7fffffffda60, fn=,

rvalue=<value optimized out>, avalue=<value optimized out>)
at /build/buildd/python2.6-2.6.5/Modules/_ctypes/libffi/src/x86/ffi64.c:430

#8 0x00007ffff67ab134 in _call_function_pointer (pProc=,

argtuple=<value optimized out>, flags=<value optimized out>, argtypes=<value optimized out>, 
restype=<value optimized out>, checker=<value optimized out>)
at /build/buildd/python2.6-2.6.5/Modules/_ctypes/callproc.c:816

#9 _CallProc (pProc=, argtuple=,

I get an identical error with Sergey Kopsovs code when running it with multinest 2.14. I use Python 2.6.5, and gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5). Any hints to with combinations of linux, python and compilers that do work.

Best regards, Kennet Harpsรธe

problems installing Multinest on mac with macports

@JohannesBuchner We are having some issues on the Mac with installing Multinest from your Repo (which doesn't seem to have an issue tracker):

cmake ..
-- The Fortran compiler identification is GNU
-- The C compiler identification is AppleClang 6.0.0.6000056
-- The CXX compiler identification is AppleClang 6.0.0.6000056
-- Checking whether Fortran compiler has -isysroot
-- Checking whether Fortran compiler has -isysroot - yes
-- Checking whether Fortran compiler supports OSX deployment target flag
-- Checking whether Fortran compiler supports OSX deployment target flag - yes
-- Check for working Fortran compiler: /opt/local/bin/gfortran
-- Check for working Fortran compiler: /opt/local/bin/gfortran  -- broken
CMake Error at /opt/local/share/cmake-3.2/Modules/CMakeTestFortranCompiler.cmake:54 (message):
  The Fortran compiler "/opt/local/bin/gfortran" is not able to compile a
  simple test program.

  It fails with the following output:

   Change Dir: /Users/afeldmei/software/MultiNest/build/CMakeFiles/CMakeTmp



  Run Build Command:"/opt/local/bin/gmake" "cmTryCompileExec3866506505/fast"

  /opt/local/bin/gmake -f
  CMakeFiles/cmTryCompileExec3866506505.dir/build.make
  CMakeFiles/cmTryCompileExec3866506505.dir/build

  gmake[1]: Entering directory
  '/Users/afeldmei/software/MultiNest/build/CMakeFiles/CMakeTmp'

  /opt/local/bin/cmake -E cmake_progress_report
  /Users/afeldmei/software/MultiNest/build/CMakeFiles/CMakeTmp/CMakeFiles 1

  Building Fortran object
  CMakeFiles/cmTryCompileExec3866506505.dir/testFortranCompiler.f.o

  /opt/local/bin/gfortran -c
  /Users/afeldmei/software/MultiNest/build/CMakeFiles/CMakeTmp/testFortranCompiler.f
  -o CMakeFiles/cmTryCompileExec3866506505.dir/testFortranCompiler.f.o

  Linking Fortran executable cmTryCompileExec3866506505

  /opt/local/bin/cmake -E cmake_link_script
  CMakeFiles/cmTryCompileExec3866506505.dir/link.txt --verbose=1

  /opt/local/bin/gfortran -L/usr/local/scisoft/lib/
  CMakeFiles/cmTryCompileExec3866506505.dir/testFortranCompiler.f.o -o
  cmTryCompileExec3866506505

  Undefined symbols for architecture x86_64:

    "__gfortran_set_options", referenced from:
        _main in testFortranCompiler.f.o

  ld: symbol(s) not found for architecture x86_64

  collect2: ld returned 1 exit status

  CMakeFiles/cmTryCompileExec3866506505.dir/build.make:88: recipe for target
  'cmTryCompileExec3866506505' failed

  gmake[1]: *** [cmTryCompileExec3866506505] Error 1

  gmake[1]: Leaving directory
  '/Users/afeldmei/software/MultiNest/build/CMakeFiles/CMakeTmp'

  Makefile:117: recipe for target 'cmTryCompileExec3866506505/fast' failed

  gmake: *** [cmTryCompileExec3866506505/fast] Error 2





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:2 (project)


-- Configuring incomplete, errors occurred!
See also "/Users/afeldmei/software/MultiNest/build/CMakeFiles/CMakeOutput.log".
See also "/Users/afeldmei/software/MultiNest/build/CMakeFiles/CMakeError.log".
dhcp-17-153:build afeldmei$ rm -rf *
dhcp-17-153:build afeldmei$ CC=gcc-mp-4.9 FC=gfortran-mp-4.9 cmake ..
-- The Fortran compiler identification is GNU
-- The C compiler identification is GNU 4.9.2
-- The CXX compiler identification is AppleClang 6.0.0.6000056
-- Checking whether Fortran compiler has -isysroot
-- Checking whether Fortran compiler has -isysroot - yes
-- Checking whether Fortran compiler supports OSX deployment target flag
-- Checking whether Fortran compiler supports OSX deployment target flag - yes
-- Check for working Fortran compiler: /opt/local/bin/gfortran-mp-4.9
-- Check for working Fortran compiler: /opt/local/bin/gfortran-mp-4.9  -- broken
CMake Error at /opt/local/share/cmake-3.2/Modules/CMakeTestFortranCompiler.cmake:54 (message):
  The Fortran compiler "/opt/local/bin/gfortran-mp-4.9" is not able to
  compile a simple test program.

  It fails with the following output:

   Change Dir: /Users/afeldmei/software/MultiNest/build/CMakeFiles/CMakeTmp



  Run Build Command:"/opt/local/bin/gmake" "cmTryCompileExec439162752/fast"

  /opt/local/bin/gmake -f CMakeFiles/cmTryCompileExec439162752.dir/build.make
  CMakeFiles/cmTryCompileExec439162752.dir/build

  gmake[1]: Entering directory
  '/Users/afeldmei/software/MultiNest/build/CMakeFiles/CMakeTmp'

  /opt/local/bin/cmake -E cmake_progress_report
  /Users/afeldmei/software/MultiNest/build/CMakeFiles/CMakeTmp/CMakeFiles 1

  Building Fortran object
  CMakeFiles/cmTryCompileExec439162752.dir/testFortranCompiler.f.o

  /opt/local/bin/gfortran-mp-4.9 -c
  /Users/afeldmei/software/MultiNest/build/CMakeFiles/CMakeTmp/testFortranCompiler.f
  -o CMakeFiles/cmTryCompileExec439162752.dir/testFortranCompiler.f.o

  Linking Fortran executable cmTryCompileExec439162752

  /opt/local/bin/cmake -E cmake_link_script
  CMakeFiles/cmTryCompileExec439162752.dir/link.txt --verbose=1

  /opt/local/bin/gfortran-mp-4.9 -L/usr/local/scisoft/lib/
  CMakeFiles/cmTryCompileExec439162752.dir/testFortranCompiler.f.o -o
  cmTryCompileExec439162752

  Undefined symbols for architecture x86_64:

    "__gfortran_set_options", referenced from:
        _main in testFortranCompiler.f.o
    "__gfortran_transfer_character_write", referenced from:
        _MAIN__ in testFortranCompiler.f.o

  ld: symbol(s) not found for architecture x86_64

  collect2: error: ld returned 1 exit status

  CMakeFiles/cmTryCompileExec439162752.dir/build.make:88: recipe for target
  'cmTryCompileExec439162752' failed

  gmake[1]: *** [cmTryCompileExec439162752] Error 1

  gmake[1]: Leaving directory
  '/Users/afeldmei/software/MultiNest/build/CMakeFiles/CMakeTmp'

  Makefile:117: recipe for target 'cmTryCompileExec439162752/fast' failed

  gmake: *** [cmTryCompileExec439162752/fast] Error 2





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:2 (project)


-- Configuring incomplete, errors occurred!
See also "/Users/afeldmei/software/MultiNest/build/CMakeFiles/CMakeOutput.log".
See also "/Users/afeldmei/software/MultiNest/build/CMakeFiles/CMakeError.log".

No of samples

Hi,
May be this is a stupid question but still better to ask the specialist!
Is there any way to know roughly the total number of sample that will be used or the time it can take to finish the whole sampling at the starting of multinest, considering 1 model takes 1 min. To test a model, I am using n_live=20 and ndim=4 and one model takes 1 minutes to run. I want to know how much time it can take as in my case it is running last 12 hours and this is just a test.

Thanks.
Suvendu

AttributeError: /home/user/MultiNest/lib/libmultinest.so: undefined symbol: run

I have used the tutorial (http://johannesbuchner.github.io/pymultinest-tutorial/install.html#on-your-own-computer) to install MULTINEST and PyMultinest except that I installed pymultinest for all users. I get this error
"File "pymultinest_demo_minimal.py", line 24, in
resume = True, verbose = True)
File "/home/sand33p/PyMultiNest/pymultinest/run.py", line 205, in run
lib.run(c_bool(importance_nested_sampling),
File "/usr/lib/python2.7/ctypes/init.py", line 378, in getattr
func = self.getitem(name)
File "/usr/lib/python2.7/ctypes/init.py", line 383, in getitem
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /home/sand33p/MultiNest/lib/libmultinest.so: undefined symbol: run".

Is there any thing I am missing?.There are no errors in the compiling. The log is as follows.

-- The Fortran compiler identification is GNU
-- The C compiler identification is GNU 4.8.2
-- The CXX compiler identification is GNU 4.8.2
-- Check for working Fortran compiler: /usr/bin/f95
-- Check for working Fortran compiler: /usr/bin/f95 -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether /usr/bin/f95 supports Fortran 90
-- Checking whether /usr/bin/f95 supports Fortran 90 -- yes
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for Fortran dgemm
-- Looking for Fortran dgemm - found
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- A library with BLAS API found.
-- Looking for Fortran cheev
-- Looking for Fortran cheev - found
-- A library with LAPACK API found.
-- Detected gfortran, adding -ffree-line-length-none compiler flag.
-- Could NOT find MPI_C (missing: MPI_C_LIBRARIES MPI_C_INCLUDE_PATH)
-- Could NOT find MPI_CXX (missing: MPI_CXX_LIBRARIES MPI_CXX_INCLUDE_PATH)
-- Could NOT find MPI_Fortran (missing: MPI_Fortran_LIBRARIES MPI_Fortran_INCLUDE_PATH)
-- MPI not found, only non-MPI MultiNest libraries will be built.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/sand33p/MultiNest/build
Scanning dependencies of target multinest_shared
[ 2%] Building Fortran object src/CMakeFiles/multinest_shared.dir/utils.f90.o
[ 5%] Building Fortran object src/CMakeFiles/multinest_shared.dir/utils1.f90.o
[ 7%] Building Fortran object src/CMakeFiles/multinest_shared.dir/kmeans_clstr.f90.o
[ 10%] Building Fortran object src/CMakeFiles/multinest_shared.dir/xmeans_clstr.f90.o
[ 12%] Building Fortran object src/CMakeFiles/multinest_shared.dir/posterior.F90.o
[ 15%] Building Fortran object src/CMakeFiles/multinest_shared.dir/priors.f90.o
[ 17%] Building Fortran object src/CMakeFiles/multinest_shared.dir/nested.F90.o
Linking Fortran shared library ../../lib/libmultinest.so
[ 17%] Built target multinest_shared
Scanning dependencies of target multinest_static
[ 20%] Building Fortran object src/CMakeFiles/multinest_static.dir/utils.f90.o
[ 22%] Building Fortran object src/CMakeFiles/multinest_static.dir/utils1.f90.o
[ 25%] Building Fortran object src/CMakeFiles/multinest_static.dir/kmeans_clstr.f90.o
[ 27%] Building Fortran object src/CMakeFiles/multinest_static.dir/xmeans_clstr.f90.o
[ 30%] Building Fortran object src/CMakeFiles/multinest_static.dir/posterior.F90.o
[ 32%] Building Fortran object src/CMakeFiles/multinest_static.dir/priors.f90.o
[ 35%] Building Fortran object src/CMakeFiles/multinest_static.dir/nested.F90.o
Linking Fortran static library ../../lib/libmultinest.a
[ 35%] Built target multinest_static
Scanning dependencies of target ackley
[ 37%] Building Fortran object src/example_ackley/CMakeFiles/ackley.dir/params.f90.o
[ 40%] Building Fortran object src/example_ackley/CMakeFiles/ackley.dir/like.f90.o
[ 42%] Building Fortran object src/example_ackley/CMakeFiles/ackley.dir/nestwrap.f90.o
[ 45%] Building Fortran object src/example_ackley/CMakeFiles/ackley.dir/main.f90.o
Linking Fortran executable ../../../bin/ackley
[ 45%] Built target ackley
Scanning dependencies of target eggboxC
[ 47%] Building C object src/example_eggbox_C/CMakeFiles/eggboxC.dir/eggbox.c.o
Linking C executable ../../../bin/eggboxC
[ 47%] Built target eggboxC
Scanning dependencies of target eggboxC++
[ 50%] Building CXX object src/example_eggbox_C++/CMakeFiles/eggboxC++.dir/eggbox.cc.o
Linking CXX executable ../../../bin/eggboxC++
[ 50%] Built target eggboxC++
Scanning dependencies of target gaussian
[ 52%] Building Fortran object src/example_gaussian/CMakeFiles/gaussian.dir/params.f90.o
[ 55%] Building Fortran object src/example_gaussian/CMakeFiles/gaussian.dir/like.f90.o
[ 57%] Building Fortran object src/example_gaussian/CMakeFiles/gaussian.dir/nestwrap.f90.o
[ 60%] Building Fortran object src/example_gaussian/CMakeFiles/gaussian.dir/main.f90.o
Linking Fortran executable ../../../bin/gaussian
[ 60%] Built target gaussian
Scanning dependencies of target gauss_shell
[ 62%] Building Fortran object src/example_gauss_shell/CMakeFiles/gauss_shell.dir/params.f90.o
[ 65%] Building Fortran object src/example_gauss_shell/CMakeFiles/gauss_shell.dir/like.f90.o
[ 67%] Building Fortran object src/example_gauss_shell/CMakeFiles/gauss_shell.dir/nestwrap.f90.o
[ 70%] Building Fortran object src/example_gauss_shell/CMakeFiles/gauss_shell.dir/main.f90.o
Linking Fortran executable ../../../bin/gauss_shell
[ 70%] Built target gauss_shell
Scanning dependencies of target himmelblau
[ 72%] Building Fortran object src/example_himmelblau/CMakeFiles/himmelblau.dir/params.f90.o
[ 75%] Building Fortran object src/example_himmelblau/CMakeFiles/himmelblau.dir/like.f90.o
[ 77%] Building Fortran object src/example_himmelblau/CMakeFiles/himmelblau.dir/nestwrap.f90.o
[ 80%] Building Fortran object src/example_himmelblau/CMakeFiles/himmelblau.dir/main.f90.o
Linking Fortran executable ../../../bin/himmelblau
[ 80%] Built target himmelblau
Scanning dependencies of target obj_detect
[ 82%] Building Fortran object src/example_obj_detect/CMakeFiles/obj_detect.dir/params.f90.o
[ 85%] Building Fortran object src/example_obj_detect/CMakeFiles/obj_detect.dir/like.f90.o
[ 87%] Building Fortran object src/example_obj_detect/CMakeFiles/obj_detect.dir/nestwrap.f90.o
[ 90%] Building Fortran object src/example_obj_detect/CMakeFiles/obj_detect.dir/main.f90.o
Linking Fortran executable ../../../bin/obj_detect
[ 90%] Built target obj_detect
Scanning dependencies of target rosenbrock
[ 92%] Building Fortran object src/example_rosenbrock/CMakeFiles/rosenbrock.dir/params.f90.o
[ 95%] Building Fortran object src/example_rosenbrock/CMakeFiles/rosenbrock.dir/like.f90.o
[ 97%] Building Fortran object src/example_rosenbrock/CMakeFiles/rosenbrock.dir/nestwrap.f90.o
[100%] Building Fortran object src/example_rosenbrock/CMakeFiles/rosenbrock.dir/main.f90.o
Linking Fortran executable ../../../bin/rosenbrock

[100%] Built target rosenbrock

Cloning into 'PyMultiNest'...
remote: Reusing existing pack: 993, done.
remote: Total 993 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (993/993), 1.25 MiB | 1.04 MiB/s, done.
Resolving deltas: 100% (510/510), done.
Checking connectivity... done.
sand33p@sandeep:$ cd PyMultiNest/
sand33p@sandeep:
/PyMultiNest$ python setup.py install
running install
running bdist_egg
running egg_info
creating pymultinest.egg-info
writing pymultinest.egg-info/PKG-INFO
writing top-level names to pymultinest.egg-info/top_level.txt
writing dependency_links to pymultinest.egg-info/dependency_links.txt
writing manifest file 'pymultinest.egg-info/SOURCES.txt'
reading manifest file 'pymultinest.egg-info/SOURCES.txt'
writing manifest file 'pymultinest.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/pymultinest
copying pymultinest/analyse.py -> build/lib.linux-x86_64-2.7/pymultinest
copying pymultinest/init.py -> build/lib.linux-x86_64-2.7/pymultinest
copying pymultinest/run.py -> build/lib.linux-x86_64-2.7/pymultinest
copying pymultinest/watch.py -> build/lib.linux-x86_64-2.7/pymultinest
copying pymultinest/plot.py -> build/lib.linux-x86_64-2.7/pymultinest
creating build/lib.linux-x86_64-2.7/pyapemost
copying pyapemost/analyse.py -> build/lib.linux-x86_64-2.7/pyapemost
copying pyapemost/init.py -> build/lib.linux-x86_64-2.7/pyapemost
copying pyapemost/run.py -> build/lib.linux-x86_64-2.7/pyapemost
copying pyapemost/watch.py -> build/lib.linux-x86_64-2.7/pyapemost
creating build/lib.linux-x86_64-2.7/pycuba
copying pycuba/init.py -> build/lib.linux-x86_64-2.7/pycuba
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/pycuba
copying build/lib.linux-x86_64-2.7/pycuba/init.py -> build/bdist.linux-x86_64/egg/pycuba
creating build/bdist.linux-x86_64/egg/pymultinest
copying build/lib.linux-x86_64-2.7/pymultinest/analyse.py -> build/bdist.linux-x86_64/egg/pymultinest
copying build/lib.linux-x86_64-2.7/pymultinest/init.py -> build/bdist.linux-x86_64/egg/pymultinest
copying build/lib.linux-x86_64-2.7/pymultinest/run.py -> build/bdist.linux-x86_64/egg/pymultinest
copying build/lib.linux-x86_64-2.7/pymultinest/watch.py -> build/bdist.linux-x86_64/egg/pymultinest
copying build/lib.linux-x86_64-2.7/pymultinest/plot.py -> build/bdist.linux-x86_64/egg/pymultinest
creating build/bdist.linux-x86_64/egg/pyapemost
copying build/lib.linux-x86_64-2.7/pyapemost/analyse.py -> build/bdist.linux-x86_64/egg/pyapemost
copying build/lib.linux-x86_64-2.7/pyapemost/init.py -> build/bdist.linux-x86_64/egg/pyapemost
copying build/lib.linux-x86_64-2.7/pyapemost/run.py -> build/bdist.linux-x86_64/egg/pyapemost
copying build/lib.linux-x86_64-2.7/pyapemost/watch.py -> build/bdist.linux-x86_64/egg/pyapemost
byte-compiling build/bdist.linux-x86_64/egg/pycuba/init.py to init.pyc
byte-compiling build/bdist.linux-x86_64/egg/pymultinest/analyse.py to analyse.pyc
byte-compiling build/bdist.linux-x86_64/egg/pymultinest/init.py to init.pyc
byte-compiling build/bdist.linux-x86_64/egg/pymultinest/run.py to run.pyc
byte-compiling build/bdist.linux-x86_64/egg/pymultinest/watch.py to watch.pyc
byte-compiling build/bdist.linux-x86_64/egg/pymultinest/plot.py to plot.pyc
byte-compiling build/bdist.linux-x86_64/egg/pyapemost/analyse.py to analyse.pyc
byte-compiling build/bdist.linux-x86_64/egg/pyapemost/init.py to init.pyc
byte-compiling build/bdist.linux-x86_64/egg/pyapemost/run.py to run.pyc
byte-compiling build/bdist.linux-x86_64/egg/pyapemost/watch.py to watch.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
installing scripts to build/bdist.linux-x86_64/egg/EGG-INFO/scripts
running install_scripts
running build_scripts
creating build/scripts-2.7
copying and adjusting multinest_marginals.py -> build/scripts-2.7
changing mode of build/scripts-2.7/multinest_marginals.py from 664 to 775
creating build/bdist.linux-x86_64/egg/EGG-INFO/scripts
copying build/scripts-2.7/multinest_marginals.py -> build/bdist.linux-x86_64/egg/EGG-INFO/scripts
changing mode of build/bdist.linux-x86_64/egg/EGG-INFO/scripts/multinest_marginals.py to 775
copying pymultinest.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pymultinest.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pymultinest.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pymultinest.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating dist
creating 'dist/pymultinest-0.4-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing pymultinest-0.4-py2.7.egg
Removing /usr/local/lib/python2.7/dist-packages/pymultinest-0.4-py2.7.egg
Copying pymultinest-0.4-py2.7.egg to /usr/local/lib/python2.7/dist-packages
pymultinest 0.4 is already the active version in easy-install.pth
Installing multinest_marginals.py script to /usr/local/bin

Installed /usr/local/lib/python2.7/dist-packages/pymultinest-0.4-py2.7.egg
Processing dependencies for pymultinest==0.4
Finished processing dependencies for pymultinest==0.4

Problems enabling MPI : (Abort trap: 6)

Hello!

PyMultinest is running fine on my Mac laptop. However, when I try enabling MPI, I'm getting some problems. Running the pymultinest_demo_minimal.py script results in the following:

bash-3.2$ mpirun -np 2 python pymultinest_demo_minimal.py

...

Acceptance Rate: 0.722698
Replacements: 1350
Total Samples: 1868
Nested Sampling ln(Z): 148.573654
Importance Nested Sampling ln(Z): 235.196277 +/- 0.411084

python(44441,0x7fff73f6a310) malloc: *** error for object 0x10104ea08: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug

Acceptance Rate: 0.716113
Replacements: 1400
Total Samples: 1955
Nested Sampling ln(Z): 155.709924
Importance Nested Sampling ln(Z): 235.109719 +/- 0.393148

...

Acceptance Rate: 0.675898
Replacements: 2050
Total Samples: 3033
Nested Sampling ln(Z): 214.719858

Importance Nested Sampling ln(Z): 235.306598 +/- 0.175543

mpirun noticed that process rank 0 with PID 44441 on node my-computer exited on signal 6 (Abort trap: 6).

I've checked previous MPI issues here to see if others have experienced this, but found nothing similar. Additionally, original multinest examples (eggboxC, etc.) using mpirun are successful.

pypolychord - MPI

@JohannesBuchner Does pypolychord support MPI, and if so, is it simply called in the usual way? As you know, pymultinest takes an init option for MPI (or mpi4py), but I can't see one for pypolychord. Thanks!

Issue with likelihood function being a method

In run.py, there is some code that checks the number of arguments that the likelihood function takes, and decides whether or not to use the 'lnew' variable or not. This doesn't have the desired behavior if the likelihood function is a method, in which case it "takes" one more argument by default (self). I've hacked a quick solution using inspect.ismethod() for my current purposes, but a real solution would be desirable.

Thanks!

Reading out 1-stats.txt fails

Hello,
_read_error_line produces a TypeError for me at line 10 of 1-stats.txt (the line beginning with "strictly log evidence"). I use PyMultiNest together with MultiNest v3.0. The TypeError is due to the fact that the line.split() doesn't split name and values correctly when splitting at 4 spaces.
Using
name, values = l.split(' ', 1)
i.e. splitting along 2 spaces instead of 4 should fix the issue (it does for me).

Reading in mode stats: maximum and MAP not being used

It seems that get_mode_stats returns only the mode mean: that is, the 'maximum' and 'maximum a posterior' are also the mean, not their actual values from 1-stats.dat.

I think the problem two lines are:

mode['maximum'] = self._read_table(modelines[1])[:,1].tolist()
mode['maximum a posterior'] = self._read_table(modelines[1])[:,1].tolist()

which should instead use "modelines[2]" and "modelines[3]" respectively. I'm still using the older PyMultiNest, not Importance Nested Sampling, so I don't know if that version of get_mode_stats is correct or not.

dump_callback etc.

Hi - I'm trying to pass the current sample values to a python wrapper to plot them using pyplot as MultiNEST runs, rather than using show as in your demo script, because I hope it's more efficient than using show -> pdf.

I have a function to do the plot update, but I can't figure out how to extract the current sample values. Should I use dump_callback, or progressPrinter, or go via an ascii file..? How should I do that if so?

Thanks v much.

Fortran compilation issue

Not a bug in pymultinest, but an issue that could affect its users

http://ccpforge.cse.rl.ac.uk/gf/project/multinest/forum/?_forum_action=ForumMessageBrowse&thread_id=22061&action=ForumBrowse&forum_id=198

The issue in multinest affects the C wrapper, which I presume is critical to pymultinest? The C wrapper cannot be compiled with old versions of gfortan, as it includes new syntax. The solution appears to be to upgrade to the latest gfortan compiler, but that is not always possible on a server.

loaded libmultinest.so but without any .run() method?

Had to change the compilation since cwrapper.f90 would not compile on my system - a known/unresolved issue with MultiNest, not the fault of anyone here - and so I had to work around the missing cwrapper.o and cnested.mod. With those exceptions, everything has compiled and libraries are installed in appropriate directories.

So now: I can fire up python and "import pymultinest", great. However, the demo scripts are not running, crashing when they fail to find the .run() method for the libmultinest object. Looking into the issue a bit more closely, I can read in the "libmultinest.so" shared object library using "lib = cdll.LoadLibrary(libname)", and confirm the resulting "lib" python object has no .run() method. Indeed, it seems a very bare-bones object with all (or almost all) properties being defaults.

It seems I have gone astray at some point but I'm not sure where it is. Is pymultinest accessing the library in a way that requires the functionality of cwrapper and cnested?

Working on an Ubuntu 10.04 system, if that is relevant.

Thanks for assistance/ideas.

Cheers,
Derek

Main thread is not in main loop

Hello, there!

I am attempting to figure out how to use MultiNest and PyMultiNest. I believe I have it all installed correctly and I was trying to run pymultinest_demo.py. It successfully gets to the analysis portion of the code however, it is giving me the following error:

Traceback (most recent call last):
File "/arlstorage/home/student/alri1472/PyMultiNest/pymultinest_demo.py", line 69, in
plt.figure(figsize=(5_n_params, 5_n_params))
File "/usr/local/adm/config/python/lib/python2.7/site-packages/matplotlib/pyplot.py", line 423, in figure
*_kwargs)
File "/usr/local/adm/config/python/lib/python2.7/site-packages/matplotlib/backends/backend_tkagg.py", line 79, in new_figure_manager
return new_figure_manager_given_figure(num, figure)
File "/usr/local/adm/config/python/lib/python2.7/site-packages/matplotlib/backends/backend_tkagg.py", line 96, in new_figure_manager_given_figure
icon_img = Tk.PhotoImage(file=icon_fname)
File "/usr/local/python/lib/python2.7/lib-tk/Tkinter.py", line 3244, in init
Image.init(self, 'photo', name, cnf, master, *_kw)
File "/usr/local/python/lib/python2.7/lib-tk/Tkinter.py", line 3200, in init
self.tk.call(('image', 'create', imgtype, name,) + options)
RuntimeError: main thread is not in main loop

I have only been programming for six months and I have never come across this error before. I was wondering if you could explain this to me and suggest a solution?

Thank you for your time!

Priors module

An incomplete Priors class for you. Cut and paste into priors.py. Somewhat tested. Hope it's useful.

-------------------------------------------------------------------------------

class Priors(object):
"""

Taken from MultiNEST priors.f90
Usage e.g.:
    from priors import Priors
    pri=Priors()
    cube[0]=pri.UniformPrior(cube[0],1.0,199.0)
    etc.
"""

def __init__(self):
    pass

def DeltaFunctionPrior(self,r,x1,x2):
    """Uniform[0:1]  ->  Delta[x1]"""
    return x1

def UniformPrior(self,r,x1,x2):
    """Uniform[0:1]  ->  Uniform[x1:x2]"""
    return x1+r*(x2-x1)

def LogPrior(self,r,x1,x2):
    """Uniform[0:1]  ->  LogUniform[x1:x2]"""
    if (r <= 0.0):
            return -1.0e32
    else:
        from math import log10
        lx1=log10(x1); lx2=log10(x2)
        return 10.0**(lx1+r*(lx2-lx1))

def GaussianPrior(self,r,mu,sigma):
    """Uniform[0:1]  ->  Gaussian[mean=mu,variance=sigma**2]"""
    from math import sqrt
    from scipy.special import erfcinv
    if (r <= 1.0e-16 or (1.0-r) <= 1.0e-16):
            return -1.0e32
    else:
            return mu+sigma*sqrt(2.0)*erfcinv(2.0*(1.0-r))

-------------------------------------------------------------------------------

MPI and segfault

Hi - trying to run pymultinest demo script (and own code) on Ubuntu 12.04 with openmpi 1.8.2, python 2.7, multinest v3.5 and pymultinest cloned today from github.

The multinest gaussian example runs fine for nprocs > 1, but with pymultinest we get the following heap segfault (it affects your minimal demo script also):

Total Samples: 1728
Nested Sampling ln(Z): 135.834567
Importance Nested Sampling ln(Z): 235.236389 +/- 0.517489
Acceptance Rate: 0.744212
Replacements: 1350
Total Samples: 1814
Nested Sampling ln(Z): 142.906738
Importance Nested Sampling ln(Z): 235.442346 +/- 0.427753
*** glibc detected * python: free(): invalid next size (normal): 0x00000000027809d0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x7e846)[0x7f8727a23846]
/home/gianni/sw/JZ/jz/MultiNest_v3.5_CMake/multinest/lib/libmultinest.so(__posterior_MOD_pos_samp+0x7cfa)[0x7f872705e804]
/home/gianni/sw/JZ/jz/MultiNest_v3.5_CMake/multinest/lib/libmultinest.so(__nested_MOD_clusterednest+0x2176a)[0x7f872708eeb0]
/home/gianni/sw/JZ/jz/MultiNest_v3.5_CMake/multinest/lib/libmultinest.so(__nested_MOD_nestsample+0xfc1)[0x7f8727093a4f]
/home/gianni/sw/JZ/jz/MultiNest_v3.5_CMake/multinest/lib/libmultinest.so(__nested_MOD_nestrun+0x16c6)[0x7f8727095511]
/home/gianni/sw/JZ/jz/MultiNest_v3.5_CMake/multinest/lib/libmultinest.so(run+0x36e)[0x7f872703c0cf]
/usr/lib/python2.7/lib-dynload/_ctypes.so(ffi_call_unix64+0x4c)[0x7f87272baea4]
/usr/lib/python2.7/lib-dynload/_ctypes.so(ffi_call+0x1e5)[0x7f87272ba8c5]
/usr/lib/python2.7/lib-dynload/_ctypes.so(_ctypes_callproc+0x4d2)[0x7f87272ab2c2]
/usr/lib/python2.7/lib-dynload/_ctypes.so(+0xbaa2)[0x7f87272abaa2]
python(PyObject_Call+0x36)[0x4d91b6]
python(PyEval_EvalFrameEx+0x86a)[0x54c0da]
python(PyEval_EvalCodeEx+0x1a2)[0x575d92]
python(PyEval_EvalFrameEx+0x7b8)[0x54c028]
python(PyEval_EvalCodeEx+0x1a2)[0x575d92]
python(PyRun_SimpleFileExFlags+0x292)[0x4c1352]
python(Py_Main+0x87f)[0x4c754f]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed)[0x7f87279c676d]
python[0x41ba41]
======= Memory map: ========
00400000-00672000 r-xp 00000000 08:03 53091941 /usr/bin/python2.7
00871000-00872000 r--p 00271000 08:03 53091941 /usr/bin/python2.7
00872000-008db000 rw-p 00272000 08:03 53091941 /usr/bin/python2.7
008db000-008ed000 rw-p 00000000 00:00 0
01159000-0281f000 rw-p 00000000 00:00 0 [heap]
7f871b0cf000-7f871b134000 r-xp 00000000 08:03 56234703 /usr/lib/pyshared/python2.7/matplotlib/backends/_backend_agg.so
7f871b134000-7f871b333000 ---p 00065000 08:03 56234703 /usr/lib/pyshared/python2.7/matplotlib/backends/_backend_agg.so
7f871b333000-7f871b336000 r--p 00064000 08:03 56234703 /usr/lib/pyshared/python2.7/matplotlib/backends/_backend_agg.so
7f871b336000-7f871b337000 rw-p 00067000 08:03 56234703 /usr/lib/pyshared/python2.7/matplotlib/backends/_backend_agg.so
7f871b337000-7f871b357000 r-xp 00000000 08:03 56234704 /usr/lib/pyshared/python2.7/matplotlib/backends/_tkagg.so
7f871b357000-7f871b556000 ---p 00020000 08:03 56234704 /usr/lib/pyshared/python2.7/matplotlib/backends/_tkagg.so
7f871b556000-7f871b558000 r--p 0001f000 08:03 56234704 /usr/lib/pyshared/python2.7/matplotlib/backends/_tkagg.so
7f871b558000-7f871b559000 rw-p 00021000 08:03 56234704 /usr/lib/pyshared/python2.7/matplotlib/backends/_tkagg.so
7f871b559000-7f871b55a000 ---p 00000000 00:00 0
7f871b55a000-7f871bd5a000 rwxp 00000000 00:00 0
7f871bd5a000-7f871bd5f000 r-xp 00000000 08:03 53092554 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
7f871bd5f000-7f871bf5e000 ---p 00005000 08:03 53092554 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
7f871bf5e000-7f871bf5f000 r--p 00004000 08:03 53092554 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
7f871bf5f000-7f871bf60000 rw-p 00005000 08:03 53092554 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
7f871bf60000-7f871bf62000 r-xp 00000000 08:03 53092543 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
7f871bf62000-7f871c161000 ---p 00002000 08:03 53092543 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
7f871c161000-7f871c162000 r--p 00001000 08:03 53092543 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
7f871c162000-7f871c163000 rw-p 00002000 08:03 53092543 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
7f871c163000-7f871c18a000 r-xp 00000000 08:03 9568279 /lib/x86_64-linux-gnu/libexpat.so.1.5.2
7f871c18a000-7f871c38a000 ---p 00027000 08:03 9568279 /lib/x86_64-linux-gnu/libexpat.so.1.5.2
7f871c38a000-7f871c38c000 r--p 00027000 08:03 9568279 /lib/x86_64-linux-gnu/libexpat.so.1.5.2
7f871c38c000-7f871c38d000 rw-p 00029000 08:03 9568279 /lib/x86_64-linux-gnu/libexpat.so.1.5.2
7f871c38d000-7f871c396000 r-xp 00000000 08:03 53086345 /usr/lib/x86_64-linux-gnu/libXrender.so.1.3.0
7f871c396000-7f871c595000 ---p 00009000 08:03 53086345 /usr/lib/x86_64-linux-gnu/libXrender.so.1.3.0
7f871c595000-7f871c596000 r--p 00008000 08:03 53086345 /usr/lib/x86_64-linux-gnu/libXrender.so.1.3.0
7f871c596000-7f871c597000 rw-p 00009000 08:03 53086345 /usr/lib/x86_64-linux-gnu/libXrender.so.1.3.0
7f871c597000-7f871c5a7000 r-xp 00000000 08:03 53086290 /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0
7f871c5a7000-7f871c7a6000 ---p 00010000 08:03 53086290 /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0
7f871c7a6000-7f871c7a7000 r--p 0000f000 08:03 53086290 /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0
7f871c7a7000-7f871c7a8000 rw-p 00010000 08:03 53086290 /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0
7f871c7a8000-7f871c7c5000 r-xp 00000000 08:03 53086286 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
7f871c7c5000-7f871c9c4000 ---p 0001d000 08:03 53086286 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
7f871c9c4000-7f871c9c5000 r--p 0001c000 08:03 53086286 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
7f871c9c5000-7f871c9c6000 rw-p 0001d000 08:03 53086286 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
7f871c9c6000-7f871c9fa000 r-xp 00000000 08:03 53086452 /usr/lib/x86_64-linux-gnu/libfontconfig.so.1.4.4
7f871c9fa000-7f871cbfa000 ---p 00034000 08:03 53086452 /usr/lib/x86_64-linux-gnu/libfontconfig.so.1.4.4
7f871cbfa000-7f871cbfb000 r--p 00034000 08:03 53086452 /usr/lib/x86_64-linux-gnu/libfontconfig.so.1.4.4
7f871cbfb000-7f871cbfc000 rw-p 00035000 08:03 53086452 /usr/lib/x86_64-linux-gnu/libfontconfig.so.1.4.4
7f871cbfc000-7f871cc10000 r-xp 00000000 08:03 53092560 /usr/lib/x86_64-linux-gnu/libXft.so.2.2.0
7f871cc10000-7f871ce0f000 ---p 00014000 08:03 53092560 /usr/lib/x86_64-linux-gnu/libXft.so.2.2.0
7f871ce0f000-7f871ce10000 r--p 00013000 08:03 53092560 /usr/lib/x86_64-linux-gnu/libXft.so.2.2.0
7f871ce10000-7f871ce11000 rw-p 00014000 08:03 53092560 /usr/lib/x86_64-linux-gnu/libXft.so.2.2.0
7f871ce11000-7f871ce13000 r-xp 00000000 08:03 53085233 /usr/lib/x86_64-linux-gnu/libXss.so.1.0.0
7f871ce13000-7f871d013000 ---p 00002000 08:03 53085233 /usr/lib/x86_64-linux-gnu/libXss.so.1.0.0
7f871d013000-7f871d014000 r--p 00002000 08:03 53085233 /usr/lib/x86_64-linux-gnu/libXss.so.1.0.0
7f871d014000-7f871d015000 rw-p 00003000 08:03 53085233 /usr/lib/x86_64-linux-gnu/libXss.so.1.0.0
7f871d015000-7f871d145000 r-xp 00000000 08:03 53086288 /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
7f871d145000-7f871d345000 ---p 00130000 08:03 53086288 /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
7f871d345000-7f871d346000 r--p 00130000 08:03 53086288 /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
7f871d346000-7f871d34a000 rw-p 00131000 08:03 53086288 /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
7f871d34a000-7f871d458000 r-xp 00000000 08:03 53092034 /usr/lib/libtcl8.5.so.0
7f871d458000-7f871d657000 ---p 0010e000 08:03 53092034 /usr/lib/libtcl8.5.so.0
7f871d657000-7f871d65b000 r--p 0010d000 08:03 53092034 /usr/lib/libtcl8.5.so.0
7f871d65b000-7f871d662000 rw-p 00111000 08:03 53092034 /usr/lib/libtcl8.5.so.0
7f871d662000-7f871d663000 rw-p 00000000 00:00 0
7f871d663000-7f871d78a000 r-xp 00000000 08:03 53092040 /usr/lib/libtk8.5.so.0
7f871d78a000-7f871d989000 ---p 00127000 08:03 53092040 /usr/lib/libtk8.5.so.0
7f871d989000-7f871d994000 r--p 00126000 08:03 53092040 /usr/lib/libtk8.5.so.0
7f871d994000-7f871d9a8000 rw-p 00131000 08:03 53092040 /usr/lib/libtk8.5.so.0
7f871d9a8000-7f871dab0000 r-xp 00000000 08:03 53092044 /usr/lib/libBLT.2.4.so.8.5
7f871dab0000-7f871dcaf000 ---p 00108000 08:03 53092044 /usr/lib/libBLT.2.4.so.8.5
7f871dcaf000-7f871dcb0000 r--p 00107000 08:03 53092044 /usr/lib/libBLT.2.4.so.8.5
7f871dcb0000-7f871dccd000 rw-p 00108000 08:03 53092044 /usr/lib/libBLT.2.4.so.8.5
7f871dccd000-7f871dcce000 rw-p 00000000 00:00 0
7f871dcce000-7f871dcda000 r-xp 00000000 08:03 53216120 /usr/lib/python2.7/lib-dynload/_tkinter.so
7f871dcda000-7f871ded9000 ---p 0000c000 08:03 53216120 /usr/lib/python2.7/lib-dynload/_tkinter.so
7f871ded9000-7f871deda000 r--p 0000b000 08:03 53216120 /usr/lib/python2.7/lib-dynload/_tkinter.so
7f871deda000-7f871dedc000 rw-p 0000c000 08:03 53216120 /usr/lib/python2.7/lib-dynload/_tkinter.so
7f871dedc000-7f871df13000 r-xp 00000000 08:03 56101243 /usr/lib/pyshared/python2.7/matplotlib/_tri.so
7f871df13000-7f871e113000 ---p 00037000 08:03 56101243 /usr/lib/pyshared/python2.7/matplotlib/_tri.so
7f871e113000-7f871e115000 r--p 00037000 08:03 56101243 /usr/lib/pyshared/python2.7/matplotlib/_tri.so
7f871e115000-7f871e116000 rw-p 00039000 08:03 56101243 /usr/lib/pyshared/python2.7/matplotlib/_tri.so
7f871e116000-7f871e124000 r-xp 00000000 08:03 56101245 /usr/lib/pyshared/python2.7/matplotlib/_delaunay.so
7f871e124000-7f871e323000 ---p 0000e000 08:03 56101245 /usr/lib/pyshared/python2.7/matplotlib/_delaunay.so
7f871e323000-7f871e324000 r--p 0000d000 08:03 56101245 /usr/lib/pyshared/python2.7/matplotlib/_delaunay.so
7f871e324000-7f871e325000 rw-p 0000e000 08:03 56101245 /usr/lib/pyshared/python2.7/matplotlib/_delaunay.so
7f871e325000-7f871e626000 rw-p 00000000 00:00 0
7f871e626000-7f871e668000 r-xp 00000000 08:03 56101244 /usr/lib/pyshared/python2.7/matplotlib/_image.so
7f871e668000-7f871e868000 ---p 00042000 08:03 56101244 /usr/lib/pyshared/python2.7/matplotlib/_image.so
7f871e868000-7f871e86a000 r--p 00042000 08:03 56101244 /usr/lib/pyshared/python2.7/matplotlib/_image.so
7f871e86a000-7f871e86c000 rw-p 00044000 08:03 56101244 /usr/lib/pyshared/python2.7/matplotlib/_image.so
7f871e86c000-7f871e871000 r-xp 00000000 08:03 56101248 /usr/lib/pyshared/python2.7/matplotlib/_cntr.so
7f871e871000-7f871ea71000 ---p 00005000 08:03 56101248 /usr/lib/pyshared/python2.7/matplotlib/_cntr.so
7f871ea71000-7f871ea72000 r--p 00005000 08:03 56101248 /usr/lib/pyshared/python2.7/matplotlib/_cntr.so
7f871ea72000-7f871ea73000 rw-p 00006000 08:03 56101248 /usr/lib/pyshared/python2.7/matplotlib/_cntr.so
7f871ea73000-7f871ea99000 r-xp 00000000 08:03 9571901 /lib/x86_64-linux-gnu/libpng12.so.0.46.0
7f871ea99000-7f871ec99000 ---p 00026000 08:03 9571901 /lib/x86_64-linux-gnu/libpng12.so.0.46.0
7f871ec99000-7f871ec9a000 r--p 00026000 08:03 9571901 /lib/x86_64-linux-gnu/libpng12.so.0.46.0
7f871ec9a000-7f871ec9b000 rw-p 00027000 08:03 9571901 /lib/x86_64-linux-gnu/libpng12.so.0.46.0
7f871ec9b000-7f871ecc1000 r-xp 00000000 08:03 56101241 /usr/lib/pyshared/python2.7/matplotlib/_png.so
7f871ecc1000-7f871eec0000 ---p 00026000 08:03 56101241 /usr/lib/pyshared/python2.7/matplotlib/_png.so
7f871eec0000-7f871eec2000 r--p 00025000 08:03 56101241 /usr/lib/pyshared/python2.7/matplotlib/_png.so
7f871eec2000-7f871eec3000 rw-p 00027000 08:03 56101241 /usr/lib/pyshared/python2.7/matplotlib/_png.so
7f871eec3000-7f871eec9000 r-xp 00000000 08:03 53223346 /usr/lib/python2.7/lib-dynload/_csv.so
7f871eec9000-7f871f0c8000 ---p 00006000 08:03 53223346 /usr/lib/python2.7/lib-dynload/_csv.so
7f871f0c8000-7f871f0c9000 r--p 00005000 08:03 53223346 /usr/lib/python2.7/lib-dynload/_csv.so
7f871f0c9000-7f871f0cb000 rw-p 00006000 08:03 53223346 /usr/lib/python2.7/lib-dynload/_csv.so
7f871f0cb000-7f871f0cd000 r-xp 00000000 08:03 56101247 /usr/lib/pyshared/python2.7/matplotlib/nxutils.so
7f871f0cd000-7f871f2cc000 ---p 00002000 08:03 56101247 /usr/lib/pyshared/python2.7/matplotlib/nxutils.so
7f871f2cc000-7f871f2cd000 r--p 00001000 08:03 56101247 /usr/lib/pyshared/python2.7/matplotlib/nxutils.so
7f871f2cd000-7f871f2ce000 rw-p 00002000 08:03 56101247 /usr/lib/pyshared/python2.7/matplotlib/nxutils.so
7f871f2ce000-7f871f364000 r-xp 00000000 08:03 53086331 /usr/lib/x86_64-linux-gnu/libfreetype.so.6.8.0
7f871f364000-7f871f563000 ---p 00096000 08:03 53086331 /usr/lib/x86_64-linux-gnu/libfreetype.so.6.8.0
7f871f563000-7f871f569000 r--p 00095000 08:03 53086331 /usr/lib/x86_64-linux-gnu/libfreetype.so.6.8.0
7f871f569000-7f871f56a000 rw-p 0009b000 08:03 53086331 /usr/lib/x86_64-linux-gnu/libfreetype.so.6.8.0
7f871f56a000-7f871f5ae000 r-xp 00000000 08:03 56101246 /usr/lib/pyshared/python2.7/matplotlib/ft2font.so
7f871f5ae000-7f871f7ad000 ---p 00044000 08:03 56101246 /usr/lib/pyshared/python2.7/matplotlib/ft2font.so
7f871f7ad000-7f871f7b0000 r--p 00043000 08:03 56101246 /usr/lib/pyshared/python2.7/matplotlib/ft2font.so
7f871f7b0000-7f871f7b2000 rw-p 00046000 08:03 56101246 /usr/lib/pyshared/python2.7/matplotlib/ft2font.so
7f871f7b2000-7f871f7b3000 rw-p 00000000 00:00 0
7f871f7b3000-7f871f7f5000 r-xp 00000000 08:03 56101249 /usr/lib/pyshared/python2.7/matplotlib/_path.so
7f871f7f5000-7f871f9f5000 ---p 00042000 08:03 56101249 /usr/lib/pyshared/python2.7/matplotlib/_path.so
7f871f9f5000-7f871f9f7000 r--p 00042000 08:03 56101249 /usr/lib/pyshared/python2.7/matplotlib/_path.so
7f871f9f7000-7f871f9f8000 rw-p 00044000 08:03 56101249 /usr/lib/pyshared/python2.7/matplotlib/_path.so
7f871f9f8000-7f871fa0c000 r-xp 00000000 08:03 53223351 /usr/lib/python2.7/lib-dynload/datetime.so
7f871fa0c000-7f871fc0b000 ---p 00014000 08:03 53223351 /usr/lib/python2.7/lib-dynload/datetime.so
7f871fc0b000-7f871fc0c000 r--p 00013000 08:03 53223351 /usr/lib/python2.7/lib-dynload/datetime.so
7f871fc0c000-7f871fc10000 rw-p 00014000 08:03 53223351 /usr/lib/python2.7/lib-dynload/datetime.so
7f871fc10000-7f871fc19000 r-xp 00000000 08:03 59115538 /usr/lib/python2.7/dist-packages/scipy/spatial/_distance_wrap.so
7f871fc19000-7f871fe19000 ---p 00009000 08:03 59115538 /usr/lib/python2.7/dist-packages/scipy/spatial/_distance_wrap.so
7f871fe19000-7f871fe1a000 r--p 00009000 08:03 59115538 /usr/lib/python2.7/dist-packages/scipy/spatial/_distance_wrap.so
* glibc detected *** python: free(): invalid next size (normal): 0x0000000002546a80 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x7e846)[0x7fe46570c846]
/home/gianni/sw/JZ/jz/MultiNest_v3.5_CMake/multinest/lib/libmultinest.so(__posterior_MOD_pos_samp+0x7cfa)[0x7fe464d47804]
/home/gianni/sw/JZ/jz/MultiNest_v3.5_CMake/multinest/lib/libmultinest.so(__nested_MOD_clusterednest+0x2176a)[0x7fe464d77eb0]
/home/gianni/sw/JZ/jz/MultiNest_v3.5_CMake/multinest/lib/libmultinest.so(__nested_MOD_nestsample+0xfc1)[0x7fe464d7ca4f]
/home/gianni/sw/JZ/jz/MultiNest_v3.5_CMake/multinest/lib/libmultinest.so(__nested_MOD_nestrun+0x16c6)[0x7fe464d7e511]
/home/gianni/sw/JZ/jz/MultiNest_v3.5_CMake/multinest/lib/libmultinest.so(run+0x36e)[0x7fe464d250cf]
/usr/lib/python2.7/lib-dynload/_ctypes.so(ffi_call_unix64+0x4c)[0x7fe464fa3ea4]
/usr/lib/python2.7/lib-dynload/_ctypes.so(ffi_call+0x1e5)[0x7fe464fa38c5]
/usr/lib/python2.7/lib-dynload/_ctypes.so(_ctypes_callproc+0x4d2)[0x7fe464f942c2]
/usr/lib/python2.7/lib-dynload/_ctypes.so(+0xbaa2)[0x7fe464f94aa2]
python(PyObject_Call+0x36)[0x4d91b6]
python(PyEval_EvalFrameEx+0x86a)[0x54c0da]
python(PyEval_EvalCodeEx+0x1a2)[0x575d92]
python(PyEval_EvalFrameEx+0x7b8)[0x54c028]
python(PyEval_EvalCodeEx+0x1a2)[0x575d92]
python(PyRun_SimpleFileExFlags+0x292)[0x4c1352]
python(Py_Main+0x87f)[0x4c754f]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed)[0x7fe4656af76d]
python[0x41ba41]
======= Memory map: ========
00400000-00672000 r-xp 00000000 08:03 53091941 /usr/bin/python2.7
00871000-00872000 r--p 00271000 08:03 53091941 /usr/bin/python2.7
00872000-008db000 rw-p 00272000 08:03 53091941 /usr/bin/python2.7
008db000-008ed000 rw-p 00000000 00:00 0
00f1f000-025d7000 rw-p 00000000 00:00 0 [heap]
7fe458db8000-7fe458e1d000 r-xp 00000000 08:03 56234703 /usr/lib/pyshared/python2.7/matplotlib/backends/_backend_agg.so
7fe458e1d000-7fe45901c000 ---p 00065000 08:03 56234703 /usr/lib/pyshared/python2.7/matplotlib/backends/_backend_agg.so
7fe45901c000-7fe45901f000 r--p 00064000 08:03 56234703 /usr/lib/pyshared/python2.7/matplotlib/backends/_backend_agg.so
7fe45901f000-7fe459020000 rw-p 00067000 08:03 56234703 /usr/lib/pyshared/python2.7/matplotlib/backends/_backend_agg.so
7fe459020000-7fe459040000 r-xp 00000000 08:03 56234704 /usr/lib/pyshared/python2.7/matplotlib/backends/_tkagg.so
7fe459040000-7fe45923f000 ---p 00020000 08:03 56234704 /usr/lib/pyshared/python2.7/matplotlib/backends/_tkagg.so
7fe45923f000-7fe459241000 r--p 0001f000 08:03 56234704 /usr/lib/pyshared/python2.7/matplotlib/backends/_tkagg.so
7fe459241000-7fe459242000 rw-p 00021000 08:03 56234704 /usr/lib/pyshared/python2.7/matplotlib/backends/_tkagg.so
7fe459242000-7fe459243000 ---p 00000000 00:00 0
7fe459243000-7fe459a43000 rwxp 00000000 00:00 0
7fe459a43000-7fe459a48000 r-xp 00000000 08:03 53092554 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
7fe459a48000-7fe459c47000 ---p 00005000 08:03 53092554 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
7fe459c47000-7fe459c48000 r--p 00004000 08:03 53092554 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
7fe459c48000-7fe459c49000 rw-p 00005000 08:03 53092554 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
7fe459c49000-7fe459c4b000 r-xp 00000000 08:03 53092543 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
7fe459c4b000-7fe459e4a000 ---p 00002000 08:03 53092543 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
7fe459e4a000-7fe459e4b000 r--p 00001000 08:03 53092543 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
7fe459e4b000-7fe459e4c000 rw-p 00002000 08:03 53092543 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
7fe459e4c000-7fe459e73000 r-xp 00000000 08:03 9568279 /lib/x86_64-linux-gnu/libexpat.so.1.5.2
7fe459e73000-7fe45a073000 ---p 00027000 08:03 9568279 /lib/x86_64-linux-gnu/libexpat.so.1.5.2
7fe45a073000-7fe45a075000 r--p 00027000 08:03 9568279 /lib/x86_64-linux-gnu/libexpat.so.1.5.2
7fe45a075000-7fe45a076000 rw-p 00029000 08:03 9568279 /lib/x86_64-linux-gnu/libexpat.so.1.5.2
7fe45a076000-7fe45a07f000 r-xp 00000000 08:03 53086345 /usr/lib/x86_64-linux-gnu/libXrender.so.1.3.0
7fe45a07f000-7fe45a27e000 ---p 00009000 08:03 53086345 /usr/lib/x86_64-linux-gnu/libXrender.so.1.3.0
7fe45a27e000-7fe45a27f000 r--p 00008000 08:03 53086345 /usr/lib/x86_64-linux-gnu/libXrender.so.1.3.0
7fe45a27f000-7fe45a280000 rw-p 00009000 08:03 53086345 /usr/lib/x86_64-linux-gnu/libXrender.so.1.3.0
7fe45a280000-7fe45a290000 r-xp 00000000 08:03 53086290 /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0
7fe45a290000-7fe45a48f000 ---p 00010000 08:03 53086290 /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0
7fe45a48f000-7fe45a490000 r--p 0000f000 08:03 53086290 /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0
7fe45a490000-7fe45a491000 rw-p 00010000 08:03 53086290 /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0
7fe45a491000-7fe45a4ae000 r-xp 00000000 08:03 53086286 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
7fe45a4ae000-7fe45a6ad000 ---p 0001d000 08:03 53086286 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
7fe45a6ad000-7fe45a6ae000 r--p 0001c000 08:03 53086286 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
7fe45a6ae000-7fe45a6af000 rw-p 0001d000 08:03 53086286 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
7fe45a6af000-7fe45a6e3000 r-xp 00000000 08:03 53086452 /usr/lib/x86_64-linux-gnu/libfontconfig.so.1.4.4
7fe45a6e3000-7fe45a8e3000 ---p 00034000 08:03 53086452 /usr/lib/x86_64-linux-gnu/libfontconfig.so.1.4.4
7fe45a8e3000-7fe45a8e4000 r--p 00034000 08:03 53086452 /usr/lib/x86_64-linux-gnu/libfontconfig.so.1.4.4
7fe45a8e4000-7fe45a8e5000 rw-p 00035000 08:03 53086452 /usr/lib/x86_64-linux-gnu/libfontconfig.so.1.4.4
7fe45a8e5000-7fe45a8f9000 r-xp 00000000 08:03 53092560 /usr/lib/x86_64-linux-gnu/libXft.so.2.2.0
7fe45a8f9000-7fe45aaf8000 ---p 00014000 08:03 53092560 /usr/lib/x86_64-linux-gnu/libXft.so.2.2.0
7fe45aaf8000-7fe45aaf9000 r--p 00013000 08:03 53092560 /usr/lib/x86_64-linux-gnu/libXft.so.2.2.0
7fe45aaf9000-7fe45aafa000 rw-p 00014000 08:03 53092560 /usr/lib/x86_64-linux-gnu/libXft.so.2.2.0
7fe45aafa000-7fe45aafc000 r-xp 00000000 08:03 53085233 /usr/lib/x86_64-linux-gnu/libXss.so.1.0.0
7fe45aafc000-7fe45acfc000 ---p 00002000 08:03 53085233 /usr/lib/x86_64-linux-gnu/libXss.so.1.0.0
7fe45acfc000-7fe45acfd000 r--p 00002000 08:03 53085233 /usr/lib/x86_64-linux-gnu/libXss.so.1.0.0
7fe45acfd000-7fe45acfe000 rw-p 00003000 08:03 53085233 /usr/lib/x86_64-linux-gnu/libXss.so.1.0.0
7fe45acfe000-7fe45ae2e000 r-xp 00000000 08:03 53086288 /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
7fe45ae2e000-7fe45b02e000 ---p 00130000 08:03 53086288 /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
7fe45b02e000-7fe45b02f000 r--p 00130000 08:03 53086288 /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
7fe45b02f000-7fe45b033000 rw-p 00131000 08:03 53086288 /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
7fe45b033000-7fe45b141000 r-xp 00000000 08:03 53092034 /usr/lib/libtcl8.5.so.0
7fe45b141000-7fe45b340000 ---p 0010e000 08:03 53092034 /usr/lib/libtcl8.5.so.0
7fe45b340000-7fe45b344000 r--p 0010d000 08:03 53092034 /usr/lib/libtcl8.5.so.0
7fe45b344000-7fe45b34b000 rw-p 00111000 08:03 53092034 /usr/lib/libtcl8.5.so.0
7fe45b34b000-7fe45b34c000 rw-p 00000000 00:00 0
7fe45b34c000-7fe45b473000 r-xp 00000000 08:03 53092040 /usr/lib/libtk8.5.so.0
7fe45b473000-7fe45b672000 ---p 00127000 08:03 53092040 /usr/lib/libtk8.5.so.0
7fe45b672000-7fe45b67d000 r--p 00126000 08:03 53092040 /usr/lib/libtk8.5.so.0
7fe45b67d000-7fe45b691000 rw-p 00131000 08:03 53092040 /usr/lib/libtk8.5.so.0
7fe45b691000-7fe45b799000 r-xp 00000000 08:03 53092044 /usr/lib/libBLT.2.4.so.8.5
7fe45b799000-7fe45b998000 ---p 00108000 08:03 53092044 /usr/lib/libBLT.2.4.so.8.5
7fe45b998000-7fe45b999000 r--p 00107000 08:03 53092044 /usr/lib/libBLT.2.4.so.8.5
7fe45b999000-7fe45b9b6000 rw-p 00108000 08:03 53092044 /usr/lib/libBLT.2.4.so.8.5
7fe45b9b6000-7fe45b9b7000 rw-p 00000000 00:00 0
7fe45b9b7000-7fe45b9c3000 r-xp 00000000 08:03 53216120 /usr/lib/python2.7/lib-dynload/_tkinter.so
7fe45b9c3000-7fe45bbc2000 ---p 0000c000 08:03 53216120 /usr/lib/python2.7/lib-dynload/_tkinter.so
7fe45bbc2000-7fe45bbc3000 r--p 0000b000 08:03 53216120 /usr/lib/python2.7/lib-dynload/_tkinter.so
7fe45bbc3000-7fe45bbc5000 rw-p 0000c000 08:03 53216120 /usr/lib/python2.7/lib-dynload/_tkinter.so
7fe45bbc5000-7fe45bbfc000 r-xp 00000000 08:03 56101243 /usr/lib/pyshared/python2.7/matplotlib/_tri.so
7fe45bbfc000-7fe45bdfc000 ---p 00037000 08:03 56101243 /usr/lib/pyshared/python2.7/matplotlib/_tri.so
7fe45bdfc000-7fe45bdfe000 r--p 00037000 08:03 56101243 /usr/lib/pyshared/python2.7/matplotlib/_tri.so
7fe45bdfe000-7fe45bdff000 rw-p 00039000 08:03 56101243 /usr/lib/pyshared/python2.7/matplotlib/_tri.so
7fe45bdff000-7fe45be0d000 r-xp 00000000 08:03 56101245 /usr/lib/pyshared/python2.7/matplotlib/_delaunay.so
7fe45be0d000-7fe45c00c000 ---p 0000e000 08:03 56101245 /usr/lib/pyshared/python2.7/matplotlib/_delaunay.so
7fe45c00c000-7fe45c00d000 r--p 0000d000 08:03 56101245 /usr/lib/pyshared/python2.7/matplotlib/_delaunay.so
7fe45c00d000-7fe45c00e000 rw-p 0000e000 08:03 56101245 /usr/lib/pyshared/python2.7/matplotlib/_delaunay.so
7fe45c00e000-7fe45c30f000 rw-p 00000000 00:00 0
7fe45c30f000-7fe45c351000 r-xp 00000000 08:03 56101244 /usr/lib/pyshared/python2.7/matplotlib/_image.so
7fe45c351000-7fe45c551000 ---p 00042000 08:03 56101244 /usr/lib/pyshared/python2.7/matplotlib/_image.so
7fe45c551000-7fe45c553000 r--p 00042000 08:03 56101244 /usr/lib/pyshared/python2.7/matplotlib/_image.so
7fe45c553000-7fe45c555000 rw-p 00044000 08:03 56101244 /usr/lib/pyshared/python2.7/matplotlib/_image.so
7fe45c555000-7fe45c55a000 r-xp 00000000 08:03 56101248 /usr/lib/pyshared/python2.7/matplotlib/_cntr.so
7fe45c55a000-7fe45c75a000 ---p 00005000 08:03 56101248 /usr/lib/pyshared/python2.7/matplotlib/_cntr.so--------------------------------------------------------------------------

mpirun noticed that process rank 0 with PID 21820 on node gianni-Precision-M6700 exited on signal 6 (Aborted).

Any ideas?

Test script using mpi

Hi Johannes,

I am having problem to run pymltinest using MPI. Without MPI, everything is perfect.
I got the same error like issues 6 using the same demo script:
#6
I think MPI is correctly install in server.
I could not get what modification I should make to run it properly.
Could you please help me to solve this problem? Thank you.

Regards,
Suvendu Rakshit

pymultinest_demo.py --- problem with Python graphics

Dear Johannes Buchner,

thank you very much for your effort on PyMultiNest. I am Zoran Pasaric, working at Geophysical Institute, Faculty of Science, University of Zagreb, Croatia. I am mathematician by education, but working for a long time in oceanography and climatology. I am proficient in Matlab and (have been proficient) in Fortran 77, but have working understanding of Fortran 95. I have reasonable knowledge on bash an Linux (currently Ubuntu 14.04).
Regarding Python, I am totally new, but eager to learn.

I tried various recipes offered on your pages to install PyMultiNest, but with only partial success. Thus, I was able to compile and run MultiNest (MultiNest_v3.6_CMake) using Intel compiler, v. 13.0.1 (gfortran seems to be very strict, so the cwrapper.f90 did not compile).

I was able to install PyMultyNest and to perform
python -c 'import pymultinest'

Then
python ../pymultinest_demo_minimal.py
as well as
ipython ../pymultinest_demo_minimal.py
works OK. So, the fortran interface seem to work.

However, if I try

rm chains/*
python ../pymultinest_demo.py

I get
------------------------------ ANALYSIS ------------------------------
Global Evidence:

2.357900664501498e+02 +- 7.869582834473685e-02

after which problems with graphics occur. Namely, I get some graphics, with only one figure (1-phys_live.points.pdf), with somewhat strange behavior which seems is not fully reproducible. A lot of messages is displayed on the screen, including

Syntax Error: XObject 'M0' is unknown
Syntax Error (148868): Unexpected end of file in flate stream
Syntax Error: Leftover args in content stream

or

Syntax Error: XObject 'M0' is unknown
Syntax Error: ExtGState 'A2' is unknown

At the and I get

RuntimeError: main thread is not in main loop.

So, this seems to be the (my) python problem. I would be very grateful for any hint. I can provide the traceback and/or screen shots of the produced graphics if you think this could be helpful.

Thanks again for any suggestion. Best regards,

Zoran Pasaric

python/ctypes segfault in ffi_closure_unix64_inner when callback function is called

I created this issue to help people who face the same difficulty.

If you write a python / C interface with ctypes, and use callbacks: If you don't keep a reference to your callback function, it can get garbage collected (mentioned at the end of http://python.net/crew/theller/ctypes/tutorial.html#callback-functions).

You will get a segfault in ffi_closure_unix64_inner just like here:

$ gdb python
> run
Program received signal SIGSEGV, Segmentation fault.
0x0000003fc9a05cd1 in ffi_closure_unix64_inner () from /usr/lib64/libffi.so.5
$

so do

cmp_func = CMPFUNC(py_cmp_func)
qsort(ia, len(ia), sizeof(c_int), cmp_func) 

instead of

qsort(ia, len(ia), sizeof(c_int), CMPFUNC(py_cmp_func)) 

Hope this helped you.

Using Multinest FORTRAN library in canopy installation of python

I am running the CentOs 7 distribution of Linux. On my system, I compiled
and installed
a package called Multinest. This is a statistical sampling package from
Cambridge that
is written in FORTRAN. The package is running fine and most of its
functionality in in a libary
called "libmultinest.so", which I installed in the directory
"/usr/local/lib".
A list of libaries thath are needed for "libmultinest.so" is made with
the command ldd.

ldd libmultinest.so
linux-vdso.so.1 => (0x00007fff54fa7000)
liblapack.so.3 => /lib64/liblapack.so.3 (0x00007f9fdb4cd000)
libblas.so.3 => /lib64/libblas.so.3 (0x00007f9fdb274000)
libgfortran.so.3 => /lib64/libgfortran.so.3 (0x00007f9fdaf52000)
libm.so.6 => /lib64/libm.so.6 (0x00007f9fdac50000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f9fdaa3a000)
libquadmath.so.0 => /lib64/libquadmath.so.0 (0x00007f9fda7fd000)
libc.so.6 => /lib64/libc.so.6 (0x00007f9fda43c000)
/lib64/ld-linux-x86-64.so.2 (0x00007f9fdc013000)

These are the standard libraries that are installed on my system.

In order to call Multinest from within python, I installed the python
pacakge PyMultinest
using the command "pip install pymultinest". By the way, the installation
instructions can
be found at"http://johannesbuchner.github.io/PyMultiNest/install.html".
The package PyMultinestm can be tested with the command "python -c 'import
pymultinest'".
Before issuing this command I did "export
LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH"
to make it possible for PyMultinest to find the Multinest library.
Running the test gave me the following result:

python -c 'import pymultinest'
problem:
/usr/local/CanopyCore/appdata/canopy-1.4.1.1975.rh5-x86_64/lib/libgfortran.so.3:
version `GFORTRAN_1.4' not found (required by
/usr/local/lib/libmultinest.so)

This means that the FORTRAN libraries from canopy (numpy) are used,
instead of the one from the directory "/lib64".
I also tried "export LD_LIBRARY_PATH=/lib64:/usr/local/lib:$LD_LIBRARY_PATH" but
this led
to the same result.
I did not find a way to make pyMultinest use the proper libraries as python is
overruling this.
It may happen more often that the Fortan compiler on a system is different than the
compiler
that is used to make the libraries for canopy and I think there is a
solution for the problem that I have, but I did not find it yet.

pypolychord demo

I had to change os.path.mkdir -> os.mkdir in the demo script.

libnest3.so not compiling on Mac OSX 10.6.8

Hi Johannes,

I'm trying to compile libnest3.so from multinest 2.18 so I can install the multinest bridge, but

make libnest3.so WITHOUT_MPI=1

fails thus:

localhost:MultiNest_v2.18 jtlz2$ make libnest3.so
ld -shared -o libnest3.so utils.o utils1.o priors.o kmeans_clstr.o xmeans_clstr.o posterior.o nested.o
ld: unknown option: -shared
make: *** [libnest3.so] Error 1

If I remove -shared I get:

[snip]
___nested_MOD_gen_initial_live in nested.o
___nested_MOD_nestsample in nested.o
___nested_MOD_nestsample in nested.o
___nested_MOD_nestsample in nested.o
___nested_MOD_nestsample in nested.o
___nested_MOD_nestrun in nested.o
___nested_MOD_nestrun in nested.o
___nested_MOD_nestrun in nested.o
___nested_MOD_nestrun in nested.o
___nested_MOD_nestrun in nested.o
"dsyevr", referenced from:
___utils1_MOD_diagonalize in utils1.o
___utils1_MOD_diagonalize in utils1.o
"_tan", referenced from:
___priors_MOD_cauchyprior in priors.o
ld: symbol(s) not found for inferred architecture i386

If I remove -m64 from my FC (see below) I still get:

localhost:MultiNest_v2.18 jtlz2$ make libnest3.so
gfortran -ffree-line-length-none -O3 -c -o utils.o utils.f90
gfortran -ffree-line-length-none -O3 -c -o utils1.o utils1.f90
gfortran -ffree-line-length-none -O3 -c -o priors.o priors.f90
gfortran -ffree-line-length-none -O3 -c -o kmeans_clstr.o kmeans_clstr.f90
gfortran -ffree-line-length-none -O3 -c -o xmeans_clstr.o xmeans_clstr.f90
gfortran -ffree-line-length-none -O3 -c -o posterior.o posterior.F90
gfortran -ffree-line-length-none -O3 -c -o nested.o nested.F90
ld -shared -o libnest3.so utils.o utils1.o priors.o kmeans_clstr.o xmeans_clstr.o posterior.o nested.o
ld: unknown option: -shared
make: *** [libnest3.so] Error 1

My makefile is modified from the supplied version:

< #FC = mpif90
< FC = gfortran -ffree-line-length-none -m64
< #CC = mpicc
< CC = gcc
< #CXX = mpiCC
< CXX = gcc
< FFLAGS += -O3 #-DMPI

< CFLAGS += -O3 #-DMPI

FC = mpif90
CC = mpicc
CXX = mpiCC
FFLAGS += -O3 -DMPI
CFLAGS += -O3 -DMPI

and multinest itself compiles and the examples (and indeed my own lhoods) have been running fine.

Any ideas? Thanks in advance for a speedy reply.

PEP8 Compliance

I was wondering if there is any interest in making the code-base PEP8 compliant? PEP8 is the style guide for python programming:

http://legacy.python.org/dev/peps/pep-0008/

There are many tools, which check the code for errors and they highlight PEP8 compliance errors. For example for vim there is syntastic plugin, which can use pylint or flakes8 tools which can check the code on the fly.

Of course PEP8 document is not a law, IMHO following established practices would be helpful in some cases (for example py3k porting)

If you would accept patches on making the code PEP8 compliant, I would be willing to contribute!

run.py mode_tolerance is 1e-90, should be -1e90

Re: Issue #3

Pretty sure there's just a typo in run.py (line 62) as it is now, mode_tolerance should be -1e90, right now it is 1e-90. I was encountering blank stats.txt files, until I changed that.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.