Write an MPI program, countprimes which will count the number of prime numbers in the numbers from 1 to n inclusive where n is a long integer. The value for n which should be set in the program using a constant should be 30,000.
Each process will test its share of the cases.
Each process should not print out any primes that it finds, but it should keep a running total. Before the process finishes, it should print out its ID number and its count of primes that it found.
The master process should end with printing a total for the count of the number of primes and the total amount of time taken to find all the primes.
Take a screenshot of the output for running this with 5 processes.
User generated content is uploaded by users for the purposes of learning and should be used following Studypool’s honor code & terms of service.