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

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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