100% Guaranteed Results


HPC – Faculty of Computers and Information Solved
$ 24.99
Category:

Description

5/5 – (1 vote)

Assignment 1 –MPI

1. The assignment is individual.
2. Code must be in C and MPI & you must run it before sending.
3. Cheating could lead to serious consequences.
Assignment Title:
Counting Primes Problem Statement:
Students should write a parallel c program for “Counting Primes” using the following two methods: MPI_Send and MPI_Receive ONLY Given
– Lower bound number x
– Upper bound number y Output
– Count of prime numbers occurring between x and y – Count of prime numbers occurring in each process.
Example:
“Total number of prime numbers is: 20”
“Total number of prime numbers in P1 is: 10”
“Total number of prime numbers in P2 is: 6” “Total number of prime numbers in P3 is: 4”

1

Faculty of Computers and Information

Parallelization Scenario Master Process:
– Calculate the sub range size r=(y-x)/p
– Note that p is the number of processes.
– Broadcast x and r to each slave process using MPI_Send.
– Receive sub count from each slave process using MPI_Receive.
– Print total count of primes between x and y.
Slave Process:
– Receive x and r through the MPI_Receive.
– Calculate the lower bound a and upper bound b according to its rank.
– Count primes in its sub range (between a and b).
– Print the partial count
– Send this partial count to the master process using the MPI_Send.

Grading:
Your code should be compiled without any errors or you will lose 50% of assignment grade, also the output of the run should be correct or you will lose 25% of assignment grade
You must use MPI_Send and MPI_Receive ONLY
2

Reviews

There are no reviews yet.

Be the first to review “HPC – Faculty of Computers and Information Solved”

Your email address will not be published. Required fields are marked *

Related products