I often get questions from those who are just starting with MPI; they want to know common things such as:
This will be the first blog entry of several that attempts to guide MPI newbies down the parallelization path.
There's a few generic steps:
1. Get a parallel computing system
There are many, many kinds of parallel computing systems; they range from a single laptop to high-end, dedicated supercomputers.
For the purposes of this blog entry, let's assume that you have a newly-installed cluster of Linux-based hosts. Hopefully you also have some kind of cluster management system - it's very painful, and doesn't scale at all, to try to maintain each individual host! But this is outside the scope of this blog entry.
2. Install MPI
Once you have a newly-installed Linux cluster, you need to install MPI on it. First, pick an MPI implementation. There are two notable open source MPI implementations (proprietary, closed source implementations are also available - Google around):
All of these MPI implementations have their own strengths and drawbacks. Many HPC clusters have multiple MPI implementations installed and let their users choose which one to use.
Sidenote: most HPC-oriented clusters have some kind of network file storage. NFS server software is included in all Linux distributions, and isn't that hard to setup (Google around, you'll find lots of tutorials). To be clear, you don'thaveto have your favorite network filesystems installed (e.g., NFS), but it certainly makes your cluster aloteasier to use.
In general, your MPI installation needs to be availableon every host in your cluster. "Available" typically means one of two things:
Approach#1 has the advantage of not using any network bandwidth for the filesystem when you launch an MPI application. However:
For my mid-sized clusters (under 256 hosts or so), I use network filesystem installs. This lets me upgrade and/or tweak the MPI implementation whenever I want to - whatever change I make is instantly available across the whole cluster.
Regardless of which approach you use, you almost certainly want to ensure that the MPI implementation files are available in the same location on each host. Some common examples (I use Open MPI because of my obvious bias as an Open MPI developer, but the same general principle applies to all MPI installations):
/opt/openmpi
on all hosts/cluster/apps/openmpi
on every hostAll of these are valid possibilities.
3. Setup your environment
All MPI implementations have both system administrator- and user-tweakable settings. Many of these have to do with performance, and are unique to each MPI implementation.
But two things are common to most MPI implementations:
/opt/openmpi/bin
to the PATH setting in your$HOME/.basrhc
file (assuming Open MPI is installed in/opt/openmpi
), and also add/opt/openmpi/lib
to your LD_LIBRARY_PATH. Two common mistakes that people make:ssh REMOTE_HOST env | grep PATH| grep PATH
" and see what your PATH is set to on the remote host. If the MPI path is not included in there, check your shell startup files.Yes, this is a lot of information, and most of what I said here is a fairly high-level. Hopefully, this will guide you in the right direction to get this all setup.
A future blog entry will continue down the list of MPI newbie tasks and talk about how to build / compile / link MPI applications.