Virginia Tech
Advanced Research Computing
  • Home
  • About ARC@VT
  • Research
  • Services & Support
  • Systems & Resources
    • System X
    • SGI Systems
      •      Accounts
      •      New Accounts
      •      Usage Overview
      •      Help Requests
    • SGI Software
      •      Applications
      •      Queuing System
      •      Compilers
      •      Subroutine Libraries
      •      Debuggers
    • SGI Parallel Programming
      •      Auto-Parallel
      •      SCSL Subroutines
      •      OpenMP
      •      MPI Programming
    • Sun Systems
    • Visualization
  • Application Software
  • Web Site Map

Parallel Programming on SGI Systems
Using MPI
(Message Passing Interface)

For general information on MPI, see MPI Overview.


The Message Passing Interface (MPI) provides platform and language independent communication between nodes of parallel computing systems.  For detailed information about the MPI standard, see

    http://www.mcs.anl.gov/mpi.

For a listing of MPI commands with links to their descriptions, see:

    http://www-unix.mcs.anl.gov/mpi/www/

For SGI's documentation regarding use of MPI on SGI ALTIX systems, see: SGI Message Passing Toolkit: MPI Programmer's Manual for Linux

For examples of a simple MPI program illustrating some commonly used MPI calls, see:

   Hello World in C
   Hello World in Fortran

Compiling an Existing MPI Program

For a first exercise, it is suggested that you compile and run the example Fortran and C programs above using the procedures listed below.

Compiling a Fortran Program: You can compile Fortran programs containing MPI library calls using the  "ifort"  command. For example, to compile the file my_prog.f and create the output program my_prog containing appropriate links to the MPI libraries, enter:

    ifort  -o  my_prog   myprog.f  -lmpi
Compiling a C Program: You can compile C programs containing MPI library calls using the  "mpcc"  command. For example, to compile the file my_prog.f and create the output program my_prog containing appropriate links to the MPI libraries, enter:
    icc  -o  my_prog   myprog.c   -lmpi

Executing Compiled Parallel Code

The MPI command  "mpirun"  can be be used to submit a parallel job for interactive execution. For example, to sumit the compiled program my_prog to the parallel environment and use four processors, enter:

    mpirun  -np  4  my_prog

Note:  If you receive the message "couldn't allocate nodes for parallel execution. Exiting...", then there are not a sufficient number of nodes currently available to execute your parallel job in the interactive environment.

For additional information on using the mpirun command, enter:

    man  mpirun



VT-ARC Privacy Statement | Contact Us
VT-ARC is a Unit within the Office of the Vice President of Information Technology
© 2007-2008 Virginia Polytechnic Institute and State University
Principles of Community | Acceptable Use Policy | Accessibility | Equal Opportunity
Website Feedback   -   Page Last Updated:  January 11th, 2008