Write a parallel program with mpi

Assignment Help C/C++ Programming
Reference no: EM13889886

Question: Trying more than two weeks but not getting corect program due date is already over.please hel me anyone

For this project, the students are to use MS Visual Studio to program and run a simple multi-process console program using MPI in visual C++. The MPI libraries can be downloaded and added to visual C++ project on the project property tab. There are many available MPI libraries online, such as MS HPC, MPICH etc. The installation/configuration steps can also be found on the internet, usually from the library provider websites, as computer science master students, this should not be an issue.

The goal of this project is for student to learn the basic implementation of multi-process programming in parallel computing with MPI and using the knowledge learned from the course to decompose a relative complex computation problem into smaller parallel problems.

The student is required to design their own decomposition logic on the given problem, such as the number of processes produced, how and where to pass the result from one process to another etc.

Problem requirement:

Write a parallel program with MPI that supports the following computation.

1). It generates five processes P0, P1, P2, P3, and P4.

2). Main process gets a number n from key board, then initiates MPI.

3) Process Pi (i=0, 1,2,3) uses n to call the following two functions.

a) function prime(int n) finds the smallest prime number q that q=8m+(2i+1) >n for some integer m. Note a prime number p is an integer that is not product of two integers less than p.

B) function twin(int n) finds the least twin number (q, q+2) that q=8m+(2i+1)> n for some integer m. A pair (q,q+2) is a twin if both q and q+2 are prime numbers.

4) P4 gets all four results from the other four processes and returns the least prime number and twin. 

For example, if n=10, P0 returns 11 and (11,13), P1 returns 13 and (17, 19), P2 returns 17 and (17, 19), and P3 returns 19 and (29,31). Finally, P4 returns 11 and (11,13).

Reference no: EM13889886

Previous Q& A

  Difference between a static budget and a continuous budget

Why is the difference between a static budget and a continuous budget important in understanding budgets? How are understandability and comparability enhanced when knowing who is responsible for the budgeting process?

  A random variable x follows a normal distribution

A random variable X follows a normal distribution with standard deviation 13.  A random sample of 30 individuals is selected from the population, and a confidence interval for  is calculated to be (87.348, 96.652).  What is the confidence level for t..

  What are the skills and strengths of the client?

What are the skills and strengths of the client?

  Why profits might not a good indicator for deadweight loss

Provide an explanation for why profits might not be a good indicator for deadweight loss. What about if profits were persistently positive in an industry?

  Probability that the noncritical path

1.In Solved Problem 2, estimate the probability that the noncritical path B,F,G will take more than 20 weeks.

  What are guidelines that enhance master budget comparability

What is a master budget and what are guidelines that enhance its understandability and comparability? Why does the preparation of operating budgets before financial budgets increase the usefulness of the budget process?

  Determine the upper and lower control limits

Cybersecurity is an area of increasing concern. The National Security Agency (NSA) monitors the number of hits at sensitive Web sites. When the number of hits is much larger than normal, there is cause for concern and further investigation is warr..

  Project to design an integrated information database

a. What is the project's duration if only normal times are used?

  Apply concepts of institutional discrimination and social

Apply concepts of institutional discrimination and social and economic justice

  Calculate the mean and standard deviation

Suppose that the incomes of all people in the United States who own hybrid (gas and electric) automobiles are normally distributed with a mean of $78,000 and a standard deviation of $8300.

Reviews

Write a Review

 

Similar Q& A

  Time conversion

Write a C++ program that takes an Eastern standard time in hours, minutes, and seconds,and prints it out in Central time, Mountain time, or Pacific time.

  Determine the manner in which each of the provided concepts

Provide a short code example of the use of C++ syntax within the context of an employee database and determine the manner in which each of the provided concepts relates to the concept of object-oriented programming.

  Uses classes with linked list

Turning a work in C++ that uses classes with a linked list to a no classes project

  Write a method, to be included in a template unsorted list

Write a method, to be included in a template unsorted list class that will print (or reurn) the smallest and the largest values in the list.

  Write a webservices application that does a simple four

write a webservices application that does a simple four function calculator. write a cgi program launched by your

  Initialize an array and fill the array with the gpa values.

Write a program in java that asks user input (using a loop) for name of 10 student and the corresponding grade point averages (GPAs). Initialize an array and fill the array with the GPA values.

  A program in c that adds and subtracts two arrays of size 3

a program in c that adds and subtracts two arrays of size 3 rows of 4 columns using functions to add the arrays and

  Add a non member function

For the code below add the following. Add a non member function that will run the show function of a Sport object. This object is the one parameter of the function.

  Function that will merge the contents

Write a function that will merge the contents of two sorted(ascending order) arrays of type double values, storing the result in an array output parameter (still in ascending order).

  How many whole numbers they wish to enter

Write a program, which will ask the user how many whole numbers they wish to enter. The program will then read that many numbers, print them in the order they were entered, sort them in order by increasing value, and print them in sorted order.

  C programs hat print out the max, min, and the average value

Write three C programs that print out the max, min, and the average values of the data file included below. Be sure to include the outputs of the programs in your solutions. Use three data file structures (counter, sentinel, and neither counter/senti..

  Write a c program to print permutation

Given integer n and permutation of numbers 1,2,..n-1, c program to print permutation that lexicograghically precedes given input permutation if permutation is least print input permutation itself

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