CobayaSampler / cobaya

Code for Bayesian Analysis
http://cobaya.readthedocs.io/en/latest/
Other
128 stars 127 forks source link

cobaya run --test flag incompatible with MPI #230

Closed AdamOrmondroyd closed 2 years ago

AdamOrmondroyd commented 2 years ago

When invoking cobaya run with the --test flag, each thread returns an error stating that mpi4py is not installed, even though it is.

[output] *ERROR* File runs/camb_poly.input.yaml.locked is locked.
You may be running multiple jobs with the same output when you intended to run with MPI. Check that mpi4py is correctly installed and configured (using the same mpi as mpirun/mpiexec); e.g. try the test at
https://cobaya.readthedocs.io/en/latest/installation.html#mpi-parallelization-optional-but-encouraged
mpi4py is NOT currently installed.

Removing --test and making no other changes solves the problem.

cmbant commented 2 years ago

This is only a problem with polychord ?

AdamOrmondroyd commented 2 years ago

I'm finding the same problem with both polychord and mcmc

cmbant commented 2 years ago

--test is intended to test the config not run as mpi. If you just execute --test normally, rather than using mpirun/mpiexec, is it OK?

AdamOrmondroyd commented 2 years ago

It works fine without mpirun etc, or using mpirun with a single task. I've also found the same problem with the evaluate sampler as mcmc and polychord.

I am running cobaya on CSD3, and I expected that I'd be able to just add --test to my sbatch script in order to quickly check that everything was okay before taking my eye off it. If it's not intended to be used this way, maybe this should be mentioned in the docs? Apologies if it is and I've missed it.

cmbant commented 2 years ago

I see your point. We made --test run without mpi so it would work on head nodes where mpi is not allowed, with intention that it is run interactively on the command line. I added one comment to the docs in https://github.com/CobayaSampler/cobaya/pull/222/commits/bc9dd635b65efa83eeda168ed58d1d68074287b8

cmbant commented 2 years ago

Also run-time warning in https://github.com/CobayaSampler/cobaya/commit/9471699168d7440498004acdbbf02e56dd2ea0dd