Cisco Logo


High Performance Computing Networking

There’s been some discussion of Big New Features in MPI-3 recently (and more are coming!).  But today, I want to talk about a little new feature.  Something small, but still useful.

I’m talking about a new function named MPI_GET_LIBRARY_VERSION.

Its only purpose in life is to shed some light on to the implementation that you’re using.  It returns a simple string, and is intended to be human-readable (vs. being machine-parseable). The format of the string is not mandated, but it is assumed that MPI implementations will include reasonably detailed information about their specific version.

This information is useful in multiple ways:

Note that MPI_GET_LIBRARY_VERSION is a little different than running a standalone debugging/diagnostic tool from an MPI implementation (e.g., Open MPI provides the ompi_info command). MPI_GET_LIBRARY_VERSION shows the MPI implementation that you’re using at run time; it shows exactly what is set in your MPI job’s environment (which may — accidentally — be different than your diagnostic commands’ environments).

For example, Open MPI’s implementation of MPI_GET_LIBRARY_VERSION returns a string that looks like this:

Open MPI v1.7a1, package: Open MPI jsquyres@svbu-mpi.cisco.com Distribution, ident: 1.7a1r26051M, repo rev: r26051M, Unreleased developer copy

This string clearly indicates that this is an unreleased developer build, and gives all kinds of specific information about this particular build of Open MPI.

Indeed, you might want to put a call to MPI_GET_LIBRARY_VERSION at the beginning of all your MPI applications, just for diagnostic / verification purposes.  Perhaps something like this (with apologies for horrid blog code formatting):

int main(int argc, char* argv) {
    int len;
    char mpi_lib_ver[MPI_MAX_LIBRARY_VERSION_STRING];

    MPI_Init(NULL, NULL);
    MPI_Get_library_version(mpi_lib_ver, &len);
    printf("MPI library version: %s\n", mpi_lib_ver);
    /* ...rest of your application... */

You never know when you’ll need to know that information. So just include it in all your applications, and it may save you many hours of frustration someday when that printf alerts you to the fact that your LD_LIBRARY_PATH is set incorrectly, and you’re inadvertently using a different MPI library than you intended.

In an effort to keep conversations fresh, Cisco Blogs closes comments after 90 days. Please visit the Cisco Blogs hub page for the latest content.

1 Comments.


Trackbacks and Pingbacks:

  1. Return to Countries/Regions
  2. Return to Home
  1. All High Performance Computing Networking
  2. All Security
  3. Return to Home