I've been trying to run a simple example from Cobaya using MPI.
However, the MPI apparently is not working because if I run the example using 4 cores as:
Code: Select all
mpirun -n 4 cobaya-run gaussian.yaml
Code: Select all
-------------------------------------------------------------
[output] *ERROR* File %s is locked by another process, you are running with MPI disabled but may have more than one process. Note that --test should not be used with MPI.
[exception handler] ---------------------------------------
Traceback (most recent call last):
File "/home/karimpsi/.local/bin/cobaya-run", line 8, in <module>
sys.exit(run_script())
File "/home/karimpsi/.local/lib/python3.9/site-packages/cobaya/run.py", line 203, in run_script
run(info, **arguments.__dict__)
File "/home/karimpsi/.local/lib/python3.9/site-packages/cobaya/run.py", line 130, in run
out.check_and_dump_info(info, updated_info, check_compatible=False)
File "/home/karimpsi/.local/lib/python3.9/site-packages/cobaya/mpi.py", line 274, in wrapper
result = method(self, *args, **kwargs)
File "/home/karimpsi/.local/lib/python3.9/site-packages/cobaya/output.py", line 312, in check_and_dump_info
self.check_lock()
File "/home/karimpsi/.local/lib/python3.9/site-packages/cobaya/mpi.py", line 230, in wrapper
return func(*args, **kwargs)
File "/home/karimpsi/.local/lib/python3.9/site-packages/cobaya/output.py", line 498, in check_lock
self.lock.check_error()
File "/home/karimpsi/.local/lib/python3.9/site-packages/cobaya/output.py", line 118, in check_error
self.lock_error()
File "/home/karimpsi/.local/lib/python3.9/site-packages/cobaya/output.py", line 93, in lock_error
raise LoggedError(self.log,
cobaya.log.LoggedError: File %s is locked by another process, you are running with MPI disabled but may have more than one process. Note that --test should not be used with MPI.
-------------------------------------------------------------
The machine has Ubuntu 20.04.4 LTS (with 24 cores) and these are the stuff that I am using:
- Cobaya was installed from github repo.
- It is running within a conda environment with python = 3.8
- I have OpenMpi 4.1.3
- I installed the python wrapper mpi4py 3.1.3 by using:
Code: Select all
conda install -c conda-forge mpi4py
Moreover, when I run
Code: Select all
mpirun -n 4 hostname
Code: Select all
mpirun -n 2 python -c "from mpi4py import MPI, __version__; print(__version__ if MPI.COMM_WORLD.Get_rank() else '')"
Please, could anyone help me on how to solve that issue? I really need to use Cobaya with MPI.
Thanks in advance,
Regards,
Karim