Questions tagged [mpi4py]

Python bindings for the Message Passing Interface (MPI); a library for distributed memory parallel programming and the de facto standard method for using distributed memory clusters for high-performance technical computing.

Provides Python bindings for the Message Passing Interface () standard. It is implemented on top of the MPI-1/2/3 specification and exposes an API which grounds on the standard MPI-2 C++ bindings.

Homepage

472 questions
16
votes
2 answers

mpiexec and python mpi4py gives rank 0 and size 1

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 MPI comm = MPI.COMM_WORLD size = comm.Get_size() rank = comm.Get_rank() print "hello world…
ziuu
  • 346
  • 1
  • 3
  • 9
13
votes
1 answer

how to run a basic mpi4py code

Am brand new to mpi4py. The calculate pi example from the Tutorial goes like so: Master (or parent, or client) side: #!/usr/bin/env python from mpi4py import MPI import numpy import sys comm = MPI.COMM_SELF.Spawn(sys.executable, …
bob.sacamento
  • 6,283
  • 10
  • 56
  • 115
12
votes
5 answers

ERROR: Could not build wheels for mpi4py, which is required to install pyproject.toml-based projects

I want to install mpi4py. The installation fails with the error below. Please share the solution to the same error. note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for…
eve
  • 173
  • 1
  • 2
  • 9
11
votes
2 answers

Shared memory in mpi4py

I use a MPI (mpi4py) script (on a single node), which works with a very large object. In order to let all processes have access to the object, I distribute it through comm.bcast(). This copies the object to all processes and consumes a lot of…
Roman
  • 2,225
  • 5
  • 26
  • 55
9
votes
2 answers

Implications of using MPI with TensorFlow

I come from a sort of HPC background and I am just starting to learn about machine learning in general and TensorFlow in particular. I was initially surprised to find out that distributed TensorFlow is designed to communicate with TCP/IP by default…
Cogitator
  • 201
  • 1
  • 2
  • 4
9
votes
3 answers

How to get mpi4py to work on Windows

I'm trying to use mpi4py. I have mpi4py installed from the Anaconda package, and pip install mpi4py recognizes this. But when i run from mpi4py import MPI says MPI module doen't exist. I've looked in the mpi4py folder and indeed i can't find…
alxg
  • 368
  • 1
  • 4
  • 15
9
votes
3 answers

adapt multiprocessing Pool to mpi4py

I'm using multiprocessing Pool to run a parallelized simulation in Python and it works well in a computer with multiple cores. Now I want to execute the program on a cluster using several nodes. I suppose multiprocessing cannot apply on distributed…
ceguo
  • 91
  • 1
  • 3
8
votes
1 answer

Debugging parallel Python programs (mpi4py)

I have an mpi4py program that hangs intermittently. How can I trace what the individual processes are doing? I can run the program in different terminals, for example using pdb mpiexec -n 4 xterm -e "python -m pdb my_program.py" But this gets…
teekarna
  • 1,004
  • 1
  • 10
  • 13
8
votes
1 answer

mpi4py scatter and gather with large numpy arrays

I am trying to parallelise some operations on a large numpy array using mpi4py. I am currently using numpy.array_split to divide the array into chunks, followed by com.scatter to send the array to different cores and then comm.gather to collect the…
218
  • 1,754
  • 7
  • 27
  • 38
6
votes
1 answer

How to run python script with mpi4py (using mpiexec) from within pycharm?

I have a python script that depends on mpi4py implementation of MPI. This needs to be run through mpiexec (or mpirun). My Question is : How to run (and hopefully debug) a python script using mpiexec (or mpirun) from PyCharm directly? Running mpiexec…
Amr ALHOSSARY
  • 196
  • 1
  • 14
6
votes
1 answer

How do I find the number of cores available to MPI(4PY)?

How do I find the number of cores available to MPI(4PY)? Motivation My Python program spawns MPI instances hierarchically. The first spawn always happens and creates 4 instances. It doesn't make sense to increase this number due to the structure…
Bananach
  • 2,016
  • 26
  • 51
6
votes
1 answer

Why does Python hang when running mpirun within a subprocess?

I have a very simple MPI script using mpi4py # mpitest.py from mpi4py import MPI import time comm = MPI.COMM_WORLD rank = comm.Get_rank() time.sleep(100) If I run this normally with mpirun everything works fine $ mpirun --np 4 python mpitest.py …
MRocklin
  • 55,641
  • 23
  • 163
  • 235
6
votes
1 answer

How to gather arrays of unequal length with mpi4py

Desired behavior: I am trying to take a number of lists of varied lengths on different nodes, collect them together in one node, and have that master node place them in a set. This list is named rout_array in each node. Note that the elements in…
Santana Afton
  • 163
  • 1
  • 8
6
votes
3 answers

mpi4py hangs when trying to send large data

i've recently encountered a problem trying to share large data among several processors using the command 'send' from the mpi4py-library. Even a 1000x3 numpy float array is too large to be sent. Any ideas how to overcome this problem? thx in…
OD IUM
  • 1,555
  • 2
  • 16
  • 26
5
votes
1 answer

Possible buffer size limit in mpi4py Reduce()

The Setup I'm using mpi4py to element-wise reduce a numpy array across multiple processes. The idea is that the numpy arrays get summed element-wise, so that if I have two processes, and each has arrays: Rank 0: [1, 1, 1] Rank 1: [2, 3, 4] after…
carthurs
  • 553
  • 1
  • 5
  • 18
1
2 3
31 32