Blitz logo

Blitz Support :

From: Julian Cummings (cummings_at_[hidden])
Date: 2003-05-14 13:12:48


Hello Winn,

What sort of compiler errors do you get from gcc when you declare a
stencil object?
Could you please send an example? There are some examples of using
stencil objects
in the Blitz testsuite codes matthias-troyer-1.cpp and
matthias-troyer-2.cpp. There
is also a fair bit of information on this topic in Chapter 4 of the
Blitz documentation.

You do not need to plant the stencil object into a set of nested loops.
 The looping is
done for you automatically when you apply the stencil object to a set of
Arrays using
the applyStencil() function. In your example, you would say:

BZ_DECLARE_STENCIL3(dohx,hx,ey,ez)
    hx = hx + dtmudz * (ey(1,0,1) - ey(1,0,0)) - dtmudy * (ez(1,1,0) -
ez(1,0,0));
BZ_END_STENCIL

applyStencil(dohx(),hx,ey,ez);

The stencil will be applied over the entire domain of the left-hand side
of the expression
(i.e., the domain of Array hx). You can always hand a view of a subset
of an Array to the
applyStencil() function to apply the stencil to only a subset of the
full domain.

Hope this helps.
Regards, Julian C.

Winfried Bilgic wrote:

>Hello to Blitz Support,
>
>i'm new to Blitz and want to test few things out, to evaluate the behavior of the postulated
>performance bursts. My test framework is the FDTD Scheme for simulating electromagnetic
>Fielddevelopments.
>
>First i need selfdefined stencils, like...
> BZ_DECLARE_STENCIL3(dohx(),hx,ey,ez)
> hx+=hx + dtmudz*(ey(1,0,1) - ey(1,0,0)) - dtmudy*(ez(1,1,0) - ez(1,0,0));
> BZ_END_STENCIL
>
>Second i need to implant this in for loops
>for(i=0; i<(nx-1); i++)
> for(j=0; j<(ny-1); j++)
> for(k=0; k<(nz-1); k++)
> {
> hx(i,j,k) += (dtmudz*(ey(i+1,j,k+1) - ey(i+1,j,k)) - dtmudy*(ez(i+1,j+1,k) - ez(i+1,j,k)));
> }
>
>Using the Blitz arrays was not a problem, but declaring selfdefined stencils gets me many errors from
>gcc 3.1 Compiler. And how do i paste the location i,j,k to the stencil ?
>
>What must be done ?
>
>Winn
>____________________________________________________________________________
>Jetzt bei WEB.DE FreeMail anmelden = 1qm Regenwald schuetzen! Helfen
>Sie mit! Nutzen Sie den Serien-Testsieger. http://user.web.de/Regenwald
>
>_______________________________________________
>Blitz-support mailing list
>Blitz-support_at_[hidden]
>http://www.oonumerics.org/mailman/listinfo.cgi/blitz-support
>
>

-- 
Dr. Julian C. Cummings                       E-mail: cummings_at_[hidden]
California Institute of Technology           Phone:  626-395-2543
1200 E. California Blvd., Mail Code 158-79   Fax:    626-584-5917
Pasadena, CA 91125