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

Questions Cloud

Calculate hartfords budgeted selling expense for coming year : The company estimates that the sales representatives will drive a total of 70,000 miles next year. Calculate Hartford's budgeted selling expenses for the coming year.
Would ownership of this cylinder provide with market power : An underground vault near Paris contains a cylinder made of iridium and platinum. By definition it weighs one kilogram. Would ownership of this cylinder provide you with market power? Would you be a monopolist?
Assignment oncomprehensive case assessment and presentation- : specify the population involved (race, gender, culture, ethnicity, sexual orientation, ability, or other special circumstance). All cases should be rural.
Does a high long-run elasticity of demand in an industry : Does a very high long-run elasticity of demand in an industry necessarily imply that there is no public policy issue?
Write a parallel program with mpi : Write a parallel program with MPI that supports the computation - design 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.
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?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Organize a lot of data under a single structure

Arrays make it possible to organize a lot of data under a single structure. For example, an application that tracks daily sales revenue at a retail store could use the month and day of the month as indexes to the array to store and to retrieve sales ..

  Enter a length in feet and inches

Write a program the prompts the user to enter a length in feet and inches and outputs the equivalent length in centimeters.If the user enters a negative number or a nondigit number, throw and handle an appropriate exception and prompt the user to ..

  A store with a bag of groceries

write C++ statements that remove all the items from storeBag and place them into one of two new bags, as follows: Place all occurrences of bread and eggs into fragileBag, and all other items into groceryBag. When you are done, storeBag should be empt..

  Write function that calculates the pay amount

Write a second function that calculates the pay amount. If the salesperson owes money, the return amount from the function is a negative number.

  Write a function that takes a linked list of items

Using C++ write a function that takes a linked list of items and deletes all repetitions from the list. in your implementation assume that items can be compared for equality.

  The game of life

The game of Life, invented by the mathematician John H. Conway, is intended to model life in a society of organisms. Consider a rectangular array of cells, each of which may contain an organism

  Each has a string for their name

Create a class in C++ that holds robot warriors. Each has a string for their name, a number of hitpoints (an float), armor (a defensive modifier(an int)), and weaponry (an offensive multiplier(another int)). You will create 5 robots with a random ..

  Write a function to print the data of a student

Write a function to print names of all students who joined in a particular year. Write a function to print the data of a student whose roll number is given.

  Write a program that reads from a file a list of course name

Write a program that reads from a file a list of course names, letter grades for each course and number of credits each course is worth. The program will read each course name, grade earned and number of credits from the file and print out the course..

  Write a small program to simulate a raffle

Write a small program to simulate a raffle (a gambling game) for a group with 100 members. You can simply identify each member with a no-duplicated ID numbers from 01 to 100. A number ticket with a positive 4-digits integer number will be randomly cr..

  Write program to declare the array of type float

Write down the c++ program which declares the array of 50 components of type float. Initialize array so that first 25 components are equal to square of the index variable.

  Write a program in which set up a douhly-subscripted array

Write a program in which you set up a douhly-subscripted array to store each character in the wit. Ube ;old loops, and the most efficient  statements to do it. Include documentation (comment stmts.) in your program.

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