On 4 Mar 2005 at 08:47 PST, Suresh Seetharam wrote:
> This is because I am at present using 3D matrices for my finite element code.
> I attach an extract from my code here.
>
> !- upper triangle
> if (flowindx(4) > 1) then
> m = sum_f*(sum_f-flowindx(4))+(sum_f-flowindx(4))+1 !** fix the position
> do r = 1, flowindx(4)-1
> do i = 1, flowindx(4)-r
> do j = 1, nnelt
> do l = 1, nnelt
> K(m+i,j,l) = K(m+i,j,l) + cdd * Ki(j,l) &
> & * constkcdcd(i+1)
> end do
> end do
> end do
> m=m+sum_f+1
> end do
> end if
>
> When I do profiling using Sun Workshop I came to realise that the K matrix
> above took nearly 20% of the entire processing time for a typical problem
> where flowindx(4)=20. However, the above is the easiest way I can code
> based on my knowledge.
Hi Suresh,
This question is less to do with fortran 90 or 2 or 3D matrices and more to do
with optimization. Think about cache, for a start. Then try to get constant
loop bounds, blocking if necessary.
Ted
--
Ted Stern Applications Group
Cray Inc. office: 206-701-2182
411 First Avenue South, Suite 600 cell: 206-383-1049
Seattle, WA 98104-2860 FAX: 206-701-2500
Frango ut patefaciam -- I break so that I may reveal
(The Paleontological Society motto, equally apropos for debugging)
|