Вот пример сценария Python, который я пытаюсь запустить < /p>
import mpi4py.futures as mp
def some_maths(x,y):
return (x**2)/(1+y)
if __name__=='__main__':
multiargs = [(1, 5), (2, 6), (3, 7), (5, 8), (7, 9), (9, 10)]
# Parallel execution
_PoolExecutor = mp.MPIPoolExecutor
with _PoolExecutor(max_workers=len(multiargs)) as p:
out = p.starmap(some_maths, multiargs)
for r in out:
print(r)
< /code>
Мы обновляемся с Python 3.10 до 3.13. В 3.10, с mpi4py == 3.1.5, это работает нормально. В 3.13, независимо от того, использую ли я mpi4py = 3.1.5 или более новее 4.0.1, я получаю ошибку связи MPI: < /p>
MPI_INIT has failed because at least one MPI process is unreachable
from another. This *usually* means that an underlying communication
plugin -- such as a BTL or an MTL -- has either not loaded or not
allowed itself to be used. Your MPI job will now abort.
You may wish to try to narrow down the problem;
* Check the output of ompi_info to see which BTL/MTL plugins are
available.
* Run your application with MPI_THREAD_SINGLE.
* Set the MCA parameter btl_base_verbose to 100 (or mtl_base_verbose,
if using MTL-based communications) to see exactly which
communication plugins were considered and/or discarded.
< /code>
В системе установлены различные версии OpenMPI, поэтому я пошел проверить, когда запускаю скрипт в Python 3.10, где он работает и найден (через mpi4py.mpi.get_version ()) он использует OpenMPI 2.1.1. В более новой установке Python он использует OpenMPI 4.1.7. Br /> mca: base: components_register: registering framework btl components
mca: base: components_register: found loaded component self
mca: base: components_register: component self register function successful
mca: base: components_open: opening btl components
mca: base: components_open: found loaded component self
mca: base: components_open: component self open function successful
select: initializing btl component self
select: init of component self returned success
... above repeated several times ...
mca: bml: Using self btl for send to [[43610,2],0] on node base
mca: bml: Using self btl for send to [[43610,2],1] on node base
--------------------------------------------------------------------------
MPI_INIT has failed because at least one MPI process is unreachable
from another. This *usually* means that an underlying communication
plugin -- such as a BTL or an MTL -- has either not loaded or not
allowed itself to be used. Your MPI job will now abort.
You may wish to try to narrow down the problem;
* Check the output of ompi_info to see which BTL/MTL plugins are
available.
* Run your application with MPI_THREAD_SINGLE.
* Set the MCA parameter btl_base_verbose to 100 (or mtl_base_verbose,
if using MTL-based communications) to see exactly which
communication plugins were considered and/or discarded.
--------------------------------------------------------------------------
*** An error occurred in MPI_Init_thread
*** reported by process [2858024962,1]
*** on a NULL communicator
*** Unknown error
*** MPI_ERRORS_ARE_FATAL (processes in this communicator will now abort,
*** and potentially your MPI job)
*** An error occurred in MPI_Init_thread
*** reported by process [2858024962,0]
*** on a NULL communicator
*** Unknown error
*** MPI_ERRORS_ARE_FATAL (processes in this communicator will now abort,
*** and potentially your MPI job)
< /code>
Мое первоначальное мысль заключается в том, что я мог бы просто переустановить MPI4PY для моей установки 3.13 и указать в установке, что он должен использовать более старый OpenMPI. Кажется, это делается через: < /p>
$ env MPICC=/path/to/mpicc python -m pip install mpi4py
< /code>
Во -первых, это разумный подход? Во -вторых, есть ли для меня простой способ найти мой путь MPICC, соответствующий более старой версии? I've found a folder on the system for this version but no mpicc in it.
Finally, any other troubleshooting steps I should try here?
Подробнее здесь: https://stackoverflow.com/questions/793 ... nmpi-4-1-7
MPI4PY MPI_INIT FAISH, используя Python 3.11 и OpenMPI 4.1.7 ⇐ Python
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение