Introduction

Sparx has been parallelized using MyMPI (a MPI python binding), to use it you must first install MyMPI. The following instruction will guide through the installation of MyMPI. Note some systems may have MPI preinstalled, so the provided script may fail. For larger clusters it might be a good idea to consult a system manager.

Download MyMPI

Use this link MyMPI.tar.gz to download the file MyMPI.tar.gz

Unzip the package

Run the following command to unzip the file

tar -zxf MyMPI.tar.gz

This should create a new folder MyMPI under current directory. Inside this directory, there should be three files install_mpi.py, mympimodule.c, and documentation.h.

Run the installation script

1. Simple Installation

According your workstation you will probably need to install a couple of packages in order to compile (gcc, ld, ...):

Mac OS X
  • Xcode
  • Before install it, we may need to modify the numpyinc in install_mpi.py, as its default path may not be correct. For example, in my computer, I made the change as below:
  • vi install_mpi.py
    
    Change numpyinc to:  
    numpyinc="/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/numpy/core/include/numpy/"
    
    Debian/Ubuntu
  • build-essential
  • python2.5-dev
  • Fedora/Redhat/SUSE
  • python-devel
  • The script has several options, according if you have already download the packages required:

    Usage: install_mpi.py --cc=c_compiler --pythonroot --mpiroot
    
    Options:
      -h, --help            show this help message and exit
      --cc=CC               the compiler, default is gcc
      --pythonroot=PYTHONROOT
                            the directory containing python header files
      --mpiroot=MPIROOT     the directory containing mpi header and mpi libraries
      --force               if can't find some packages, install it forcefully
    

    Before install Please set your .bash_login file under the home directory as below:

    In Linux:

    export EMAN2DIR=$HOME/EMAN2
    export PATH=${EMAN2DIR}/bin:${PATH}
    export LD_LIBRARY_PATH=$HOME/EMAN2/lib:/usr/local/lib
    export PYTHONPATH=${EMAN2DIR}/lib:${EMAN2DIR}/bin:${PYTHONPATH}
    

    In Mac:

    export EMAN2DIR=$HOME/EMAN2
    export PATH=${EMAN2DIR}/bin:${PATH}
    export DYLD_LIBRARY_PATH=$HOME/EMAN2/lib:/usr/local/lib
    export PYTHONPATH=${EMAN2DIR}/lib:${EMAN2DIR}/bin:${PYTHONPATH}
    

    Install

    cd MyMPI
    ./install-mpi.py --force
    

    The installation script will try to find the necessary software:

    python-2.5.2
    openmpi-1.2.8
    

    If it cannot find either of them, it will try to download the software from internet and install it. The wrapper mympimodule.c is comipled against Numpy that is part of EMAN2/SPARX installation. If the system was placed in an unusual place, the installation script may fail to locate it, in which case the proper path has to be manually inserted into it.

    Note: If you are using a Mac OS, after the installation, please make sure to comment out the below line in the .bash_login file, otherwise, it's possible to get an error when one try to start Sparx.

    #export DYLD_LIBRARY_PATH=$HOME/EMAN2/lib:/usr/local/lib
    

    Test

    Start sparx and try import mpi. If it runs OK (without any error message) the installation is complete. if you got error message like the following:

    ImportError: No module named _numpy         
    

    This means you did not source ~/.bashrc or ~/.cshrc.

    MPI-installation (last edited 2010-07-30 20:10:51 by ranlin)