Solved!
Compiling options were not identical for both versions. The one that crashed used twice as much stack space as the one that didn't. The domain size together with the stack was too large for the 32bit environment applied.
Two more reasons for (a) the 64bit environment and (b) the Linux...
This is a tricky one: I have to maintain 2 versions of an F90 code consisting of ~11000 lines. The only difference between those versions is as follows:
Main program of version A contains an IF block which checks existence or non-existence of a certain file, opens the file, reads it and checks...
The forall construct appears to consume ~5% more CPU time than the 'splitted IF'. For this case, (l,m,n) = (105,105,43). Next i will compare both versions for a configuration with (l,m,n) = (750,500,23) which rewuired ~7 hours CPU time without any tuning of the program.
The routine is part of a numerical flow model, it solves a Poisson equation for pressure. The whole code was designed back in the 90s and still is used by most of my clients on single processor machines (Desktop PC).
The stuff inside the innermost loop looks like this:
pneu = (-...
Thanks for your help, splitting the IF helped a lot. My test case took 599 sec CPU time before i started to tune the code. Replacing most divisions by multiplications reduced that to ~570 sec. Following your suggestion gave a further massive improvement down to 528 sec.
I've just run 2 little test cases with a 2000³ loop, once computing MOD((i+j+k),2), once IAND((i+j+k),1). The former took 20.8 sec, tha latter 20.7. So there is no time to save in this place :)
Is it possible to re-code the following in a more efficient way? The code performs a so-called red-black SOR to solve a Poisson equation, dividing an iterative step into two half-steps with the second using updated neighbored values of the first.
DO ijswap = 0,1
DO k = 2,n-2
DO j =...
I have checked both versions on a quadcore i7 both under Windows 8.1 and Ubuntu 14.04 LTS, compiled with Absoft 14.0. For a problem consuming ~10 minutes of CPU time, the difference between both versions was less than a few seconds. So i will stay with the IF blocks with their superior readability.
I was wondering, which of the following code snippets would usually perform faster.
First avoiding IF statements within the loop, at the cost of a few additional arithmetic operations:
DO k = 2,n-2
DO i = 2,l-2
vvb = sign(0.5,v(i,2,k))
zwil1(i,1,k) =...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.