Package mpi4py

[hide private]
[frames] | no frames]

# Source Code for Package mpi4py

     1  # Author:  Lisandro Dalcin
     2  # Contact: dalcinl@gmail.com
     3  """
     4  This is the **MPI for Python** package.
     5
     6  What is *MPI*?
     7  ==============
     8
     9  The *Message Passing Interface*, is a standardized and portable
    10  message-passing system designed to function on a wide variety of
    11  parallel computers. The standard defines the syntax and semantics of
    12  library routines and allows users to write portable programs in the
    13  main scientific programming languages (Fortran, C, or C++). Since
    14  its release, the MPI specification has become the leading standard
    15  for message-passing libraries for parallel computers.
    16
    17  What is *MPI for Python*?
    18  =========================
    19
    20  *MPI for Python* provides MPI bindings for the Python programming
    21  language, allowing any Python program to exploit multiple processors.
    22  This package is constructed on top of the MPI-1/2 specifications and
    23  provides an object oriented interface which closely follows MPI-2 C++
    24  bindings.
    25  """
    26
    27  __version__   = '1.3'
    28  __author__    = 'Lisandro Dalcin'
    29  __credits__   = 'MPI Forum, MPICH Team, Open MPI Team.'
    30
    31  # --------------------------------------------------------------------
    32
    33  __all__ = ['MPI', 'MPE']
    34
    35  # --------------------------------------------------------------------
    36
    37 -def get_include():
    38      """
    39      Return the directory in the package that contains header files.
    40
    41      Extension modules that need to compile against mpi4py should use
    42      this function to locate the appropriate include directory. Using
    43      Python distutils (or perhaps NumPy distutils)::
    44
    45        import mpi4py
    46        Extension('extension_name', ...
    47                  include_dirs=[..., mpi4py.get_include()])
    48
    49      """
    50      from os.path import dirname, join
    51      return join(dirname(__file__), 'include')
    52
    53  # --------------------------------------------------------------------
    54
    55 -def get_config():
    56      """
    57      Return a dictionary with information about MPI.
    58      """
    59      from os.path import dirname, join
    60      try:
    61          from configparser import ConfigParser
    62      except ImportError:
    63          from ConfigParser import ConfigParser
    64      parser = ConfigParser()
    65      parser.read(join(dirname(__file__), 'mpi.cfg'))
    66      return dict(parser.items('mpi'))
    67
    68  # --------------------------------------------------------------------
    69