DOC PREVIEW
UW-Madison ME 964 - ME 964 Assignment 1

This preview shows page 1 out of 2 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Version: 1/13/2019ME964High Performance Computing for Engineering ApplicationsAssignment 1Date Assigned: January 25, 2011Date Due: February 1, 20111. In a PowerPoint file, compile a list of your best three coding practices. In one ortwo sentences comment on each of them. If necessary, use code snippets to make yourpoint across. Organize this material as a pptx presentation based on the templateprovided at http://sbel.wisc.edu/Courses/ME964/2008/Templates/genericPresentation.ppt.You might find these references useful: - http://en.wikibooks.org/wiki/C%2B%2B_Programming/Code_Style- http://en.wikipedia.org/wiki/Hungarian_notation2. Write a C program that reads a string that is provided as a command lineargument. Pass the string to a function that you write. Within the function count the totalnumber of characters in the string excluding the null character. Return this value andprint it out in the main program.3. Write a C program that takes as an argument an input file, it opens the file, readsall the integer numbers (no more than 1,000,000 of them) and sorts them from thesmallest to the largest. The input file contains one integer per line.a. Without consulting any online source or book, use an algorithm that youare familiar with to generate a program that prints out four things: (i) thenumber of integers read in, (ii) the smallest integer read in, (iii) the largestone, and (iv) the amount of time in milliseconds (ms) required to performa sort on the array of integers.b. In order to gauge the performance of your sort algorithm, either consult abook or online source, or use a library that has a sort functionimplemented to sort the same array as at a) above to verify your answer.Of interest is also the amount of time it required this second approach tosort the integersc. To understand the behavior of the two approaches at a) and b) above, runthem on a set of nine input files containing 210, 211,…, 219 integersgenerated randomly. Record the time in ms and run a standard regressionto approximate the curves that give ordering time versus number ofintegers for the two algorithms. Provide the plot in png format andindicate the regression function.1Version: 1/13/20194. This problem is identical to Problem 3, except that instead of the sorting operationyou have to perform an exclusive scan operation. For a definition of the scan operationread pages 1 through 3 of the Blelloch 1990 paper available on the class website. Yourprogram should be able to take one input argument which is the name of the asci filestoring the integers. The input file contains one integer per line.a. Implement an algorithm that executes an exclusive scan operation andprints out three things: (i) the number of integers read in, (ii) the last entryin the scanned array, and (iii) the amount of time in milliseconds (ms)required to perform the scan operation.b. Run an order analysis much like you did in for 3.c above this time only foryour code. Test your code with an input file with 25, 26,…, 212 integersbetween -10 and 10 randomly generated. Produce the plot and provide theregression function.FURTHER NOTES ON YOUR HOMEWORK:- If you use Developer Studio, provide projects for problems 2 through Error:Reference source not found. If you use Linux, provide a makefile to generate theexecutables (no support for building under Linux).- It doesn’t really matter how slow your sorting algorithm runs in Problem 3. Thepoint there is to understand how difficult it is to design and implement a fastsorting algorithm.- Email a zipped directory containing all your work, along with a readme.txt filethat explains it all to [email protected] no later than 11:59 PM on the duedate. NOTE: the name of the zipped directory should be YOUR LAST NAME,like negrutHW1.zip - You are encouraged to use the ME964 Forum for exchanging ideas or sharinglinks to helpful information, but no posting of the solutions


View Full Document

UW-Madison ME 964 - ME 964 Assignment 1

Documents in this Course
Load more
Download ME 964 Assignment 1
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view ME 964 Assignment 1 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view ME 964 Assignment 1 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?