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
The STL details are described in many places online (see the CS377 webpage for some links), and there's a very quick introduction in Section A.14. Here are just a few additional no

What is Namespace and Explicit container Namespace - Namespaces are used to group entities such as objects, classes and functions under a name. Explicit container.

YOU HAVE GIVEN THE MARKED UP PRICE OF 80% AND DISCOUNT PRICE OF 10% THEN FIND THE SELLING PRICE

Many human diseases could be controlled by the knowledge of the gene’s structure and pattern. The human gene could be represented by four nucleotides. Each nucleotide is represente

simple coding for pebble merchant..

//Create a custom calculator program capable of reading the input stream of an expression //and make basic computations to provide answer. //Your program will ask the user to

1 Aims The main purpose of the assignment is to let you practice the following programming techniques: perform operations on pointers to basic and more complex types;

Define How Passing Arrays to a Function? A complete array can be passed to a function as an argument. The manner in which the array is passed be different from that of an ordin

Damjibhai and Shamjibhai are two jeweler friends. They decide to play a simple game. The game comprises of removing the jewels for polishing, turn by turn. Once a jewel is removed