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.
- Read Compiling Parallel
Applications.
- 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:
- 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
- Check your own makefile against the solution,
either makeparc or makeparf.
- 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.