JohannesBuchner / PyMultiNest

Pythonic Bayesian inference and visualization for the MultiNest Nested Sampling Algorithm and PyCuba's cubature algorithms.
http://johannesbuchner.github.io/PyMultiNest/
Other
194 stars 88 forks source link

Fortran Runtime Error? #171

Closed ghkareem closed 3 years ago

ghkareem commented 3 years ago

Hi,

I'm trying to run pymultinest, but seem to be getting a fortran runtime error.

It is managing to start (here is the tail of the output):

 *****************************************************
 Starting MultiNest
 generating live points

but it returns the following error

At line 469 of file /MultiNest/src/nested.F90 (unit = 57, file = '�Ws�*')
Fortran runtime error: File already opened in another unit

What causes this error, and how can I go about fixing it? Thanks!

JohannesBuchner commented 3 years ago

Try deleting all output files and try again. It can happen that a file is opened twice. Are there strange symbols in the filename?

ghkareem commented 3 years ago

So after generating live points, it dies before it generates any output files it seems.

As for output directory, I'm guessing that's it since I see it contains A-Z, 0-9, '/' '-' and '.'

Could the '.' be the issue? Thanks again

ghkareem commented 3 years ago

OK I seem to have done something to change the error. Now it says after generating live points that

Fortran runtime error: '/mnt/glidein/execute.2f02b124-23b6-11eb-bafc-7cd30ac729a2/dir_523/chain'  is a directory.

What causes the is a directory error? Thanks

JohannesBuchner commented 3 years ago

Probably your filename is too long for the fortran code. Choose a shorter output prefix.

ghkareem commented 3 years ago

I was worried that was the case - OK, will do. Thanks again!

JohannesBuchner commented 3 years ago

potentially related to #167

ghkareem commented 3 years ago

OK, I shortened the prefix to simply './chain', but now it's returned to the File already opened in another unit. But only one process is being executed, so I'm somewhat confused why it might be opening the same file multiple times? Sorry for my confusion!

JohannesBuchner commented 3 years ago

Try observing what processes are running. Maybe you started one which is paused?

ghkareem commented 3 years ago

I found the issue, I was trying to execute multinest via a bash wrapper script on top of a python script, and rather than executing multinest once, it was trying to repeat execute. I put a sleep command in the bash script and it seemed to do the trick, thanks for your help!