Parallel Programming CS 475
Popular in Course
Popular in ComputerScienence
This 21 page Class Notes was uploaded by Betty Kertzmann on Tuesday September 22, 2015. The Class Notes belongs to CS 475 at Colorado State University taught by Staff in Fall. Since its upload, it has received 4 views. For similar materials see /class/210189/cs-475-colorado-state-university in ComputerScienence at Colorado State University.
Reviews for Parallel Programming
Report this Material
What is Karma?
Karma is the currency of StudySoup.
You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!
Date Created: 09/22/15
The First pleasantly Parallel Program Kaustubh Gadkari CS 475 FA08 The Problem For what combination of inputs is the output 1 a Dikj i it w it i Li 2 it L The Solution Circuit satisfiability is NPcomplete No known polynomial time algorithm to solve general instances of the problem Try every input combination 16 inputs gt 216 65536 input combinations Partitioning Where is the parallelism In this problem the parallelism is natural One task gt one set of inputs All tasks are independent Therefore all tasks can be performed in parallel Partitioning contd Pleasantly parallel No channels between tasks I 35 E t Output ti J39 J Agglomeration and Mapping Properties of algorithm Fixed number of tasks No communication between tasks Time needed to complete each task is variable Consult decision tree fig 37 of text Map tasks to processors in a cyclic manner Cyclic Mapping Assume p processes Each process gets every pihpiece of work For n pieces of work 01 n 1 to be assigned to p processes Op p 1 the k piece of work is assigned to process k modulo p Cyclic Mapping contd For example n 20 and p 6 POO61218 P1171319 P228 14 P3 3 9 15 P44 1016 P55 11 17 Summary of Program Design Program will consider all 65536 input combinations Allocate combinations in a cyclic fashion to processes Each process individually checks its combinations If the circuit is satisfied the process prints the combination Tasks Login to bassinerscgov Try running the first pleasantly parallel program CS 475 Lab Introduction GNUPIot Doug Hains August 26 2009 CS 475 Lab General Information gt Instructor Doug Hains gt Office Room 435 lst cubicle on left gt Office Hours In CS Lab TBA gt Email dhains cscolostateedu gt Lab Times gt Wed 10001140 COMSC 225 CS 475 Lab Topics gt Useful tools gt Gnuplot LATEX etc gt NERSC machines gt Logging in running jobs etc gt Homework assignments E39nri 39stafit el39quotquotg QpenMP CS 475 Lab Grading Attending lab is required and will be part of your grade gt Most labs will end in an in Iab exercise gt You will get a passfail for completing each exercise gt Exercises do no have to be perfect but you must attend lab and put in an effort GNUPIot gt GNUPlot is a commanddriven interactive function plotting program gt Documentation gt http wwwgnuplotinfo gt man gnuplot gt help from within gnuplot s interactive shell Running GNUPlot gt To run GNUPlot on the lab machines 4 A 39 Q w 3 quot Am 4linr us lt r gt gnuplot gt You will be presented the GNUPlot shell prompt gt gnuplotgt 392 1 At this point you are ready to 1 22 issue commands to plot interactively Plotting a function Once you are at the shell prompt the plot function creates a 2D plot gt to plot the sine function with values in the range 757 5 gt plot 525 sinx gt To plot more than one function on the same graph using the same X values separate functions by a comma or use replot gt plot 55 sinx cosx gt or gt plot 525 sinx gt replot cosx gt All the built in functions can be found at httpwwwgnuplotinfodocsnode53html Reading data from a file plot datafile using xzy b b b V Enclose filename in single quotes Data should be separated by whitespace For example to plot the data from a file called knapsack18nodes dat gt plot knapsack18nodesdat If your data file has multiple columns and for example you want to use column 1 as the X value and 4 as the y value gt plot knapsack18nodesdat using 14 If you prefer to connect your data points with lines gt plot knapsack18nodesdat using 14 with lines To apply functions to the data use 1 to reference column 1 2 to reference column 2 etc gt plot knapsack18nodesdat using 11og2 Saving your plots to a file gt We will save our results to postscript for use with IATEX gt The commands to do must be issued before the plot commands for example gt set terminal postscript gt set output quotsinepsquot gt plot 55 sinx gt Will save the output of plot 5z5 sinx to the postscript file sineps Scripting with GNUPlot gt Once you have your plot commands working in the interactive shell you can save time by writing a script gt This automates graph generation gt For example to plot the knapsack data create a file knapsackgp with the following lines gt set terminal postscript gt set output quotknapsacktimingspsquot gt plot knapsack18nodesdat using 11og2 gt You can now execute these commands by entering gnuplot knapsackgp at the Linux shell assuming your data file is in the same directory ln Lab Exercise gt Copy the tile quotcs475providedlabsexercisedat gt Plot and examine the data gt Manipulate the data to get as close to a straight line as possible gt Interpret the results gt When you think you have the correct answer call me over and show me what you have
Are you sure you want to buy this material for
You're already Subscribed!
Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'