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

  Linked list in c++

If the following C++ code is valid, show the output. If it is invalid, explain why.

  Program two decimal places

Write a program that prompts the user to enter the mass of a person in kilograms and outputs the equivalent weight in pounds. Output both  the mass and the weight rounded to two decimal places. (Note that for  standard Earth gravity, 1 kilogram =..

  Three or more dimensions

What kind of program, or problem, might necessitate arrays of three or more dimensions?

  Program to declare array alpha of components of type int

Write C++ statements to do the following: Declare an array alpha of 15 components of the type int. Output the value of the tenth component of the array alpha.

  Write main function to compute stress-strain in steel rod

Write a main function and the following functions to compute the stress and strain in a steel rod of diameter D (inches) and length L (inches) subject to the compression loads.

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Create a simple text editor that has one large rich text box

Complete the following programming exercise (SIMPLE TEXT EDITOR WITH ONE LARGE RICH TEXT BOX). You will use the OpenFileDialog, StreamReader and StreamWriter objects; the Close, Peek, ReadLine, ShowDialog and WriteLine methods.

  Write a bouncing ball video game

The balls bounces within the screen where the two horizontal walls are fixed

  Lab9 c lab 9 c i request this twice but no answer on this

lab 9 c ltbrgti request this twice but no answer on this please could you check this for

  Returns a count of the steps through the sort

Please write a c++ implimentation that returns a count of the steps through the sort. (do not worry about updating count, I will rewrite that segemnt. I need help with writing the shell sort.

  This program will simulate the game of hearts

This program will simulate the game of Hearts, which is a four-player trick-taking game using any ordinary deck of playing cards. Each player is dealt thirteen cards. Whoever is dealt the Two of Clubs must lead it to the first trick. Each person p..

  Writer a program that allows the user to enter

Writer a program that allows the user to enter an unknown number of characters, stores those characters in a data structure (a vector) and then prints the values to the screen.

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