From 436eaa965dbb9befad6606573d6a0e089dd5a02a Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Tue, 14 Sep 2010 14:47:58 -0400 Subject: [PATCH] Removed src/mandelbrot2-old/ (was indeed an earlier version of mandelbrot2/. --- src/mandelbrot2-old/Makefile | 41 ---- src/mandelbrot2-old/mandelbrot_mpe.c | 319 --------------------------- src/mandelbrot2-old/mandelbrot_mpe.h | 0 3 files changed, 360 deletions(-) delete mode 100644 src/mandelbrot2-old/Makefile delete mode 100644 src/mandelbrot2-old/mandelbrot_mpe.c delete mode 100644 src/mandelbrot2-old/mandelbrot_mpe.h diff --git a/src/mandelbrot2-old/Makefile b/src/mandelbrot2-old/Makefile deleted file mode 100644 index 467c581..0000000 --- a/src/mandelbrot2-old/Makefile +++ /dev/null @@ -1,41 +0,0 @@ -# -# To build the Mandelbrot set parallel code -# -ALL: default - -##### User configurable options ##### - -CC = /usr/local/mpich/build/LINUX/ch_p4/lib/../bin/mpicc -CLINKER = $(CC) -INCLUDE_DIR = -I/usr/local/mpich/build/LINUX/ch_p4/lib/../include -I/usr/local/mpich/include -I$(MPE_DIR) -OPTFLAGS = -MPE_GRAPH = -DMPE_GRAPHICS -MPE_DIR = /usr/local/mpich/mpe -LIB_PATH = -L/usr/local/mpich/build/LINUX/ch_p4/lib -lmpe -L/usr/X11R6/lib -lX11 -lm -LOG_LIB = -L/usr/local/mpich/build/LINUX/ch_p4/lib -llmpi -lmpe -lpmpich -L/usr/X11R6/lib -lX11 -lm -PROF_LIB = -L/usr/local/mpich/build/LINUX/ch_p4/lib -lmpe -lpmpich -L/usr/X11R6/lib -lX11 -lm -LDFLAGS = - -### End User configurable options ### - -CFLAGS = -DMPI_LINUX -DFORTRANDOUBLEUNDERSCORE -fPIC -DUSE_STDARG -DHAVE_PROTOTYPES $(OPTFLAGS) $(INCLUDE_DIR) - -EXECS =mandelbrot_mpe - -default: $(EXECS) - -all: default - -mandelbrot_mpe.o:mandelbrot_mpe.h - -mandelbrot_mpe: mandelbrot_mpe.o - $(CLINKER) $(LDFLAGS) -o mandelbrot_mpe mandelbrot_mpe.o $(PROF_LIB) - -clean: - /bin/rm -f *.o *~ $(EXECS) *.log *.out - -.c.o: - $(CC) $(CFLAGS) -c $*.c -.f.o: - $(F77) $(FFLAGS) -c $*.f - diff --git a/src/mandelbrot2-old/mandelbrot_mpe.c b/src/mandelbrot2-old/mandelbrot_mpe.c deleted file mode 100644 index c0d7462..0000000 --- a/src/mandelbrot2-old/mandelbrot_mpe.c +++ /dev/null @@ -1,319 +0,0 @@ - - /**********************************/ - /* */ - /* The Mandelbrot Set */ - /* */ - /* z = z*z + c */ - /* */ - /* parallel version */ - /* */ - /* MPE graph version */ - /* */ - /**********************************/ - - /* Michel Vallieres */ - -#include -#include -#include "mpi.h" -#include "mpe.h" -#include "mpe_graphics.h" - /* large distance; if |z| reaches */ - /* it, point C is not a member */ - /* of the set */ -#define LARGE_RADIUS 2.0 - /* Maximum number of iterations */ - /* before declaring a point in */ - /* the Mandelbrot set */ -#define MAX_ITERATIONS 80 -#define NX 600 /* image size */ -#define NY 500 -#define N_STRIPE 37 /* number of stripes */ -#define MAX_PROC 100 /* max # of processes */ - - - /* prototypes */ -void compute_stripe( double crmin, double crmax, double cimin, double cimax, - int i_min, int i_max, MPE_Point store_points[], - int *store_n, MPE_Color colors[], int nc ); -void grid_stripes( double *crmin, double *crmax, double *cimin, double *cimax, - int begin_stripe[], int last_stripe[] ); -int quit_by_touch( MPE_XGraph graph, int WINDOW_SIZE_X, int WINDOW_SIZE_Y ); - - - -int main( int argc, char *argv[] ) -{ - double crmin, crmax, cimin, cimax; - double global_store_iter[NY*NX]; - int begin_stripe[N_STRIPE], last_stripe[N_STRIPE]; - int stripe; - int store_n, i_point, offset; - int count; - int myid, numprocs; - MPI_Status mesgStatus; - int stripe_in_proc[MAX_PROC], sent_stripe, recv_stripe, from_node, - from_stripe, number_from_node, ip; - int end_signal; - int I_am_done, done_signal; - int nc; - MPE_XGraph graph; - MPE_Point store_points[NY*(NX/N_STRIPE+1)]; - MPE_Color colors[500]; - - /* start the MPI virtual machine */ - MPI_Init(&argc,&argv); - MPI_Comm_size(MPI_COMM_WORLD,&numprocs); - MPI_Comm_rank(MPI_COMM_WORLD,&myid); - - /* start MPE graphics */ - MPE_Open_graphics( &graph, MPI_COMM_WORLD, 0, -1, -1, NX, NY, 0 ); - - /* make a new color palette */ - nc = 127; - MPE_Make_color_array( graph, nc, colors ); - - - /* initialize grid & stripes */ - grid_stripes ( &crmin, &crmax, &cimin, &cimax, begin_stripe, last_stripe ); - - - /*****************/ - /* Master code */ - /*****************/ - if ( myid == 0 ) - { - - count = 0; - - /* initilalize send counter */ - sent_stripe = 0; - /* send a stripe to each slave */ - /* to start local calculation */ - for ( ip=1 ; ip 0 ) - { - last_stripe[0] = last_stripe[0] + 1; - left_over--; - } - /* other stripes */ - for ( stripe = 1; stripe < N_STRIPE ; stripe++ ) - { - begin_stripe[stripe] = last_stripe[stripe-1] + 1 ; - last_stripe[stripe] = begin_stripe[stripe] + w_stripe - 1; - if ( left_over > 0 ) - { - last_stripe[stripe] = last_stripe[stripe] + 1; - left_over--; - } - } -} - - - - -void compute_stripe( double crmin, double crmax, double cimin, double cimax, - int i_min, int i_max, MPE_Point store_points[], - int *store_n, MPE_Color colors[], int nc ) -{ - double z_real, z_img, z_magnitude; - double c_real, c_img, z_current_real; - double dcr, dci; - int i, j; - int counter; - int color_pointer; - - /* scan C values on complex plane */ - dcr = (crmax - crmin)/(double)(NX-1); - dci = (cimax - cimin)/(double)(NY-1); - /* scan stripe */ - *store_n=0; - for ( i=i_min ; i<=i_max; i++ ) - { - for ( j=0 ; j LARGE_RADIUS ) break; - } - /* store iteration numbers */ - /* for use in ploting the set */ - store_points[*store_n].x = i; - store_points[*store_n].y = j; - color_pointer = (int)( (double)(nc*counter) / (double)MAX_ITERATIONS ); - store_points[*store_n].c = colors[ color_pointer]; - (*store_n)++; - } - } - -} - - - - - -int quit_by_touch( MPE_XGraph graph, int WINDOW_SIZE_X, int WINDOW_SIZE_Y ) -{ - /* interacting with graphic */ - int x, y, button, xc, yc, w, h, xs, ys; - - xc = 0; /* draw filled rectangle */ - yc = 0.95*WINDOW_SIZE_Y; /* lower left bottom */ - w = 0.05*WINDOW_SIZE_X; /* corner of graphic window */ - h = WINDOW_SIZE_Y - yc; - /* write a -- Q -- in rectangle */ - MPE_Fill_rectangle( graph, xc, yc, w, h, MPE_BLACK ); - xs = xc + 0.4*w; - ys = yc + 0.8*h; - MPE_Draw_string( graph, xs, ys, MPE_WHITE, "Q" ); - - /* infinite loop */ - /* wait for different touch */ - for ( ; ; ) - { - /* wait for mouse to touch graph */ - /* can only be done by master */ - MPE_Get_mouse_press( graph, &x, &y, &button ); - /* result is touch point */ - fprintf( stderr, "\n Graph coordinates of the touch: %d %d %d \n", x, y, button ); - if ( x < xc+w && y > yc ) - { - fprintf( stderr, "\n Last touch was in the -- quit -- rectangle \n\n" ); - return; - } - } -} - - - - - - - diff --git a/src/mandelbrot2-old/mandelbrot_mpe.h b/src/mandelbrot2-old/mandelbrot_mpe.h deleted file mode 100644 index e69de29..0000000 -- 2.26.2