Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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

87% 1:17 #include «cstdlib> return 1 if in set, 0 otherwise int inset (double real, double img, int maxiter) double z real-real: double z-ing img ; for(int iters = 0; iters 4.0) return 0; return 1 // count the number of points in the set, within the region int mandelbrotSetCount (double real_lower, double real_upper, double img_lower, double img upper, int num, int maxiter) int count o double real step(real upper-real_lower)/num

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

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote