CSCI 3366 (Parallel and Distributed Processing):
Sample Programs
Disclaimer: Code linked from this page is intended as a
cleaned-up and commented version of examples from class.
Many programs could be further improved with
regard to functionality or design, but then they would
no longer be as close to what we did in class.
OpenMP
- My notes
Using OpenMP on the Linux Lab Machines.
- Sample makefile Makefile.
(See the Note About
Makefiles below.)
- ZIP archive containing all examples
OpenMP.zip.
- "Hello, world" programs:
hello.c,
hello++.cpp.
- Simple example of synchronization among threads:
- Utility functions for use with remaining examples:
timer.h,
- Programs to compute pi by numerical integration:
- Programs for heat diffusion example:
- Generic master/worker programs:
- Programs for Mandelbrot example:
- Programs for matrix multiplication example:
MPI
- My notes
Using MPI on the Linux Lab Machines.
- Sample makefile Makefile.
(See the Note About
Makefiles below.)
- ZIP archive containing all examples
MPI.zip.
- Sample script to run program
run-pgm.
Uses list of machine names in
Hosts-pandora.
- "Hello, world" programs:
hello.c.
hello++.cpp.
- "Hello, world" program with command-line arguments and hostname:
fancy-hello.c.
- Utility functions for use with remaining examples:
utility.h,
timer.h,
- Trivial example of send/receive:
send-recv.c.
- Simple send/receive with timing:
time-msg.c.
- Programs to compute pi by numerical integration:
- Programs for heat diffusion example:
- Programs demonstrating various ways to communicate:
- Generic master/worker programs:
- Programs for Mandelbrot example:
- Programs for matrix multiplication example:
- Programs for matrix multiplication example:
Java
OpenCL
POSIX Threads (P-Threads)
- Sample makefile Makefile.
(See the Note About
Makefiles below.)
- ZIP archive containing all examples
P-Threads.zip.
- "Hello, world" program:
hello.c.
- Simple example of synchronization among threads:
- Utility functions for use with remaining examples:
timer.h,
- Programs to compute pi by numerical integration:
C++11 Threads
- Sample makefile Makefile.
(See the Note About
Makefiles below.)
- ZIP archive containing all examples
C++Threads.zip.
- "Hello, world" program:
hello.cpp.
- Simple example of synchronization among threads:
- Utility functions for use with remaining examples:
timer.h,
- Programs to compute pi by numerical integration:
To obtain a makefile, use your browser's download function;
cutting and pasting will likely turn the tabs in the makefile
into spaces and cause it to not work.
Put the makefile in the directory in which you want to
compile.
All the makefiles linked from this page begin with
brief documentation on their use (the "usage examples").
Other files
- Script to mail files for homework submission
mail-files.
Instructions for usage
here.