How do I design a (C++)program that distributes the work of CODE-1(shown at bott
ID: 3635837 • Letter: H
Question
How do I design a (C++)program that distributes the work of CODE-1(shown at bottom) among a set of processors. The Rank 0 node will serve as the Master processor to prompt the user the maximum number and also print out the number of twin primes in that range. Show the time taken from the time the data is broadcast till the time the result is returned back to the Master node. The distribution strategy used should distribute the work among the nodes so that they do about the same amount of work, (ie: rather than one node doing 3 seconds of work while another does 60 seconds).
******* PLEASE COMMENT CODE ************
The output should look like this:
Enter in a positive number: 15
The number of twin primes is: 3
Time taken: _______ seconds
CODE - 1
Explanation / Answer
#include "stdafx.h" #include using namespace std; int main() { int i,j,n,flag=0,prime_number=0,temp; coutRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.