# Path: modred/py2to3.py
# def run_script(path, globals=None, locals=None):
# def print_stdout(msg):
# def print_stderr(msg):
# def print_msg(msg, output_channel='stdout'):


import socket
import codecs
import numpy as np
from .py2to3 import range
    from mpi4py import MPI
    from .reductions import Intracomm

def get_rank():
    """Returns rank of this processor/MPI worker."""
    return _rank


def get_num_procs():
    """Returns number of processors (currently same as number of MPI
    workers)."""
    return get_num_MPI_workers()


def is_distributed():
    """Returns True if there is more than one processor/MPI worker and mpi4py
    was imported properly."""
    return _is_distributed


def is_rank_zero():
    """Returns True if rank is zero, False if not."""
    return _rank == 0


def barrier():
    """Wrapper for Barrier(); forces all processors/MPI workers to
    synchronize."""
    if _is_distributed:
        comm.Barrier()



# Path: modred/py2to3.py
# def run_script(path, globals=None, locals=None):
# def print_stdout(msg):
# def print_stderr(msg):
# def print_msg(msg, output_channel='stdout'):


# Path: modred/parallel.py
import socket
import codecs
import numpy as np
from .py2to3 import range
    from mpi4py import MPI
    from .reductions import Intracomm


def get_rank():
    """Returns rank of this processor/MPI worker."""
    return _rank


def get_num_procs():
    """Returns number of processors (currently same as number of MPI
    workers)."""
    return get_num_MPI_workers()


def is_distributed():
    """Returns True if there is more than one processor/MPI worker and mpi4py
    was imported properly."""
    return _is_distributed


def is_rank_zero():
    """Returns True if rank is zero, False if not."""
    return _rank == 0


def barrier():
    """Wrapper for Barrier(); forces all processors/MPI workers to
    synchronize."""
    if _is_distributed:
        comm.Barrier()



def print_from_rank_zero(msg, output_channel='stdout'):