Skip to main content

more options


Setup for Parallel

Please use the "Switch to Details" button to return to the lab instructions.

In the previous lab section a serial program was converted into a parallel one by adding MPI calls.  In this section, we will compile the program with MPI calls and link it against an MPI library.

Prerequisites:

Read Compiling Parallel Applications.  If you have not yet done lab section "Logon and Copy Files", do it now.

  1. Read Compiling Parallel Applications.
  2. Use the supplied code karp.parallel.c or karp.parallel.f, or use the source code karp.c or karp.f as modified in the previous section.  If you use your code, rename it to match the supplied code, e.g. mv karp.* karp.parallel.* The files should be in your directory $HOME/lab or ~/lab.

Instructions:

  1. Create a makefile that links to the mpich library.
    • Reference the mpich library
      -lmpich
    • Name the source code karp.parallel.c or karp.parallel.f
    • Name the executable karp.parallel
  2. Check your own makefile against the solution, either makeparc or makeparf.
  3. Run the makefile on one of the login nodes
    C/C++: make -f makeparc
    Fortran: make -f makeparf
    It should produce an executable named karp.parallel

Results:

When you are done with this section, you should have a parallel program with MPI calls ready to run.