real, dimension(30000000) :: a
call random_number(a)
print *, sum(a)
That's 30 million doubles, takes 0.04s on my machine. real, dimension(30000000) :: a
call random_number(a)
print *, sum(a)
That's 30 million doubles, takes 0.04s on my machine. !acc region
!acc end region
with the PGI Accelerator. It would have to be a pretty big loop for it to pay off, though, since transfer to/from the GPU is very expensive. pure function diffusion(x0) result(x)
real, intent(in), dimension(:,:) :: x0
real, intent(out),dimension(:,:) :: x
x = x0(2:n+1,1:n ) &
+ x0(0:n-1,1:n ) &
+ x0(1:n ,2:n+1) &
+ x0(1:n ,0:n-1) &
-a*x0(1:n ,1:n )
end function
Some things to note:
OpenFOAM is high quality, but as you’ve seen complex to use. There is a web-based GUI that can lighten the burden to get started somewhat: https://www.simscale.com/ I think they give you ~3000 simulation hours for a trial.