This is the sequential program to calculate the number of points in a mandlebort
ID: 3745077 • Letter: T
Question
This is the sequential program to calculate the number of points in a mandlebort set.
The program reads an
arbitrary number of regions from the command line and outputs, for
each region, the number of points that lie within the set.
Required to write an MPI+OpenMP program that computes
and outputs, in the same way, the number of points in the regions of
the Mandelbrot Set as given on the command line.
The run time should be less with best performance.
Need help With this
Explanation / Answer
#include<mpi.h> //include this header file in the program for mpi programming
#include<cstdio.h>
#include<cstdlib.h>
int inset(double real,double img,int maxiter) {
...//function definition using C language
....
}
int mandelbrotSetCount(double real_lower, double real_upper, double img_lower, double img_upper,int num, int maxiter) {
....// function definition using C language
....
}
// main
int main(int argc,char *argv[]) {
MPI_Init(&argc , &argv); //to initialize the child process
.... //function definition using C language
....
MPI_Finalize(); //to terminate the child process once it is executed before returning from the
//main function
return EXIT_SUCCESS;
} //end of main function
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.