mpiexec and python mpi4py gives rank 0 and size 1

前端 未结 2 754
不思量自难忘°
不思量自难忘° 2021-02-20 14:49

I have a problem with running a python Hello World mpi4py code on a virtual machine.

The hello.py code is:

#!/usr/bin/python
#hello.py
from mpi4py import         


        
2条回答
  •  梦毁少年i
    2021-02-20 15:03

    I had the same issue when running the python module emcee. It would give me an error:

    "ValueError: Tried to create an MPI pool, but there was only one MPI process available. 
    Need at least two."
    

    The solution I found for my particular cluster was to use a different MPI. My code worked with intel-mpi and mpich2 but not openmpi. For this system, all I had to do was switch the MPI. In my PBS script I used module load mpich2 instead of module load openmpi. In this case mpiexec and mpirun worked correctly.

提交回复
热议问题