Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Task: Try to write two pseudo-codes for the tree-structural global sum, one for a shared memory setting and the other for a distributed- memory setting
Task: Try to write two pseudo-codes for the tree-structural global sum, one for a shared memory setting and the other for a distributed- memory setting First consider how this might be done in a shared-memory setting, Then consider how this might be done in a distributed-memory setting. In the shared-memory setting, which variables are shared and which are private? 2. Suppose we have a program that generates large quantities of floating point data that it stores in an array. In order to get some feel for the distribution of the data, we can make a histogram of the data Recall that to make a histogram, we simply divide the range of the data up into equal sized subintervals, or bins, determine the number of measurements in each bin, and plot a bar graph showing the relative sizes of the bins. As a very small example, suppose our data are 1.3, 2.9, 0.4, 0.3, 1.3, 4.4, 1.7.0.4, 3.2, 0.3, 4.9, 2.4, 3.1, 4.4, 3.9, 0.4, 4.2, 4.5, 4.9.0.9 Then the data lie in the range 0-5, and if we choose to have five bins, the histogram might look something like Task: Write a serial program that solves the histogram problem, Given the following inputs, output an array containing the number of elements of data that lie in each bin: - the number of measurements, data_count - the array of data_count floats, data; - the minimum value, min_meas: - the maximum value,max meas - the number of bins, bin_count. Note: You just need to display the frequency in the text format. No plot is needed. Grading rubrics: Question Global sum in a shared-memory setting Assessment Items Points pseudo-code 10 Function goal is reached Coordination among threads to obtain a global sum Tree structure implementation on the thread . coordination pseudo-code for distributed-memory setting 10 Global sum in a distributed-memory setting 5 Function goal is reached Coordination among threads to obtain a global sum Tree structure implementation on the thread coordination Coding Function goal is reached (a mistake about three points) Histogram
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started