Skip to content

Decomp2d_test

BenMql edited this page Jun 10, 2021 · 2 revisions

To test the successful compilation of the 2decomp&fft library, we run Coral with a handful of cores (6 cores in the example below) and with the --checks flag:

mpiexec -n 6 ./coral_LP.exe --checks

Instead of time-stepping the equations, Coral will simply compute G, the forward and backward transform of an array F. Ideally, F=G. Since machine precision is finite, there is a small error between F and G. At the end of the execution, the code displays the error (difference) between the first 3 moments of F and those of G. The result should be close to machine precision. (Note, however, that the moment of the difference is not the difference of the moments, which may therefore be larger than mere machine precision.)

A successful installation of the 2decomp library may yield the output below. If the reported errors are larger, please recompile 2decomp with decreased optimization levels:

 ==========================
 ... Now performing some checks
 ==========================
 ... 
 ... First checking the transforms
 ... Method: initialise one physical fields F. Transform to spectral and back
 ...         G = iDFT( DFT( F )) 
 ... For each process, we compute the error of the first three moments 
 ... of G and F normalized by the moments of F. 
 ... More explicitly, for n=1,2,3, this quantity is:
 ... 
 ==========================
           NX,NY,NZ                   NX,NY,NZ              
             ===                        ===                 
             \                 n        \                 n 
             /   [F(iz,iy,ix)]    __    /   [G(iz,iy,ix)]   
             ===                        ===                 
           ix,iy,iz                   ix,iy,iz              
  E  = ______________________________________________________
   n                NX,NY,NZ 
                      ===     
                      \                 n 
                      /     F(iz,iy,ix)   
                      ===                             
                    ix,iy,iz 
 ==========================
core    3 | E1= 0.000E+00 | E2= 2.981E-14 | E3= 1.103E-15
core    2 | E1= 0.000E+00 | E2= 2.385E-14 | E3= 4.809E-16
core    0 | E1= 0.000E+00 | E2= 8.643E-15 | E3= 0.000E+00
core    4 | E1= 1.126E-16 | E2= 1.446E-14 | E3= 1.166E-14
core    5 | E1= 0.000E+00 | E2= 1.720E-14 | E3= 1.048E-15
core    1 | E1= 1.635E-16 | E2= 1.400E-14 | E3= 4.832E-16