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

  Prepare program to check the syntax of the english language

Determine the form of the output dependent on the coefficients being input. Print and evaluate with peers in class."

  Raising a number n to a power p is the same as multiplying n

Raising a number n to a power p is the same as multiplying n by itself p times. Write a function called power () that takes a double value for n and an int value for p and returns the result as double value. Use a default argument of 2for p, so that ..

  Convert the following infix expressions to postfix

Convert the following infix expressions to postfix

  Program that stores information for date-time objects

Derive class WeekDay from class DateTime such that WeekDay::display() will display local date time using values from the parameters and the corresponding weekday.

  Displays your name in the titlebar of the browser

Lab Assignment 1: Beginning HTML Due Week 2 and worth 40 points Deliverable: One (1) Web page (.htm) Follow the directions below to complete Lab Assignment 1: Using Notepad, or a similar text editor, create an .htm file that: displays your name an..

  Implementing a client

The CSE3300 server for this exercise waits to receive messages on UDP port 3300 of tao.ite.uconn.edu (IP address 137.99.11.9).1 It iteratively receives a request datagram containing a 32-bit integer representing a social security number

  You will implement a simplified version of the set class

you will implement a simplified version of the set class. you must implement all functions defined in the provided file

  What output will be produced if the exception is thrown

What output will be produced if the exception is thrown with the constructor with parameters with the following actual parameter?

  Quiz on c coding

Which of the following statements is incorrect

  The counter each time it''s clicked

Write a simple script that contains a button and a counter in a div. The button's event handler should increment the counter each time it's clicked.

  Convert infix to postfix expression

For every postfix expression there exists a corresponding and uniquely defined infix expression that evaluates to the same number.

  Using array subscript notation

Using array subscript notation, base/offset notation with the array name as the pointer, array notation with  vPtr , and pointer/offset notation with  vPtr , add 3 to the value in the 3 rd element and display that number. (Do not modify the value in ..

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