/* * Bryan Ward * mpi_movie.c - generate the frames for a julia set movie * this program uses mpi and distributes among n given processors */ #include #include #include #include #include #include #define width 1280 #define height 1024 #define iter 255 #define frames 100 #define xmin -2.0 #define xmax 2.0 #define ymin -2.0 #define ymax 2.0 int main(int argc, char *argv[]) { // Output variables FILE *fl; char file[4]; // MPI Variables int rank,size,mpistate; MPI_Status mpistatus; //Fractal Variables double xpix, ypix; double complex c,z; int escape; int *image = NULL; int *imagbuf = NULL; //Other Variables int i,f; // Start MPI MPI_Init( &argc, &argv ); MPI_Comm_size( MPI_COMM_WORLD, &size ); MPI_Comm_rank( MPI_COMM_WORLD, &rank ); // initialize the image in memory if((image = (int *)malloc(sizeof(int)*width*height))==NULL) fprintf(stderr,"Could not allocate the necessary memory\n"); // Set some variable values ypix = (ymax - ymin) / height; xpix = (xmax - xmin) / width; // Set the image to 0 everywhere for(i = 0;i