#include #include #include extern void mytimer_(int *); #ifdef _OPENMP # include #endif #include "ppm.h" field iterations; int main(int argc, char *argv[]) { double xmin, xmax, ymin, ymax, dx, dy; int numpe, maxiter, ix, iy; TAU_PROFILE_TIMER(mt, "main()", "int (int, char **)", TAU_DEFAULT); TAU_PROFILE_SET_NODE(0); TAU_PROFILE_START(mt); if ( argc != 6 ) { fprintf(stderr, "%s: xmin xmax ymin ymax maxiter\n", argv[0]); fprintf(stderr, "Using defaults: -.59 -.56 .47 .5 216\n"); xmin = -.59; xmax = -.56; ymin = .47; ymax = .5; maxiter = 216; } else { xmin = strtod(argv[1], 0); xmax = strtod(argv[2], 0); ymin = strtod(argv[3], 0); ymax = strtod(argv[4], 0); maxiter = atoi(argv[5]); } /* --- initialization -- */ numpe = 1; dx = (xmax - xmin) / width; dy = (ymax - ymin) / height; /* --- calculate mandelbrot set -- */ mytimer_(0); #pragma omp parallel { TAU_PROFILE_TIMER(pt, "Parallel Region", " " , TAU_DEFAULT); TAU_PROFILE_START(pt); #ifdef _OPENMP numpe = omp_get_num_threads(); #endif #pragma omp for private(ix,iy) for (ix=0; ix