140 likes | 157 Views
Assignment 5. Using Paraguin to Create Parallel Programs. Hello World Program. Program is given to you You simply need to compile it and run it You will simply run it on your Ubuntu virtual machine Produce documentation of compiling and running the program.
E N D
Assignment 5 Using Paraguin to Create Parallel Programs
Hello World Program • Program is given to you • You simply need to compile it and run it • You will simply run it on your Ubuntu virtual machine • Produce documentation of compiling and running the program
Compiling using the Paraguin submission page • http://babbage.cis.uncw.edu/~cferner/compoptions.html
Compiling using the Paraguin submission page Browse for a source file on your local machine. Leave default options. Submit for Compilation.
Compiling using the Paraguin submission page • Download the Zip file which contains: • Resulting source file “.out.c” • Compiler Warning/Error/Warning messages Clean up your files or the subsequent zip file will contain all the old files.
Cluster at UNCW $ ls hello.c.files.zip $ unzip hello.c.files.zip Archive: hello.c.files.zip extracting: hello.c.err.txt inflating: hello.out.c $ cat hello.c.err.txt $ mpicc hello.out.c –o hello.out $ mpirun –np 4 hello.out Error file is empty Compiling Running
Matrix Multiplication • Matrix Multiplication Includes: • Use the Matrix Addition program on the slides as a template. • You’ll need to: • Broadcast the b matrix instead of scattering it • Change the computation loop to do matrix multiplication instead of addition
Matrix Multiplication • Compile using the Paraguin submission page and run on your Virtual Box as with hello world • May want to start with 5x5 matrices where you can verify the answers • Next go to input2x512x512Doubles • Redirect output to a file: • mpirun –np # matrix.out input2x512x512Doubles > output • Use diff command to compare results with output512x512mult
Matrix Multiplication • Upload the .out.c file to one of the clusters • Compile with mpicc • Run (use the job scheduler if using UNCW cluster) on 1,4,8,12,16,20,24,28,32 processors (or to the largest number you can) • Record elapse times • Produce a graph of the execution time and speedup as a function of the number of processors
Heat Distribution • Using the stencil pattern, model the distribution of heat in a room that has a fireplace along one wall
Producing a Visual of the Output Produced with X11 Graphics Produced with Excel
Producing a Visual of the Output • See the document http://coitweb.uncc.edu/~abw/ITCS4145F13/Assignments/X11GraphicsNotes.pdf for help with creating graphics using X11. • The Excel Graph is a surface plot
Monte Carlo Estimation of π(required for Graduates/optional for Undergraduates) • Scatter/Gather pattern, but uses broadcast and reduce • This is not a workflow pattern • π can also be estimated by integrating the function , but you aren’t asked to do this.