/mobile Handheld Friendly website
Ubuntu : Intel® Q6600® one core |
Each table row shows performance measurements for this C++ g++ program with a particular command-line input value N.
| N | CPU secs | Elapsed secs | Memory KB | Code B | ≈ CPU Load |
|---|---|---|---|---|---|
| 1,000 | 0.86 | 0.86 | 868 | 414 | 0% 3% 1% 99% |
| 4,000 | 11.16 | 11.22 | 872 | 414 | 0% 1% 0% 100% |
| 16,000 | 221.82 | 222.07 | 868 | 414 | 0% 1% 0% 100% |
Read the ↓ make, command line, and program output logs to see how this program was run.
Read mandelbrot benchmark to see what this program should do.
gcc (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3
/* The Computer Language Benchmarks Game http://benchmarksgame.alioth.debian.org/ contributed by Greg Buchholz compile: g++ -O3 */ #include <stdio.h> #include <stdlib.h> #include<iostream> #include<complex> int main (int argc, char **argv) { char bit_num = 0, byte_acc = 0; const int iter = 50; const double lim = 2.0 * 2.0; std::ios_base::sync_with_stdio(false); int n = atoi(argv[1]); std::cout << "P4\n" << n << " " << n << std::endl; for(int y=0; y<n; ++y) for(int x=0; x<n; ++x) { std::complex<double> Z(0,0),C(2*(double)x/n - 1.5, 2*(double)y/n - 1.0); //manually inlining "norm" results in a 5x-7x speedup on gcc for(int i=0; i<iter and Z.real()*Z.real() + Z.imag()*Z.imag() <= lim; ++i) Z = Z*Z + C; byte_acc = (byte_acc << 1) | ((norm(Z) > lim) ? 0x00:0x01); if(++bit_num == 8){ std::cout << byte_acc; bit_num = byte_acc = 0; } else if(x == n-1) { byte_acc <<= (8-n%8); std::cout << byte_acc; bit_num = byte_acc = 0; } } }
Tue, 30 Apr 2013 05:16:37 GMT
MAKE:
/usr/bin/g++ -c -pipe -O3 -fomit-frame-pointer -march=native -mfpmath=sse -msse2 -fopenmp -mfpmath=sse -msse2 mandelbrot.gpp-3.c++ -o mandelbrot.gpp-3.c++.o && \
/usr/bin/g++ mandelbrot.gpp-3.c++.o -o mandelbrot.gpp-3.gpp_run -fopenmp
rm mandelbrot.gpp-3.c++
0.39s to complete and log all make actions
COMMAND LINE:
./mandelbrot.gpp-3.gpp_run 16000
(BINARY) PROGRAM OUTPUT NOT SHOWN