M - algorithm corrections, C/C++ Programming

Of course it is C[i] = A[i] + B[i].It was a typing mistake,never mind. You just understand the concept.

27-1 b.

for grain-size=1

n=A.length

grain-size=1

r=n

for k=0 to n-1

spawn ADD-SUBARRAY(A,B,C,k+1,min((k+1),n)

)

sync

This will make n sub branches all to be executed in parallel and finally sync instruction will cause the flow of execution to be synchronized at that point.

27-1 C.

x1 is the constant to represent computational cost of spawning a new process. This step is executed (n/grain-size) number of times.
x2 is the constant to represent the computational cost of the addition operation. This step is executed (grain-size) number of times for each spawned preocess in parallel.

Hence total time for a parallel thread is x1(n/grain-size) + x2.(grainsize)

Posted Date: 3/19/2013 3:46:47 AM | Location : United States







Related Discussions:- M - algorithm corrections, Assignment Help, Ask Question on M - algorithm corrections, Get Answer, Expert's Help, M - algorithm corrections Discussions

Write discussion on M - algorithm corrections
Your posts are moderated
Related Questions
A Constructive Example Consider an example , to model a user-defined data type for  strings. The object simulates a character array ( string ) using a character pointer and an

Depreciation to a salvage value of 0. For tax purposes an item may be depreciated over a period of several years, n. With the straight line method of depreciati

Private derivation If no specific derivation is listed, then a private derivation is supposed. If a new class is derived privately from its parent class, then: The priva

Explain the Formatted Input Output with Strings? These are the third set of the scanf and printf families. They are called sscanf and sprintf. sprintf Puts formatted dat

Question 1: (a) Describe the following objects and condition states: (i) ifstream and ofstream objects (ii) eof(), fail(), bad() and good() functions. (b) Write a C++ pr

Comments Comments are integral part of every program . Comments help in coding, debugging and maintaining a program . The compiler ignores them. They should be used liberally i

Describe about the container class. -Class to hold objects in external storage or memory. It acts as a generic holder. - It has a predefined behaviour and a known interface.

how to make a game

write a program to calculate the cuboid

ABC Car Dealership needs your help to update the ordering system. This car dealer is selling four types of vehicles: Sedan, Truck, SUV, and mini Van. And each type of vehicle can h