MPICH2 MPI with GNU compilers


For my understanding of what MPI is &/or does, please refer to this post.

Compiling MPICH2 (v1.3.1) with GNU Compilers (GCC v4.1.2)

  1. mkdir $HOME/tmp/
  2. Download MPICH2 from the Argonne National Laboratory
  3. Save mpich2-1.3.1.tar.gz in $HOME/tmp/
  4. cd $HOME/tmp/
    tar -zxvpf mpich2-1.3.1.tar.gz
    cd mpich2-1.3.1
    ./configure --prefix=$HOME/mpich2/1.3.1/gcc/4.1.2 --enable-f77 --enable-f90modules
    make install
  5. Once the make install} process is successfully completed, add the following lines to $HOME/.bashrc:
    export MPICH2="$HOME/mpich2/1.3.1/gcc/4.1.2"
    export PATH="${PATH}:${MPICH2}/bin:${MPICH2}/sbin"
    export MANPATH="${MANPATH}:${MPICH2}/man"
    # Useful aliases/shortcuts
    alias mpicc="mpicc -g -Wall -lm"
    alias mpirun="mpirun -machinefile ${HOME}/machinefile"
  6. Save and quit $HOME/.bashrc
  7. Run the command. $HOME/.bashrc
  8. Run the command:hostname > $HOME/machinefile
  9. Parallel calculations can now be performed.

Refer to MPICH2 Guides for further details.

6 Replies to “MPICH2 MPI with GNU compilers”

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.