Running MPI Programs
LAM MPI version, Fall 2003
- Create a "host file":
- name this file "lamhosts", for instance:
yourcomputer.tjhsst.edu
- Normally you would list other computers to connect with,
because of security issues, we are currently limited to only one workstation
- Enable the LAM Mpi system:
- lamboot -v lamhosts
("lamhosts" is the name of your hostfile from #1 above)
- Compiling your MPI program:
- C version: mpicc.lam -o filename filename.c
(the executable file will be "filename")
- C++ version: mpiCC.lam -o filename filename.cpp
(the executable file will be "filename")
- NOTE: cin DOES NOT WORK, use scanf
- For MATH FUNCTIONS - use "-lm" on the command line
(this loads the math library)
- Run the executable file:
- IMPORTANT - when you're done, MAKE SURE TO HALT MPI:
- lamhalt
- otherwise you leave extra processes running on your workstation!
MPI Resources