mpi4py Python (environment setup) @ 071's blog :: 隨意窩 Xuite日誌
    1. 沒有新回應!
  • 201805241336mpi4py Python (environment setup)

    1. download openmpi-3.1.0.tar.gz from https://www.open-mpi.org
    tar xzvf openmpi-3.1.0.tar.gz
    mkdir openmpi
    cd openmpi-3.1.0
    ./configure --prefix=/home/nexcom/python/openmpi
    make all
    make install

    sudo vi /home/nexcom/.profile
    export PATH=/home/nexcom/python/openmpi/bin:$PATH
    export LD_LIBRARY=/home/nexcom/python/openmpi/lib:$LD_LIBRARY

    source /home/nexcom/.profile

    2. download mpi4py-3.0.0.tar.gz from https://pypi.org/project/mpi4py/
    sudo apt-get install python-dev
    // you will need install python-dev, or compile mpi4py will error with 'Python.h' file not found

    tar xzvf mpi4py-3.0.0.tar.gz
    cd mpi4py-3.0.0

    vi mpi.cfg
    # Open MPI example
    # ----------------
    [openmpi]
    #mpi_dir = /home/devel/mpi/openmpi-1.8.6
    mpi_dir = /home/nexcom/python/openmpi
    mpicc = %(mpi_dir)s/bin/mpicc
    mpicxx = %(mpi_dir)s/bin/mpicxx
    #include_dirs = %(mpi_dir)s/include
    #libraries = mpi
    library_dirs = %(mpi_dir)s/libi
    runtime_library_dirs = %(library_dirs)

    python setup.py install

    3. test if mpi work?
    mpirun -np 4 python anypthon_program.py

    CGI jpeg server push|日誌首頁|recvfrom with timeout上一篇CGI jpeg server push下一篇recvfrom with timeout
    回應