The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Newsgroups: comp.lang.fortran
From: "James Van Buskirk" <not_va...@comcast.net>
Date: Tue, 17 Jun 2008 11:55:04 -0600
Local: Tues, Jun 17 2008 1:55 pm
Subject: Re: Global array operations: a performance hit?
news:9c706700-2861-4d17-a3b8-7e2291fa0b5f@2g2000hsn.googlegroups.com...
> do i=1, ntheta Normally an initialization loop like this one would be faster as > r(0,i) = rhub > r(nr+1,i) = rmax > dt(0,i) = 0.0 > dft(0,i) = 0.0 > dfr(0,i) = 0.0 > dt(nr+1,i) = 0.0 > dft(nr+1,i) = 0.0 > dfr(nr+1,i) = 0.0 > end do > r(0,:) = rhub > r(nr+1,:) = rmax > dt(0,:) = 0.0 > dft(0,:) = 0.0 > dfr(0,:) = 0.0 > dt(nr+1,:) = 0.0 > dft(nr+1,:) = 0.0 > dfr(nr+1,:) = 0.0 > I found the execution time of the latter to be higher than the former, > as if many DO loops were executed instead than just one. Why use > global array operations then? Isn't better to stick to old plain DO > loops? Thanks, separate loops than one fused loop because it's faster to access memory consecutively rather than jumping around as implied by the fused loop. However in this case the loops appear to be setting boundary values so they are traversing rows rather than columns of the arrays. As a consequence the code jumps around in memory no matter what the compiler does and loop fusion can win out because it implies less loop overhead which otherwise would be of negligible importance compared to memory access considerations (assuming that the data set is too large to fit in cache). One thing to investigate is whether the r(i,j), dt(i,j), dft(i,j), -- You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||