, Python MPI. ( MPI) MPI, . :
1) Python 0 MPI. mpibinary, , 0 mpibinary. - . Open MPI :
mpirun --hostfile hosts -np 1 pythonbinary args : -np 32 mpibinary args
MPMD ( ), pythonbinary, 0, 32 mpibinary, 1, 2- ... 32 ( 33 ). MPI MPMD. MPI_Comm_split(), , Python. - . Python, ++. MPI_Comm_split() "" . . , , :
Python:
python_comm = mpi.mpi_comm_split(mpi.MPI_COMM_WORLD, 0, 0)
++:
int rank;
MPI_Comm c_comm;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_split(MPI_COMM_WORLD, 1, rank, &c_comm);
rank , , c_comm , , 1 MPI_COMM_WORLD 0 c_comm, 2 1 ..
++ c_comm , . Python ++ MPI_COMM_WORLD, Python - 0.
2) MPI-2. MPI-, Python:
mpirun --hostfile hosts -np 1 pythonbinary args
Python MPI , MPI_Comm_spawn() . MPI_COMM_WORLD, MPI_Comm_split(). spawn , Python MPI.
hosts , MPI. Python MPI-.
, MPI- Python script, MPI_Init, MPI_Finalize, MPI_Comm_split MPI_Send/MPI_Recv. . MPI , , . , Python MPI, .
( MQ).