Create two new arrays to hold the results of calculations

Assignment Help C/C++ Programming
Reference no: EM131317908

Assessment Task:

This coursework will allow you to investigate some of the issues involved in writing threaded programs.

You are to write a series of simple programs in C/C++ that will run under Linux, to illustrate how multithreading may be used to partition a processing task. Designs should be presented and all code must be fully commented and handed in as part of the deliverable.

Consider a 2 D data array whose contents need to be processed.

The array consists of values representing the height of a terrain at that point.

Create two new arrays to hold the results of calculations.

Result array one is to hold the Euclidean distance between each point and the next point in the row.

Result array two is to hold the angle of the slope between the point and its neighbour in the row calculated using arcsin.

1. Set up the first array and write a sequential program that accesses the data array and populates the result arrays. Provide evidence that the calculations used are correct.

2. Create a second program that it is still sequential but accesses the data array by a series of calls to a single function. Each call to that function will process a number of rows of the array as defined by a parameter passed to the function.

3. Write a third version of the program that will allow the processing to be carried out in one or more threads. Each thread should access a different set of rows of the array as in 2. above so that locking etc. is not an issue. Your program must be able to run with different numbers of threads.

4. Investigate how you might obtain run time information for the implementations and report on run times of each of your implementations.

Experiment with your implementations on machines with different numbers of processors/cores and explain all results.

5. Write a conclusion to your investigations. This should include

• an overview of threads and processes
• expected gains in threading in a typical application
• expected link between numbers of cores/processes and performance
• narrative regarding your results and development include short discussion on how code would need to change if locking were required

6. You may need to do a short demonstration of your code in a lab session or at some mutually agreed time. This is a mandatory part of the assessment.

Submission Instructions

The report should be a single document, word processed in Word format, and it should present your findings clearly and concisely. Take care that code is neatly laid out in the report - correctly formatted and with all code in Courier New font.

You must submit only an electronic version of the coursework (via Blackboard) which may be submitted to a plagiarism detection system.

Reference no: EM131317908

Questions Cloud

Explain what depreciation-cash flow-operating cash flow : Explain what depreciation, cash flow, operating cash flow and NPV are and how they interact with business decisions. Explain why these financial concepts are important for you as an employee, owner, or investor.
Is the bank liable for the janitor''s negligence : Is the bank liable for the janitor's negligence? (Be sure to go through all the elements.) Additionally, note that under the doctrine of respondeat superior the bank WILL be liable for any potential negligence of the janitor employee?
Construct a concluding statement to end the essay : Write an introductory paragraph that provides a brief overview of the company featured in the video. Briefly describe the possessions of the organisation on the bases of its core values, technological intervention and innovation
What is the pretax cost of debt : a. What is the pretax cost of debt? b. What is the aftertax cost of debt? c. Which is more relevant, the pretax or the aftertax cost of debt?
Create two new arrays to hold the results of calculations : Create two new arrays to hold the results of calculations. Result array one is to hold the Euclidean distance between each point and the next point in the row.
Expected one-year rate during year 5 : Suppose the current rate on a 5-year Treasury is 4.5%, the current rate on a 4-year Treasury is 4.25%, and the one-year rate is 2.84%.  Using the unbiased expectations theory, what is the expected one-year rate during year 5, E(5r1)?
Bond using the straight line method : 1). Please record the journal entry for the timely interest payment of the bond using the straight line method that was made on June 30th. 2). Please record the journal entry for the timely interest payment of the bond using the straight line met..
Does lisa have a defense : Lisa and Danny are neighbors that live on Guerrero Street. Fifteen years ago Lisa built a gazebo. She frequently used the gazebo, but she was not aware that actually the gazebo was on property belonging to Danny. A month after the gazebo was built..
What is the after-tax cost of debt : Question 1. A firm is considering a $300,000 debt issue. Their corporate tax rate is 34%. This long-term issue will pay a coupon rate of 5.6%. What is the after-tax cost of this debt?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a program that contains a main function

Write a program that contains a main function and three other functions that will return various attribute information about an array of floating point

  Show the items by zone or location within the store

There is other information. Some people shop on a budget so they need the price and the sale price. Use an array or vector to hold the list of items. The display should show the items by zone or location within the store. (Display the output by loc..

  Program that uses non recursive function to search

Write a C program that uses non recursive function to search for a key value in a given sorted list of integers usingt Binary search

  Inventory items stored in Sudbury

Give the details of all suppliers in the Sault Ste Marie, list all inventory items with a quantity less than 100 units and list all the inventory items stored in Sudbury

  Performs a binary search instead of a linear search.

Modify the following program so it performs a binary search instead of a linear search. Use the selection sort algorithm to sort the array before the binary search is performed.

  Write a program which initialize an integer array

Write a program which performs the tasks - return the control to main( )and print the new array elements in main.

  Create a custom python module

Write a program named program51.py that defines a value-returning function named cuber that returns both the surface area and volume of a cube - Create a custom Python module named tempconvert.py. This module must contain two functions: one that c..

  Use a loop in main to efficiently handle all three persons

Plan and finish writing the main program, and all the functions, including a constructor. Use a loop in main to efficiently handle all three persons' data.

  Calculation of mortgage interest rates

Instruction of pointers and the calculation of mortgage interest rates.

  Calculate the number of elapsed days

Write a function that calculates the number of elapsed days between two dates. For example the days between Feb 3, 1970 and June 21, 1980? Becareful for the Leap year imediately.

  Questionnbsp the template method pattern and the strategy

questionnbsp the template method pattern and the strategy pattern both abstract some computation in the form of

  C++ program for food purchases at the baseball stadium

Write a menu-driven C++ program for food purchases at the baseball stadium's restaurant. The main program will loop allowing the user to select food items from the menu adding each item to the bill, terminating when the user selects the "End order" i..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd