amusecode / amuse

Astrophysical Multipurpose Software Environment. This is the main repository for AMUSE
http://www.amusecode.org
Apache License 2.0
152 stars 98 forks source link

/home/janez/.local/lib/python3.9/site-packages/amuse/rfi/core.py:964: UserWarning: MPI (unexpectedly?) not available, falling back to sockets channel #1038

Closed sheliak closed 1 month ago

sheliak commented 4 months ago

Whatever I run, I get a warning MPI (unexpectedly?) not available, falling back to sockets channel. The program then works fine, but runs on one CPU only. The warning appears regardless of the number of workers specified in functions like Hermite from amuse.community.hermite.interface.

I'm assuming it has something to do with openmpi, but I have no idea how to begin solving this. mpirun command works fine on its own. Any help would be much appreciated. Thanks.

spzwart commented 4 months ago

Dear Janez,

I run in this mode on my laptop, because MPI requires an internet connection, whereas sockets do not. I can run on multiple cores, though. It's a matter of loading the right packages before you compile. Try the following: conda create -n amuse conda activate amuse mkdir amuse cd amuse git clone https://github.com/amusecode/amuse.git . conda install python conda install numpy conda install scipy conda install h5py conda install pytest conda install docutils conda install mpfr

./configure --prefix=$CONDA_PREFIX make DOWNLOAD_CODES=1

pip install -e . python setup.py develop_build

On Wed, Mar 13, 2024 at 4:57 PM Janez Kos @.***> wrote:

Whatever I run, I get a warning MPI (unexpectedly?) not available, falling back to sockets channel. The program then works fine, but runs on one CPU only. The warning appears regardless of the number of workers specified in functions like Hermite from amuse.community.hermite.interface .

I'm assuming it has something to do with openmpi, but I have no idea how to begin solving this. mpirun command works fine on its own. Any help would be much appreciated. Thanks.

— Reply to this email directly, view it on GitHub https://github.com/amusecode/amuse/issues/1038, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCPFTDM7A3UKIMUN5CAR4TYYBZPZAVCNFSM6AAAAABEUOGIDSVHI2DSMVQWIX3LMV43ASLTON2WKOZSGE4DIMZWGY3DIOI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

LourensVeen commented 4 months ago

In particular, mpi4py is probably missing from your conda environment. Did you install AMUSE via pip, or did you do a develop install from git as Simon writes above?

LourensVeen commented 4 months ago

Ah, hold on, I see now that you're not using conda, but have installed AMUSE into your Python user environment. I think pip install mpi4py should then fix the immediate problem regardless of whether it's a PyPI or a development install, assuming that you have a development package for MPI installed.

However, I think there's another problem here in that it only uses a single CPU regardless of the number of workers you specify. As I understand it even if a socket channel is used to communicate with the workers, it should be possible to have more than one of them. I'm not fully up to speed yet on this part of AMUSE though, so I may be mistaken in that expectation.

stale[bot] commented 2 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 28 days if no further activity occurs. Thank you for your contributions.