performance measurements

Each table row shows performance measurements for this Fortran Intel program with a particular command-line input value N.

 N  CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
1,000Bad Output  754   

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.


Intel(R) Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version Build 20150121
Copyright (C) 1985-2015 Intel Corporation. All rights reserved.

 mandelbrot Fortran Intel #3 program source code

! The Computer Language Benchmarks Game
! Simon Geard, 6/1/05
! Modified by Waldemar Spomer, 10/1/09: openmp, one I/O

program mandelbrot
	use omp_lib
	implicit none
	integer N, x, y, bit_num, i, incr, width_bytes
	integer(kind=1) byte_acc, state, mask, res, maskbita, maskbitb
	integer(kind=1), parameter :: K0 = 0, K1 = 1
	integer, parameter :: iter = 50
	real*8, parameter  :: limit2 = 4.0d0
	double precision :: absZ1, absZ2, invert
	character(len=8) argv
	complex(kind=8) Z1, Z2, C1, C2
	logical in_mandelbrot
	! Modified to use pointers
	character(len=1), pointer, dimension(:) :: whole_data, pdata
	double precision, dimension(1:2) :: m1, m2 ! for mask
	nullify(pdata, whole_data)
	call getarg(1,argv)
	read(argv,*) N
	! Output pbm header
	write(*,'(a)') 'P4'
	write(*,'(i0,a,i0)') N,' ',N
	width_bytes = ishft(N,-3)
	invert = 2.0d0/N
	! Modified
	!$omp parallel default(private) shared(whole_data,N,width_bytes,invert)
	!$omp do schedule(dynamic)
	do y=1,N-1
		bit_num = 0
		byte_acc = K0
		! Adopted form c++ example
		pdata => whole_data((y-1)*width_bytes:(y)*width_bytes)
		do x=1,N-1,2
			C1 = cmplx(x*invert-1.5d0,y*invert-1.0d0)
			C2 = cmplx((x+1)*invert-1.5d0,y*invert-1.0d0)
			Z1 = C1
			Z2 = C2
			in_mandelbrot = .true.
			do i=1,iter
				! Adopted from C/C++ example
				Z1 = Z1**2 + C1
				Z2 = Z2**2 + C2
				absZ1 = real(Z1*conjg(Z1))
				absZ2 = real(Z2*conjg(Z2))
				if (absZ2 <= limit2 .AND. absZ1 <= limit2) then
					mask = 3
				else if (absZ2 > limit2 .AND. absZ1 <= limit2) then
					mask = 2
				else if (absZ2 <= limit2 .AND. absZ1 > limit2) then
					mask = 1
				else if (absZ2 > limit2 .AND. absZ1 > limit2) then
					mask = 0
				end if
				res = iand(res,mask)
				if (res==0) exit
			end do
			bit_num = bit_num + 2
			byte_acc = ior(ishft(byte_acc,2),res)
			if (bit_num == 8) then
				! All bits set so output them
				pdata(incr) = char(byte_acc)
				byte_acc = K0
				bit_num = 0

			end if
		end do
	! End of a row so left-justify the bits we have and output them
	byte_acc = ishft(byte_acc,8-mod(N,8))
	pdata(incr) = char(byte_acc)

	end do
	!$omp end do nowait
	!$omp end parallel
	write(*,*) whole_data
	nullify(pdata, whole_data)
end program mandelbrot

 make, command-line, and program output logs

Tue, 24 Mar 2015 22:24:32 GMT

/usr/local/src/intel/bin/ifort -O3 -fast mandelbrot.ifc-3.f90 -o mandelbrot.ifc-3.ifc_run
rm mandelbrot.ifc-3.f90
0.31s to complete and log all make actions

./mandelbrot.ifc-3.ifc_run 1000


_out 1000_out differ: byte 14, line 3


Revised BSD license

  Home   Conclusions   License   Play