[Nek5000-users] snapshots in ascii file

nek5000-users at lists.mcs.anl.gov nek5000-users at lists.mcs.anl.gov
Wed Jun 18 07:28:40 CDT 2014


Also, it would be far better to do

        do l=1,nelv
        do k=1,nz1
        do j=1,ny1
        do i=1,nx1
            write(223,*) xm1(i,j,k,l),ym1(i,k,j,l),vx(i,j,k,l),vy(i,j,k,l)
        enddo
        enddo
        enddo
        enddo

or better still:

        n=nx1*ny1*nz1*nelt
        do i=1,n
            write(223,*) xm1(i,1,1,1),ym1(i,1,1,1),vx(i,1,1,1),vy(i,1,1,1)
        enddo

Why?

With your original scheme you are not accessing the data with unit stride,
which means you're generating a lot of unnecessary cache misses and 
unwanted data traffic.   Also, your original scheme writes out all the 
declared elements (lelt) rather than just the active ones (nelt).

Both the approaches above yield the same result with the second
one preferred because it's much easier for the compiler to generate
vector code (in general, but in this case i/o actually inhibits vectorization).
Also, the second case takes up far less precious screen space, which makes
the overall code easier to debug.

Paul

________________________________________
From: nek5000-users-bounces at lists.mcs.anl.gov [nek5000-users-bounces at lists.mcs.anl.gov] on behalf of nek5000-users at lists.mcs.anl.gov [nek5000-users at lists.mcs.anl.gov]
Sent: Wednesday, June 18, 2014 4:16 AM
To: nek5000-users at lists.mcs.anl.gov
Subject: Re: [Nek5000-users] snapshots in ascii file

Hi,
>       do i=1,lx
>          do j=1,ly
>            do k=1,lz

Maybe you meant lx1, ly1, lz1 here. Most probably (unless you defined them
somewhere else), lx, ly, lz are 0, which would explain this:

> but the example.dat file is empty.
--
Ismael
_______________________________________________
Nek5000-users mailing list
Nek5000-users at lists.mcs.anl.gov
https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users


More information about the Nek5000-users mailing list