graphviper.graph_tools.process_with_mpi ======================================= .. py:module:: graphviper.graph_tools.process_with_mpi .. autoapi-nested-parse:: MPI execution backend for GraphVIPER map/reduce graphs. This is an *optional* alternative to the Dask backend (:func:`graphviper.graph_tools.generate_dask_workflow.generate_dask_workflow` followed by ``dask.compute``). The GraphVIPER architecture keeps the graph a plain, backend-agnostic description (``map`` / optional ``reduce`` /optional ``load`` stages produced by :func:`graphviper.graph_tools.map.map` and :func:`graphviper.graph_tools.reduce.reduce`); ``dask.delayed`` only ever appears inside ``generate_dask_workflow``. Because of that modularity the *same* graph can be executed by a different engine. This module provides an MPI engine so a caller can swap:: viper_graph = map(...) viper_graph = reduce(...) dask_graph = generate_dask_workflow(viper_graph) # Dask backend return_dict = dask.compute(dask_graph)[0] for:: viper_graph = map(...) viper_graph = reduce(...) return_dict = processes_with_mpi(viper_graph, cluster_setup) # MPI backend Execution model (manager / worker pool) --------------------------------------- The backend uses :class:`mpi4py.futures.MPIPoolExecutor` in the **static** manager-worker model. The program must therefore be launched as:: mpiexec -n python -m mpi4py.futures