-- MikeGore - 05 Nov 2012


  • openmpi allows programs to be run cooperatively with other users and share resources. It can trivially be extended across several machines.



  • aptitude install libopenmpi-dev libopenmpi1.3 openmpi-bin openmpi-common openmp-doc

Example Code

Note: Source files for this example are attached to this TWIKI
  • Or asimov:/coregroup1/images/ubuntu-scripts/cluster/mpi-code

Example Files

  • We assume the files live in /opt/mpi-code
    • CHange mpi-test to modify this assumption
  • mpi-test - Script to compile an mpi-hello.c
    • references /opt/mpi-code
  • mpi-hello - mpi-hello binary
  • mpi-hello.c - source file for our test
  • mpi-nodes.conf - mpi node configuration file to use


  • There is a C program called mpi-hello.c and a script called mpi-test that runs the program on the computers and cores defined in mpi-nodes.conf
  • mpi-test test script options: * -loadbalance which means spreadevenly across all cpu/nodes * -np 4 which is the number of processes in total to run.

Example Run Results

  • I ran the test on swag.cs - a machine has 8 cores.
cat mpi-nodes.conf
swag.cs slots=8

cd /opt/mpi-code 
Process 0 on swag.cs out of 4
Process 1 on swag.cs out of 4
Process 2 on swag.cs out of 4
Process 3 on swag.cs out of 4
Topic attachments
I Attachment History Action Size Date Who Comment
C source code filec mpi-hello.c r1 manage 0.4 K 2012-11-05 - 11:29 MikeGore OpenMPI test source file
Unknown file formatconf mpi-nodes.conf r1 manage 0.1 K 2012-11-05 - 11:29 MikeGore OpenMPI configuration file
Unknown file formatext mpi-test r1 manage 0.4 K 2012-11-05 - 11:30 MikeGore OpenMPI test script to compile and run this example
Edit | Attach | Watch | Print version | History: r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r1 - 2012-11-05 - MikeGore
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback