IPython MPI with Machinefile

I want to use the capabilities of IPython MPI with distributed computing. Namely, I would like MPI to start with a machine file, so I can add several machines.

EDIT:

I forgot to enable my configuration.

Configuration

~/.ipython/profile_default/ipcluster_config.py
# The command line arguments to pass to mpiexec.                                
c.MPILauncher.mpi_args = ["-machinefile ~/.ipython/profile_default/machinefile"]


# The mpiexec command to use in starting the process.                           
c.MPILauncher.mpi_cmd = ['mpiexec']

Bash Execution

$ dacluster start -n20
2015-06-10 16:16:46.661 [IPClusterStart] Starting ipcluster with [daemon=False]
2015-06-10 16:16:46.661 [IPClusterStart] Creating pid file: /home/aidan/.ipython/profile_default/pid/ipcluster.pid
2015-06-10 16:16:46.662 [IPClusterStart] Starting Controller with MPI
2015-06-10 16:16:46.700 [IPClusterStart] ERROR | IPython cluster: stopping
2015-06-10 16:16:47.667 [IPClusterStart] Starting 20 Engines with MPIEngineSetLauncher
2015-06-10 16:16:49.701 [IPClusterStart] Removing pid file: /home/aidan/.ipython/profile_default/pid/ipcluster.pid

Machinefile

~/.ipython/profile_default/machinefile

localhost slots=8
aidan-slave slots=16

I could mention that it works when I run

mpiexec -machinefile machinefile mpi_hello

And the output of this execution includes host names, so I’m sure that it really extends. Plus I look from above.

Thanks,

0
source share
1 answer

I think I asked too soon. the problem was on the bottom line

c.MPILauncher.mpi_args = ["-machinefile ~/.ipython/profile_default/machinefile"]

It was supposed to be divided into spaces with an absolute path.

c.MPILauncher.mpi_args = ["-machinefile", "/home/aidan/.ipython/profile_default/machinefile"]

, -. , BASH. MPI ( , helpan-slave). dacluster, , python, IPython, .

, DistArray, , pi_montecarlo, . , , 736 context.py globalapi distarray.

def _execute(self, lines, targets):
    return self.view.execute(lines, targets=targets, block=True)

, MPI, , , . , .

0

Source: https://habr.com/ru/post/1615083/


All Articles