Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
Q. Show the Programmes for Parallel Systems?
Adding elements of an array using two processor
int sum, A[ n] ; //shared variables
void main ( ){
int i ;
for (i=0; i scanf ("%d",&A[i] ); sum=0; // now create process to be executed by processor P1 fork(1) add (A,n/2,n-1, sum); // process to add elements from index n/2 to - 1.sum is output variable // now create process to be executed by processor P0 add (A,0,n/2-1, sum); join 1 ; printf ("%d", sum); } add (int A[ ], int lower, int upper, int sum) { int sum1=0, i; for (i=lower; i<=upper; i++) sum1=sum1+A[i]; lock sum; sum=sum+sum1; unlock sum ; } In this program last half of array is passed to processor P1 that adds them. For the meantime processor P0 adds the first half of array. The variable sum is locked to avoid inconsistency.
scanf ("%d",&A[i] );
sum=0;
// now create process to be executed by processor P1
fork(1) add (A,n/2,n-1, sum); // process to add elements from index n/2 to -
1.sum is output variable // now create process to be executed by processor
P0 add (A,0,n/2-1,
sum);
join 1 ;
printf ("%d", sum);
}
add (int A[ ], int lower, int upper, int sum)
{
int sum1=0, i;
for (i=lower; i<=upper; i++)
sum1=sum1+A[i];
lock sum;
sum=sum+sum1;
unlock sum ;
In this program last half of array is passed to processor P1 that adds them. For the meantime processor P0 adds the first half of array. The variable sum is locked to avoid inconsistency.
ANN Representation: Mostly 'ANNs' are taught on "AI" courses since their motivation from brain studies and the fact which they are used in an "AI" task and namely machine lear
What are the two types of branch prediction techniques available? The two types of branch prediction methods are 1) Static branch prediction 2) Dynamic branch predicti
Problem 1 (a) What is the difference between an MPI blocking send function and an MPI non-blocking send function? (b) What is a communicator in MPI? (c) Name correctly
Q. How to calculate Colour Depth? Colour Depth (or number of Colour Planes) is number of bits assigned to every pixel to code colour information in it. These are also known as
The analog signal needs to be sampled at a minimum sampling rate of: (A) 2fs (B) 1/(2fs) (C) fs/2
Write short note on code optimization. Code optimization: It is the optional phase designed to enhance the intermediate code therefore the Ultimate object program runs quicke
Stata about the Magnetic stripes These comprise information/data stored on magnetic material often on the back of a credit/debit card; the information is automatically read b
Q. Illustrate what is a astrophysics? Answer:- Examine of galaxies, stars and the creation of the universe including predictions about how it will proceed from here.
Q. Describe the Size and Speed of Scanners? Before actual scanning, a quick, low resolution scan known as pre-scan is made to preview the image and select scanning area. After
List all peripheral devices of computer
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!
whatsapp: +91-977-207-8620
Phone: +91-977-207-8620
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd