program saxpy implicit none integer, parameter :: dp = selected_real_kind(15) integer, parameter :: ip = selected_int_kind(15) integer(ip) :: i,n real(dp),dimension(:),allocatable :: x, y real(dp) :: a,start_time, end_time n=50000 allocate(x(n),y(n)) !$omp parallel sections !$omp section x = 1.0 !$omp section y = 1.0 !$omp end parallel sections a = 2.0 call cpu_time(start_time) !$omp parallel do default(shared) private(i) do i = 1, n y(i) = y(i) + a * x(i) end do !$omp end parallel do call cpu_time(end_time) deallocate(x,y) print '(a,f8.6)', 'SAXPY Time: ', end_time - start_time end program saxpy