/* This program was written by Bernd Mohr, FZJ, Germany. It illustrates the use of OpenMP in this Mandelbrot program. The output of this program is an image stored in mandel.ppm. */ // #include // using std::fprintf; // using std::printf; #include // #include // using std::strtod; // using std::atoi; // using std::exit; #include #include #include extern "C" void mytimer_(int *); #ifdef STD_COMPLEX # include typedef std::complex dcomplex; using std::norm; #else # include "TComplex.h" typedef TComplex dcomplex; #endif #ifdef _OPENMP extern "C" { # include } #endif #include "ppmwrite.h" field iterations; int main(int argc, char *argv[]) { double xmin, xmax, ymin, ymax; int maxiter; TAU_PROFILE("main()", "int (int, char **)", TAU_DEFAULT); TAU_PROFILE_SET_NODE(0); // --- init input parameter // -1.5 0.5 -1.0 1.0 // -.59 -.54 -.58 -.53 // -.65 -.4 .475 .725 // -.65 -.5 .575 .725 // -.59 -.56 .47 .5 // -.535 -.555 .49 .51 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]); cout <<"Using xmin = "<